/*
 * Foot Savi — patient intake stylesheet
 * ─────────────────────────────────────────────────────────────────────────
 *
 * Designed for an elderly primary audience filling out the form on phone or
 * tablet. Visual cues borrowed from footsaving.com (Young Serif + Raleway,
 * deep-navy text, teal accents, white-paper backgrounds) but every decision
 * here is graded against legibility and ease of use, not exact pixel match.
 *
 * Priorities (in order):
 *   1. Every input is clearly demarcated — fill + border + drop shadow so
 *      "where do I type?" is obvious at a glance.
 *   2. Type runs large by default (17–18px body, 1rem field labels).
 *   3. Touch targets are ≥52px tall.
 *   4. Focus rings are a confident 4px teal at ~40% alpha.
 *   5. Sticky progress strip on mobile so the user always knows where they
 *      are; auto-scroll to the next section as each is completed.
 *   6. Errors read in plain English, sized ≥15px, with a leading red badge.
 *   7. Honors prefers-reduced-motion.
 *
 *   Sections
 *   ─────────
 *    1. Tokens
 *    2. Base + page
 *    3. Site header + footer
 *    4. Intro typography
 *    5. Progress strip
 *    6. Form card + section groups
 *    7. Inputs, selects, labels
 *    8. Yes / No pill toggles
 *    9. Validation messages
 *   10. Submit button
 *   11. Thank-you stage
 *   12. Admin views (preserved)
 *   13. Reduced motion
 */


/* ───────────────────────────  1. Tokens  ─────────────────────────── */

:root {
  /* Brand palette lifted from footsaving.com's Squarespace tokens. */
  --brand-white-hsl: 0, 0%, 100%;
  --brand-navy-hsl: 221, 58%, 30%;
  --brand-teal-hsl: 204.39, 79.49%, 38.24%;
  --brand-sky-hsl:  209.23, 52.7%, 70.98%;
  --brand-fog-hsl:  240, 10.53%, 92.55%;

  --brand-white: hsl(var(--brand-white-hsl));
  --brand-navy: hsl(var(--brand-navy-hsl));
  --brand-teal: hsl(var(--brand-teal-hsl));
  --brand-sky:  hsl(var(--brand-sky-hsl));
  --brand-fog:  hsl(var(--brand-fog-hsl));

  /* Semantic — slight blue-tinted page background; pure white form card;
     fog-toned input fill so input boxes read as clearly defined containers. */
  --color-page-bg: hsl(212, 30%, 98%);
  --color-card-bg: hsl(0, 0%, 100%);
  --color-input-bg: hsl(212, 35%, 96%);
  --color-input-bg-focus: hsl(0, 0%, 100%);
  --color-border: hsl(var(--brand-navy-hsl) / 0.14);
  --color-border-strong: hsl(var(--brand-navy-hsl) / 0.32);
  --color-text: var(--brand-navy);
  --color-text-muted: hsl(var(--brand-navy-hsl) / 0.72);
  --color-text-faint: hsl(var(--brand-navy-hsl) / 0.5);

  --color-accent: var(--brand-teal);
  --color-accent-deep: hsl(204.39, 79.49%, 30%);
  --color-accent-soft: hsl(var(--brand-teal-hsl) / 0.1);

  --color-focus-ring: hsl(var(--brand-teal-hsl) / 0.4);

  --color-error: hsl(354, 70%, 42%);
  --color-error-soft: hsl(354, 80%, 96%);

  /* Radius scale. */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-card: 0 1px 0 hsl(var(--brand-navy-hsl) / 0.04),
                 0 12px 36px -18px hsl(var(--brand-navy-hsl) / 0.18);
  --shadow-input: inset 0 1px 0 hsl(var(--brand-navy-hsl) / 0.04),
                  0 1px 0 hsl(var(--brand-navy-hsl) / 0.02);

  --font-display: "Young Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}


/* ───────────────────────────  2. Base + page  ─────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

@media (min-width: 1024px) { body { font-size: 18px; } }


/* ───────────────────────────  3. Site header + footer  ─────────────────────────── */

.site-header {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.375rem;
}

@media (min-width: 720px) {
  .site-header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    text-align: left;
    padding: 2rem 2rem;
  }
}

.site-wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  font-weight: 400;
  color: var(--brand-navy);
  letter-spacing: -0.005em;
  text-decoration: none;
  line-height: 1;
}

.site-wordmark em {
  font-style: italic;
  font-family: "Raleway", serif;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--brand-teal);
}

