/* Sagan brand palette (April 2026 digital guide). No pure black.
   Fonts: PP Mori is paid and not bundled in this skeleton, so we fall back to
   system fonts. Add the licensed PP Mori .otf files later, same as the
   retention tool does. */
:root {
  --glacier: #093A3E;
  --dark-glacier: #062B2B;
  --concord: #796AFF;
  --ruby: #FF7455;
  --mint: #5CE3B0;
  --dandelion: #F5B800;
  --space-100: #F5F3F0;
  --space-200: #EDE9E5;
  --space-300: #E3DED8;
  --shadow: 0 20px 60px -15px rgba(9, 58, 62, 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--dark-glacier);
  background: linear-gradient(to bottom right, var(--space-100), #ffffff);
  min-height: 100vh;
}

.topbar {
  padding: 14px 24px;
  background: #fff;
  color: var(--glacier);
  border-bottom: 1px solid var(--space-300);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.02em; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sep {
  padding-left: 12px;
  border-left: 1px solid var(--space-300);
  font-weight: 600;
  color: var(--dark-glacier);
}

.wrap { max-width: 640px; margin: 0 auto; padding: 32px 20px 80px; }
h1 { font-size: 1.6rem; margin: 0 0 6px; color: var(--glacier); }
h2 { font-size: 1.1rem; margin: 0 0 12px; color: var(--glacier); }
.sub { color: #4a5b5b; margin: 0 0 24px; }
.hint { color: #6b7a7a; font-size: 0.88rem; margin: 6px 0; }
.req { font-size: 0.7rem; color: var(--ruby); text-transform: uppercase; font-weight: 700; }

.fee-banner {
  background: var(--glacier);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-weight: 700;
}

.terms-box {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--space-300);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--space-100);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
}
.terms-box p { margin: 0 0 10px; }

.bill { font-size: 0.95rem; }
.bill .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--space-200); }
.bill .row.total { font-weight: 700; border-bottom: none; border-top: 2px solid var(--glacier); margin-top: 4px; padding-top: 10px; color: var(--glacier); }
.bill .row .amt { font-variant-numeric: tabular-nums; }

.card {
  background: #fff;
  border: 1px solid var(--space-300);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 0.85rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--space-300);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--concord);
  box-shadow: 0 0 0 3px rgba(121, 106, 255, 0.15);
}
.other-input { margin-top: 8px; }
.col-span-2 { grid-column: 1 / -1; }

