/*!
 * Tap.Giving — order-flow progress shell styles
 * Pairs with order-flow-shell.js. See that file's header comment for the
 * full interface. No build step: plain CSS, hand-written (not Tailwind
 * utility classes) on purpose — this file ships independently of the
 * tailwind.css purge/rebuild pipeline (tools/tailwind-build/), so a class
 * this component needs can never silently go missing because some other
 * page hasn't used it yet.
 *
 * Brand tokens below are copied from design.md / tools/tailwind-build/tailwind.config.js.
 * If the brand palette changes, update both places.
 */

.tgfs-bar {
  --tgfs-navy: #1F3A5F;
  --tgfs-navy-dark: #152840;
  --tgfs-gold: #E2A33C;
  --tgfs-gold-dark: #a66d20;
  --tgfs-gray-900: #111827;
  --tgfs-gray-600: #4b5563;
  --tgfs-gray-400: #9ca3af;
  --tgfs-gray-200: #e5e7eb;
  --tgfs-gray-50: #f9fafb;

  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tgfs-gray-200);
  font-family: "Inter", system-ui, sans-serif;
}

.tgfs-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
}

/* Wordmark — plain text, never a link, per spec ("not a link ... no navigation") */
.tgfs-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.tgfs-wordmark svg { height: 1.5rem; width: auto; color: var(--tgfs-navy); flex: none; }
.tgfs-wordmark-text {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  color: var(--tgfs-navy);
}
.tgfs-wordmark-text .tgfs-dot { color: var(--tgfs-gold); }

/* ---------- Desktop (>=1100px): horizontal 3-segment bar ---------- */
.tgfs-desktop {
  display: none;
}
@media (min-width: 1100px) {
  .tgfs-desktop {
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }
  .tgfs-mobile { display: none; }
}

.tgfs-segments {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
}

.tgfs-seg {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  flex: 1;
  border-radius: 0.65rem;
  position: relative;
}
.tgfs-seg + .tgfs-seg { margin-left: 0.25rem; }

.tgfs-seg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

.tgfs-seg-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tgfs-seg-name {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tgfs-seg-state { font-size: 0.72rem; margin-top: 0.1rem; }

/* Done: checkmark + "Done", clickable button, returns to that step */
.tgfs-seg--done {
  cursor: pointer;
  background: var(--tgfs-gray-50);
}
.tgfs-seg--done:hover { background: #f0f4f9; }
.tgfs-seg--done .tgfs-seg-num { background: var(--tgfs-navy); color: #fff; }
.tgfs-seg--done .tgfs-seg-name { color: var(--tgfs-navy); font-weight: 600; }
.tgfs-seg--done .tgfs-seg-state { color: var(--tgfs-gold-dark); font-weight: 600; }
.tgfs-seg--done:focus-visible { outline: 2px solid var(--tgfs-navy); outline-offset: 2px; }

/* Current: strong weight, "You are here" on desktop, filled */
.tgfs-seg--current {
  background: linear-gradient(135deg, var(--tgfs-navy) 0%, var(--tgfs-navy-dark) 100%);
  cursor: default;
}
.tgfs-seg--current .tgfs-seg-num { background: var(--tgfs-gold); color: var(--tgfs-navy-dark); }
.tgfs-seg--current .tgfs-seg-name { color: #fff; font-weight: 700; }
.tgfs-seg--current .tgfs-seg-state { color: rgba(255,255,255,0.85); }

/* Next: muted, "Next", never a button — forward travel only via the step's own primary action */
.tgfs-seg--next { cursor: default; }
.tgfs-seg--next .tgfs-seg-num { background: var(--tgfs-gray-200); color: var(--tgfs-gray-600); }
.tgfs-seg--next .tgfs-seg-name { color: var(--tgfs-gray-400); font-weight: 500; }
.tgfs-seg--next .tgfs-seg-state { color: var(--tgfs-gray-400); }

/* ---------- Mobile (<1100px): two text lines above a filled 3-segment bar ---------- */
.tgfs-mobile { display: block; }
@media (min-width: 1100px) {
  .tgfs-mobile { display: none; }
}
.tgfs-mobile .tgfs-wordmark { margin-bottom: 0.5rem; }
.tgfs-mobile-head {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tgfs-gray-900);
}
.tgfs-mobile-sub {
  font-size: 0.78rem;
  color: var(--tgfs-gray-600);
  margin-top: 0.15rem;
}
.tgfs-mobile-bar {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.tgfs-mobile-seg {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: var(--tgfs-gray-200);
}
.tgfs-mobile-seg--done,
.tgfs-mobile-seg--current { background: var(--tgfs-navy); cursor: pointer; }
.tgfs-mobile-seg--done:focus-visible,
.tgfs-mobile-seg--current:focus-visible { outline: 2px solid var(--tgfs-navy); outline-offset: 2px; }
.tgfs-mobile-seg--next { background: var(--tgfs-gray-200); cursor: default; }
/* Only Done segments are real buttons (see JS); current/next render as <span> and
   never take a pointer cursor even if a future edit swaps the element type. */
span.tgfs-mobile-seg--current, span.tgfs-mobile-seg--next { cursor: default; }

/* ---------- Legal links (Privacy/Terms) — allowed on all three steps, Ryan 2026-10-22 ---------- */
.tgfs-legal {
  font-size: 0.78rem;
  color: var(--tgfs-gray-400);
  text-align: center;
  margin: 1.25rem 0 0.5rem;
  font-family: "Inter", system-ui, sans-serif;
}
.tgfs-legal a {
  color: var(--tgfs-gray-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tgfs-legal a:hover { color: var(--tgfs-navy); }

/* ---------- Save-failure banner (spec's "Failure honesty" rule) ---------- */
.tgfs-save-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 0.65rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin: 0.75rem auto 0;
  max-width: 1100px;
}