.site-tagline {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-style: italic;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

@media (min-width: 720px) {
  main { padding: 2.5rem 2rem 5rem; }
}

.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}


/* ───────────────────────────  4. Intro typography  ─────────────────────────── */

.intro {
  margin: 0 0 2rem;
  max-width: 42rem;
}

@media (min-width: 720px) {
  .intro { margin-bottom: 2.5rem; }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--brand-navy);
  margin: 0 0 1rem;
}

h1 em {
  font-style: italic;
  font-family: "Raleway", serif;
  font-weight: 500;
  color: var(--brand-teal);
}

.lede {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 38rem;
}

@media (min-width: 720px) {
  .lede { font-size: 1.1875rem; }
}


/* ───────────────────────────  5. Progress strip  ─────────────────────────── */

.progress {
  margin: 0 0 2rem;
}

@media (min-width: 720px) {
  .progress { margin-bottom: 2.5rem; }
}

.progress-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.progress-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem;
  border-radius: var(--r-md);
}

.progress-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-card-bg);
  border: 2px solid hsl(var(--brand-navy-hsl) / 0.22);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-faint);
  transition: background-color 220ms ease, border-color 220ms ease,
              color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

@media (min-width: 720px) {
  .progress-num { width: 44px; height: 44px; font-size: 1.125rem; }
}

.progress-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  text-align: center;
  line-height: 1.2;
  transition: color 220ms ease;
}

@media (max-width: 419px) {
  /* On the narrowest phones, hide the per-step label — the numeral + the
     "Section X of 5 · Address" caption below is enough. */
  .progress-label { display: none; }
}

@media (min-width: 720px) {
  .progress-label { font-size: 0.8125rem; }
}

/* Connecting line between dots — visually shows progress. */
.progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(0.5rem + 20px - 1px);
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: hsl(var(--brand-navy-hsl) / 0.14);
  z-index: -1;
  transition: background-color 320ms ease;
}

@media (min-width: 720px) {
  .progress-step:not(:last-child)::after {
    top: calc(0.5rem + 22px - 1px);
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
  }
}

/* Active = current section. */
.progress-step.is-active .progress-num {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--brand-white);
  transform: scale(1.05);
  box-shadow: 0 6px 16px -6px hsl(var(--brand-navy-hsl) / 0.4);
}

.progress-step.is-active .progress-label {
  color: var(--brand-navy);
  font-weight: 700;
}

/* Complete = filled out; teal check instead of number. */
.progress-step.is-complete .progress-num {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: var(--brand-white);
  font-size: 0;
}

.progress-step.is-complete .progress-num::after {
  content: "✓";
  font-family: var(--font-body);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--brand-white);
  line-height: 1;
}

.progress-step.is-complete .progress-label {
  color: var(--brand-teal);
}

.progress-step.is-complete:not(:last-child)::after {
  background: var(--brand-teal);
}

.progress-caption {
  margin: 1rem 0 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.progress-caption strong {
  font-weight: 700;
  color: var(--brand-navy);
}

/* Stick to the top on mobile so the user always knows where they are. */
@media (max-width: 719px) {
  .progress {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -1.25rem 1.5rem;
    padding: 0.875rem 1.25rem 0.625rem;
    background: hsl(212, 30%, 98% / 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--brand-navy-hsl) / 0.08);
  }
}


/* ───────────────────────────  6. Form card + section groups  ─────────────────────────── */

.card,
.form {
  background-color: var(--color-card-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem 1.5rem;
  border: 1px solid var(--color-border);
}

@media (min-width: 720px) {
  .card, .form { padding: 3rem 3rem; }
}

.group {
  border: none;
  padding: 0;
  margin: 0 0 2rem;
  position: relative;
}

.group + .group {
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
  margin-top: 2.5rem;
}

@media (min-width: 720px) {
  .group { margin-bottom: 2.5rem; }
  .group + .group { padding-top: 2.5rem; margin-top: 3rem; }
}

.group:last-of-type { margin-bottom: 0; }

legend {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.875rem;
  padding: 0;
  margin: 0;
  width: 100%;
}

.legend-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  font-weight: 400;
  color: var(--brand-navy);
  letter-spacing: -0.005em;
  line-height: 1.15;
}

.legend-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-teal);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.legend-status::before {
  content: "✓";
  font-style: normal;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.group.is-complete .legend-status {
  opacity: 1;
  transform: translateX(0);
}

.group.is-complete .legend-status::after {
  content: "Complete";
}

.group-hint {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0.75rem 0 1.5rem;
  line-height: 1.5;
}

@media (min-width: 720px) {
  .group-hint { font-size: 1.0625rem; margin-bottom: 1.75rem; }
}

.subhead {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 2rem 0 1rem;
}

.subhead .optional {
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--color-text-faint);
}

