/* Clarity 2.0, public pages. Phone first (works from 320px), 16px gutters, system fonts, light + dark. */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #17181c;
  --muted: #565964;
  --border: #d6d3cc;
  --border-strong: #9a9790;
  --accent: #2f3fb3;
  --accent-hover: #26339a;
  --accent-text: #ffffff;
  --accent-soft: #e6e8fb;
  --focus: #f0a500;
  --err: #b3261e;
  --err-soft: #fbe9e7;
  --ok: #1d7a3e;
  --info-soft: #eef3fb;
  --radius: 12px;
  --gutter: 16px;
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111216;
    --surface: #1b1d23;
    --surface-2: #23262e;
    --text: #eceef3;
    --muted: #a8adbb;
    --border: #353945;
    --border-strong: #5c6273;
    --accent: #8f9cff;
    --accent-hover: #a9b3ff;
    --accent-text: #0d1030;
    --accent-soft: #252a4d;
    --focus: #ffc94d;
    --err: #ffb4ab;
    --err-soft: #3a1d1a;
    --ok: #7fd99a;
    --info-soft: #1c2638;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 8px; }

.mock-banner {
  margin: 0; padding: 8px var(--gutter); text-align: center; font-size: 14px; font-weight: 600;
  background: #fff3c4; color: #4a3800;
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px var(--gutter);
  margin: 0 0 16px;
}

/* ---------------- loading ---------------- */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; justify-content: center; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------------- form ---------------- */
.form-head { margin-bottom: 16px; }
.form-head .desc { color: var(--muted); }

.progress { margin: 0 0 16px; }
.step-label { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
progress {
  display: block; width: 100%; height: 6px; border: 0; border-radius: 3px;
  background: var(--surface-2); overflow: hidden; appearance: none; -webkit-appearance: none;
}
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.q {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.q > label, .q > legend {
  display: block; font-weight: 600; margin: 0 0 8px; padding: 0; line-height: 1.35;
}
.req { color: var(--err); }
.opt-tag { color: var(--muted); font-weight: 400; font-size: 14px; }

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
textarea { resize: vertical; min-height: 96px; }
input[aria-invalid="true"], textarea[aria-invalid="true"], .q.invalid .opt { border-color: var(--err); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

.phone { display: flex; gap: 8px; }
.phone select { flex: 0 0 auto; width: 7.5rem; padding-right: 4px; text-overflow: ellipsis; }
.phone input { flex: 1 1 auto; min-width: 0; }

.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.hint.ok { color: var(--ok); }
.field-err { color: var(--err); font-size: 14px; font-weight: 600; margin: 6px 0 0; }

.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: var(--tap);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.35;
}
.opt input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.clear-choice { margin-top: 6px; }

.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); }
.check input { width: 24px; height: 24px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.check label { font-weight: 600; cursor: pointer; }

.nav { display: flex; gap: 12px; margin: 16px 0 0; }
.nav .btn { flex: 1 1 0; }
.final { margin-top: 8px; }
.final .btn.big { margin-top: 12px; }
.privacy { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap);
  padding: 10px 18px;
  font: inherit; font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { border-color: var(--accent); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.05rem; letter-spacing: 0.02em; }
.btn.wide { width: 100%; }
.btn.link {
  background: none; border: 0; padding: 4px 2px; min-height: 0; color: var(--accent);
  text-decoration: underline; font-weight: 600;
}
.btn.link.small { font-size: 14px; }
.btn:disabled { opacity: 0.65; cursor: progress; }

/* ---------------- banners ---------------- */
.banner { border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-weight: 600; }
.banner.err { background: var(--err-soft); color: var(--err); border: 1px solid var(--err); }
.banner.info { background: var(--info-soft); border: 1px solid var(--accent); }
.banner.info p { margin-bottom: 10px; }
.banner .slot-grid { margin: 0; }

/* ---------------- mentor card ---------------- */
.mentor { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.mentor p { margin: 0; }
.mentor.photo-only { justify-content: center; margin-bottom: 8px; }
.mentor.photo-only .avatar { width: 72px; height: 72px; font-size: 1.8rem; }
.mentor-name { font-weight: 700; font-size: 1.1rem; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}
.avatar.initial {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem; color: var(--accent); background: var(--accent-soft);
}
/* A shared calendar ("One of our mentors"): the mentors' faces, overlapping. */
.avatars { display: inline-flex; flex: 0 0 auto; }
.avatars .avatar { width: 40px; height: 40px; font-size: 1rem; box-shadow: 0 0 0 2px var(--bg); }
.avatars .avatar + .avatar { margin-left: -10px; }

/* ---------------- slots ---------------- */
.sub-head { font-size: 1rem; margin: 16px 0 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 10px 6px;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}
.slot:hover { border-color: var(--accent); background: var(--accent-soft); }
.slot-day { font-size: 13px; color: var(--muted); font-weight: 600; }
.slot-time { font-size: 1.05rem; font-weight: 700; }
.slot-ist { font-size: 12px; color: var(--muted); }

.more-box { margin-top: 8px; }
.day-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.day-chip {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-height: var(--tap); padding: 8px 4px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer;
}
.day-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.chip-top { font-size: 13px; font-weight: 700; }
.chip-date { font-size: 13px; }
.chip-count { font-size: 12px; color: var(--muted); }
.day-heading { margin-top: 16px; }
.restart { margin-top: 24px; text-align: center; }

/* ---------------- confirm / thank-you ---------------- */
.summary .when, .when { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.summary p { margin-bottom: 4px; }
.summary { padding-bottom: 16px; }
.card > .sub-head:first-child { margin-top: 0; }
.contact { font-size: 15px; }
.extras { margin: 8px 0 8px; }
.actions { display: grid; gap: 10px; margin: 0 0 16px; }
.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.body-text { text-align: left; }
.card.center .btn { margin-top: 8px; }

/* Turnstile: invisible unless Cloudflare asks the visitor to tick. */
.ts-box { display: flex; justify-content: center; margin: 0; }
.ts-box.ts-visible { margin: 12px 0; }

.foot { text-align: center; padding: 0 var(--gutter) 24px; font-size: 14px; }
.foot a { color: var(--muted); }

/* ---------------- privacy page ---------------- */
.doc h1 { margin-bottom: 4px; }
.doc h2 { margin-top: 24px; }
.doc ul { padding-left: 20px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--border); }

/* Larger screens: a little more air, same single column. */
@media (min-width: 600px) {
  .wrap { padding-top: 40px; }
  h1 { font-size: 1.75rem; }
  .slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