/* Work hours: one inline row of day/time/timezone pickers */
.work-hours-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 6px;
  background: var(--space-100);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--space-300);
}
.work-hours-grid .wh-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.work-hours-grid .wh-label { font-weight: 500; font-size: 0.8rem; color: var(--dark-glacier); }
.work-hours-grid select,
.work-hours-grid input[type="time"] {
  width: auto; min-width: 64px; margin: 0; padding: 6px 10px;
  font-size: 0.9rem; border-radius: 6px;
}
.work-hours-grid input[type="time"] { min-width: 96px; }
.work-hours-grid .wh-sep { color: #8a9797; font-size: 0.85rem; padding: 0 2px; }
.work-hours-grid .wh-timezone-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.work-hours-grid .wh-tz-label { font-size: 0.8rem; font-weight: 500; color: var(--dark-glacier); }
.wh-tz-other { width: 100%; }
.wh-tz-other input { width: 100%; margin-top: 0; padding: 6px 10px; }

@media (max-width: 580px) {
  .work-hours-grid { flex-direction: column; align-items: stretch; }
  .work-hours-grid .wh-timezone-wrap { margin-left: 0; }
  .work-hours-grid select, .work-hours-grid input[type="time"] { flex: 1; }
  /* Stack the two-column form fields on narrow screens so nothing is cramped. */
  .grid { grid-template-columns: 1fr; }
}
input[readonly] { background: var(--space-100); color: #4a5b5b; }
.checkbox { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 10px 0; }
.checkbox input { width: auto; margin-top: 2px; }

.late-box { margin-top: 16px; border-top: 1px dashed var(--space-300); padding-top: 14px; }
.late-fields { margin-top: 8px; }

/* payment choice */
.method-choices { display: grid; gap: 12px; }
.method {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border: 2px solid var(--space-300); border-radius: 10px; cursor: pointer;
}
.method:hover { border-color: var(--concord); }
.method.selected { border-color: var(--glacier); background: var(--space-100); }
.method input { width: auto; margin-top: 3px; }
.method .m-label { font-weight: 700; }
.method .m-note { color: #6b7a7a; font-size: 0.85rem; }

.payment-area { margin-top: 16px; }
#paymentElement { margin: 12px 0; }
.stub {
  border: 2px dashed var(--concord);
  border-radius: 10px;
  padding: 18px;
  color: var(--concord);
  background: #f6f5ff;
  font-size: 0.9rem;
}
.status { font-size: 0.88rem; margin-top: 8px; }
.status.ok { color: #0a7d54; font-weight: 600; }
.status.err { color: var(--ruby); font-weight: 600; }

/* signature */
.sig { margin: 16px 0; }
.sig-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.sig-tab {
  padding: 6px 14px; border: 1px solid var(--space-300); background: #fff;
  border-radius: 8px; cursor: pointer; font-family: var(--font);
}
.sig-tab.active { background: var(--glacier); color: #fff; border-color: var(--glacier); }
#sigPad { border: 1px solid var(--space-300); border-radius: 8px; touch-action: none; background: #fff; width: 100%; max-width: 520px; }
.sig-typed { max-width: 520px; font-size: 1.3rem; font-style: italic; }
.link-btn { background: none; border: none; color: var(--concord); cursor: pointer; padding: 4px 0; }

/* buttons */
.btn {
  border: none; border-radius: 10px; padding: 14px 22px; font-size: 1rem;
  font-weight: 700; cursor: pointer; font-family: var(--font);
}
.btn-primary { background: var(--glacier); color: #fff; width: 100%; transition: background 0.15s, filter 0.15s; }
.btn-primary:hover:not(:disabled) { background: var(--dark-glacier); }
.btn-primary:disabled { background: var(--space-300); color: #8a9797; cursor: not-allowed; }
.btn-secondary { background: var(--dandelion); color: var(--dark-glacier); }
.btn-secondary:hover { filter: brightness(0.94); }
.gate-hint { text-align: center; }

.done { background: #f0fbf6; border: 1px solid var(--mint); border-radius: 14px; padding: 24px; text-align: center; }

@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

/* Fields pre-filled and locked by GPD / the member strategist. */
input.locked, textarea.locked {
  background: #eef1f3;
  color: #4a5763;
  cursor: not-allowed;
}
.lock-note {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7683;
  background: #e6eaee;
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: middle;
}

/* Builder mode (GPD / member strategist prefill). */
.build-banner {
  background: #fff7e6;
  border: 1px solid #f0d38a;
  color: #6b5310;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.build-result {
  background: #f0fbf6;
  border: 1px solid var(--mint);
  border-radius: 14px;
  padding: 18px;
  margin-top: 14px;
}
.build-result-title { font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.build-link {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 12px;
}
.build-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Candidate picker (builder mode). */
.cand-picker { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }

/* Start-date validation */
.start-err { display: block; margin-top: 6px; font-size: 13px; color: #C0392B; font-weight: 600; }
input.input-err { border-color: #C0392B; background: #fdf3f2; }

/* Thank-you page (after submit) */
.thankyou {
  max-width: 640px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(9,58,62,0.08);
}
.thankyou .ty-check {
  width: 76px; height: 76px; line-height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--mint, #5CE3B0);
  color: #062B2B;
  font-size: 40px; font-weight: 700;
}
.thankyou h2 { font-size: 30px; color: var(--ink, #062B2B); margin: 0 0 14px; }
.thankyou .ty-lead { font-size: 17px; color: #093A3E; margin: 0 0 12px; line-height: 1.5; }
.thankyou .ty-sub { font-size: 14px; color: #5E7070; margin: 0; line-height: 1.55; }

/* Talk-to-strategist button (shown when the start date is invalid) */
.ms-btn {
  display: inline-block;
  margin-top: 10px;
  background: var(--glacier, #093A3E);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
}
.ms-btn:hover { opacity: 0.92; }