/* Responsive grid. */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.row + .row { margin-top: 1.25rem; }

@media (min-width: 640px) {
  .row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  /* Three side-by-side inputs only on tablets+ — at narrower widths they
     feel cramped to older eyes. */
  .row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row + .row { margin-top: 1.5rem; }
}


/* ───────────────────────────  7. Inputs, selects, labels  ─────────────────────────── */

label {
  display: block;
  position: relative;
}

.field-label {
  display: block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--brand-navy);
  margin-bottom: 0.5rem;
}

@media (min-width: 720px) {
  .field-label { font-size: 1.0625rem; }
}

.field-label .optional {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  color: var(--color-text-faint);
  margin-left: 0.375rem;
  letter-spacing: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 1rem 1.125rem;
  font-family: var(--font-body);
  font-size: 16px; /* avoid iOS zoom-on-focus */
  font-weight: 500;
  line-height: 1.4;
  color: var(--brand-navy);
  background-color: var(--color-input-bg);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-input);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 180ms ease, background-color 180ms ease,
              box-shadow 180ms ease;
}

@media (min-width: 720px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  select {
    font-size: 1.0625rem;
    min-height: 60px;
    padding: 1.125rem 1.25rem;
  }
}

input::placeholder {
  color: hsl(var(--brand-navy-hsl) / 0.4);
  font-weight: 400;
}

input:hover:not(:focus),
select:hover:not(:focus) {
  border-color: hsl(var(--brand-navy-hsl) / 0.46);
  background-color: hsl(212, 35%, 94%);
}

input:focus,
select:focus {
  outline: none;
  background-color: var(--color-input-bg-focus);
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 4px var(--color-focus-ring),
              var(--shadow-input);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-error);
  background-color: hsl(354, 80%, 98%);
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px hsl(354, 70%, 42% / 0.2),
              var(--shadow-input);
}

/* Select chevron — two thin lines drawn with linear-gradient so there's
   no SVG asset to maintain. */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, hsl(var(--brand-navy-hsl) / 0.6) 50%),
    linear-gradient(135deg, hsl(var(--brand-navy-hsl) / 0.6) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 56%,
    calc(100% - 13px) 56%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
  cursor: pointer;
}

select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-teal) 50%),
    linear-gradient(135deg, var(--brand-teal) 50%, transparent 50%);
}

/* Tint the native calendar picker icon to navy. */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(20%) sepia(50%) saturate(700%) hue-rotate(180deg);
  cursor: pointer;
  opacity: 0.75;
}


/* ───────────────────────────  8. Yes / No pill toggles  ─────────────────────────── */

.yesno {
  margin: 0 0 1.75rem;
}

.yesno:last-child { margin-bottom: 0; }

.yesno-label {
  display: block;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--brand-navy);
  margin-bottom: 0.875rem;
  line-height: 1.45;
}

@media (min-width: 720px) {
  .yesno-label { font-size: 1.125rem; }
}

.options {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.pill {
  flex: 1 1 0;
  min-width: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1.5rem;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brand-navy);
  background: var(--color-input-bg);
  border: 2px solid var(--color-border-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  user-select: none;
  transition: background-color 200ms ease, border-color 200ms ease,
              color 200ms ease, transform 120ms ease, box-shadow 200ms ease;
  box-shadow: var(--shadow-input);
}

@media (min-width: 720px) {
  .pill { min-height: 60px; font-size: 1.125rem; }
}

/* Hide the native radio, keep it operable for screen readers + keyboard. */
.pill input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pill:hover {
  border-color: hsl(var(--brand-navy-hsl) / 0.55);
  background: hsl(212, 35%, 93%);
}

.pill:has(input[type="radio"]:checked) {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: var(--brand-white);
  box-shadow: 0 8px 18px -10px hsl(var(--brand-teal-hsl) / 0.55),
              inset 0 1px 0 hsl(0, 0%, 100% / 0.2);
}

.pill:has(input[type="radio"]:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus-ring),
              var(--shadow-input);
}

.pill:has(input[type="radio"]:checked:focus-visible) {
  box-shadow: 0 0 0 4px var(--color-focus-ring),
              0 8px 18px -10px hsl(var(--brand-teal-hsl) / 0.55);
}

.pill:active { transform: translateY(1px); }


/* ───────────────────────────  9. Validation messages  ─────────────────────────── */

