/* groundwork-tokens.css
   "Pilgrim" design system — colors, typography, spacing, components.
   Source of truth: docs/design_handoff_registration_redesign/README.md */

:root {
  /* Colors */
  --bg: #f7f2e8;
  --surface: #ffffff;
  --ink: #2a231b;
  --ink-muted: #6f6457;
  --line: #e7dfd0;
  --line-soft: #f0e9da;
  --terracotta: #b2533a;
  --terracotta-soft: #f1d9cf;
  --olive: #6b6a3a;
  --olive-soft: #e4e1c8;
  --gold: #caa96b;
  --cream2: #efe7d4;
  --ochre: #d98f3c;
  --waiting-bg: #f9e9cf;
  --waiting-fg: #a47a2a;
  --signature-tint: #fafbf6;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing & layout */
  --page-pad-x: clamp(20px, 5vw, 48px);
  --page-pad-top: clamp(14px, 3vw, 28px);
  --page-pad-bottom: clamp(22px, 5vw, 48px);
  --rail-gap: clamp(24px, 4vw, 56px);
  --rail-width: 280px;
  --field-mb: 22px;
  --field-mb-mobile: 18px;
  --card-pad: clamp(14px, 3vw, 32px);

  /* Borders & radii */
  --radius: 2px;
  --border: 1px solid var(--line);
  --border-soft: 1px solid var(--line-soft);
}

/* ───────────────────────── Typography utilities ───────────────────────── */

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.eyebrow--accent { color: var(--terracotta); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -1.2px;
  line-height: 1.05;
  color: var(--ink);
}
.display--page { font-size: clamp(28px, 5vw, 46px); }
.display--section { font-size: 22px; line-height: 1.2; letter-spacing: -0.4px; }
.display--total { font-size: clamp(34px, 5vw, 44px); letter-spacing: -1.5px; }

.body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.body--lg { font-size: 15px; line-height: 1.6; }
.body--muted { color: var(--ink-muted); }

.label {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.helper {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.helper--error { color: var(--terracotta); }

/* Inline warning for things the registrant must read before continuing
   (e.g. "the program is in English"). Larger than .helper so it isn't
   missed; terracotta to match the warning palette. */
.gw-notice {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--terracotta);
  margin: 6px 0;
}

.mono {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.price {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.price--total { font-size: 17px; }

@media (max-width: 639px) {
  .display--page { letter-spacing: -0.7px; line-height: 1.08; }
  .body { font-size: 12.5px; }
  .body--lg { font-size: 14px; }
  .label { font-size: 11px; }
  .helper { font-size: 11.5px; }
  .gw-notice { font-size: 14.5px; }
  .price { font-size: 13.5px; }
  .price--total { font-size: 14.5px; }
}

/* ───────────────────────── Buttons ───────────────────────── */

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  line-height: 1;
}
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* Compound class selectors (.btn.btn--X) bump specificity so Bootstrap's
   later-loading `.btn { border: 1px solid transparent }` rule does not
   clobber border-color etc. on the variants. */

.btn.btn--primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn.btn--primary:hover:not(:disabled) { background: #1f1a13; border-color: #1f1a13; }
.btn.btn--primary:active:not(:disabled) { background: #15110b; border-color: #15110b; }

/* Continue / primary CTA — outlined in normal state, fills on hover with white text. */
.btn.btn--accent {
  background: transparent;
  color: var(--terracotta);
  border: 1px solid var(--terracotta);
}
.btn.btn--accent:hover:not(:disabled) {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}
.btn.btn--accent:active:not(:disabled) {
  background: #8c4029;
  color: #fff;
  border-color: #8c4029;
}

.btn.btn--secondary { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.btn--secondary:hover:not(:disabled) { background: var(--line-soft); }

/* Back / subtle CTA — outlined in normal state, fills on hover with white text. */
.btn.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.btn--ghost:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn--full { width: 100%; }
.btn--lg { padding: 15px 26px; font-size: 15px; }

@media (max-width: 639px) {
  .btn { padding: 14px 18px; }
}

/* ───────────────────────── Inputs ───────────────────────── */

.input,
input[type="text"].input,
input[type="email"].input,
input[type="password"].input,
input[type="number"].input,
input[type="tel"].input,
select.input,
textarea.input {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 120ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus,
.input:focus-visible {
  outline: none;
  border: 1.5px solid var(--ink);
  padding: 13.5px 15.5px; /* compensate for 1.5px border to avoid layout shift */
}

.input.is-error {
  border: 1.5px solid var(--terracotta);
  padding: 13.5px 15.5px;
}

.input--dashed {
  border-style: dashed;
  border-width: 1.5px;
}

select.input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'><path fill='none' stroke='%236f6457' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--field-mb);
}
@media (max-width: 639px) {
  .field { margin-bottom: var(--field-mb-mobile); }
  .input { font-size: 15px; padding: 13px 14px; }
  .input:focus, .input.is-error { padding: 12.5px 13.5px; }
}

/* ───────────────────────── Cards ───────────────────────── */

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
}
.card--cream2 {
  background: var(--cream2);
  border-color: var(--line);
}
.card--olive-note {
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--olive);
}
.card--gold-note {
  background: var(--cream2);
  border: var(--border);
  border-left: 3px solid var(--gold);
}
.card--terracotta-note {
  background: var(--surface);
  border: var(--border);
  border-left: 3px solid var(--terracotta);
}
.card--ink {
  background: var(--ink);
  color: #fff;
  border: none;
}
.card--ink .label { color: rgba(255,255,255,0.7); }
.card--ink .body { color: rgba(255,255,255,0.85); }

/* ───────────────────────── Avatars / chips / badges ───────────────────────── */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  flex-shrink: 0;
}
.avatar--adult { background: var(--terracotta-soft); color: var(--terracotta); }
.avatar--child { background: var(--olive-soft); color: var(--olive); }
.avatar--sm { width: 34px; height: 34px; font-size: 14px; }
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }

.role-chip {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.role-chip--adult { color: var(--terracotta); }
.role-chip--child { color: var(--olive); }

.status-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.status-badge--registering { background: var(--olive-soft); color: var(--olive); }
.status-badge--waiting { background: var(--waiting-bg); color: var(--waiting-fg); }
.status-badge--signed { background: var(--olive); color: #fff; }

/* ───────────────────────── Layout helpers ───────────────────────── */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
  gap: var(--rail-gap);
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
.shell__main { min-width: 0; max-width: 680px; }
.shell__rail { display: flex; flex-direction: column; gap: 16px; }

.shell--no-rail { grid-template-columns: 1fr; }
.shell--no-rail .shell__main { max-width: 720px; margin: 0 auto; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; gap: 24px; }
  .shell__main { max-width: 720px; margin: 0 auto; }
  .shell__rail { max-width: 720px; margin: 0 auto; width: 100%; }
}

.row-1fr-1fr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 22px;
  row-gap: 6px;
}
.row-1fr-1fr > .col-span-2 { grid-column: 1 / -1; }
@media (max-width: 639px) {
  .row-1fr-1fr { grid-template-columns: 1fr; }
}

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}
.action-row--right { justify-content: flex-end; }
.action-row--split { justify-content: space-between; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--lg { gap: 24px; }
.stack--sm { gap: 8px; }

/* These override component-level display rules. Use !important so partials
   that set their own display: flex etc. still get hidden at the right viewport. */
.hide-desktop { display: none !important; }
@media (max-width: 639px) {
  .hide-desktop { display: revert !important; }
  .hide-mobile  { display: none !important; }
}

/* ───────────────────────── Focus ring (accessibility) ───────────────────────── */

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}