.error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-error);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--color-error);
  color: var(--brand-white);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.alert-error {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin: 0 0 2rem;
  padding: 1.125rem 1.25rem;
  background: var(--color-error-soft);
  border: 1px solid hsl(354, 70%, 42% / 0.2);
  border-left: 4px solid var(--color-error);
  border-radius: var(--r-md);
  color: var(--color-error);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--color-error);
  color: var(--brand-white);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 400;
}


/* ───────────────────────────  10. Submit button  ─────────────────────────── */

.turnstile-wrap {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.form-submit {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

@media (min-width: 720px) {
  .form-submit {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-white);
  background: var(--brand-teal);
  border: none;
  border-radius: var(--r-pill);
  padding: 1.125rem 2.5rem;
  min-height: 60px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 8px 22px -10px hsl(var(--brand-teal-hsl) / 0.5),
              0 2px 4px hsl(var(--brand-navy-hsl) / 0.08);
  transition: background-color 220ms ease, transform 140ms ease,
              box-shadow 220ms ease;
}

@media (min-width: 720px) {
  button[type="submit"] {
    width: auto;
    min-width: 240px;
  }
}

button[type="submit"]:hover {
  background-color: var(--color-accent-deep);
  box-shadow: 0 12px 28px -10px hsl(var(--brand-teal-hsl) / 0.6),
              0 3px 6px hsl(var(--brand-navy-hsl) / 0.1);
  transform: translateY(-1px);
}

button[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px -6px hsl(var(--brand-teal-hsl) / 0.4);
}

button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus-ring),
              0 8px 22px -10px hsl(var(--brand-teal-hsl) / 0.5);
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-submit-note {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 30rem;
  text-align: center;
}

@media (min-width: 720px) {
  .form-submit-note { text-align: left; }
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}


/* ───────────────────────────  11. Thank-you stage  ─────────────────────────── */

.thank-you-stage {
  text-align: center;
  max-width: 36rem;
  margin: 2rem auto;
  padding: 3rem 1.5rem 2.5rem;
  background: var(--color-card-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

@media (min-width: 720px) {
  .thank-you-stage { padding: 4rem 3rem 3rem; }
}

.thank-you-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.5rem;
  color: var(--brand-teal);
  animation: thank-you-pop 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms both;
}

@keyframes thank-you-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.thank-you-icon svg {
  width: 100%;
  height: 100%;
}

.thank-you-icon svg circle { opacity: 0.4; }

.thank-you-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--brand-navy);
  margin: 0 0 1.25rem;
}

.thank-you-title em {
  font-style: italic;
  font-family: "Raleway", serif;
  font-weight: 500;
  color: var(--brand-teal);
}

.thank-you-body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
}

@media (min-width: 720px) {
  .thank-you-body { font-size: 1.125rem; }
}

.thank-you-sign {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--brand-teal);
  margin: 0;
}


/* ───────────────────────────  12. Admin views (preserved)  ─────────────────────────── */

.admin-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.admin-export {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.admin-export input[type="date"] { width: auto; min-height: 40px; padding: 0.5rem 0.75rem; }

.admin-export button[type="submit"] {
  padding: 0.5rem 1.25rem;
  min-height: 40px;
  width: auto;
  min-width: 0;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.admin-meta {
  display: flex;
  gap: 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  background: var(--color-card-bg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-card-bg);
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.admin-table thead th {
  background-color: hsl(212, 35%, 96%);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.admin-table tbody tr:hover {
  background-color: hsl(212, 35%, 97%);
}

.admin-meta-cell {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.admin-phone-masked {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.025em;
}

.admin-flag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.125rem 0.625rem;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.admin-flag-ok {
  background-color: hsl(150, 50%, 92%);
  color: hsl(150, 70%, 22%);
}

.admin-flag-bad {
  background-color: var(--color-error-soft);
  color: var(--color-error);
  font-weight: 700;
}

.admin-action a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.admin-action a:hover { text-decoration: underline; }

.admin-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 1.5rem 0;
}

.admin-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.admin-page {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.admin-page:hover { text-decoration: underline; }

.admin-page-disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
}

.admin-back {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.admin-back a {
  color: var(--color-accent);
  text-decoration: none;
}

.admin-back a:hover { text-decoration: underline; }

.admin-card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.admin-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

@media (min-width: 640px) {
  .admin-detail { grid-template-columns: 1fr 1fr; }
}

.admin-detail-row dt {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.admin-detail-row dd {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--brand-navy);
}

.admin-footer-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}


/* ───────────────────────────  13. Reduced motion  ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
