/* ============================================================
   NAVAFIT YOGA — International Day of Yoga Quiz
   Design system: editorial serif over calm, warm-paper canvas
   ============================================================ */

:root {
  /* paper / ink */
  --paper:      #f4f1e8;
  --paper-2:    #ece6d8;
  --paper-3:    #e3dccb;
  --card:       #fbf9f3;

  --ink:        #21383b;   /* deep teal-slate (display + body) */
  --ink-soft:   #50686a;
  --ink-faint:  #8a9a98;
  --line:       #d8d1c1;

  /* accents */
  --sage:       #5b7a4f;
  --sage-deep:  #455f3b;
  --sage-tint:  #e9ecdf;
  --gold:       #b08d4f;
  --gold-tint:  #efe6d2;

  --shadow-sm:  0 1px 2px rgba(33,56,59,.05), 0 2px 8px rgba(33,56,59,.05);
  --shadow-md:  0 4px 14px rgba(33,56,59,.08), 0 18px 50px rgba(33,56,59,.10);
  --shadow-lg:  0 10px 30px rgba(33,56,59,.10), 0 40px 90px rgba(33,56,59,.16);

  --ease: cubic-bezier(.22,.61,.36,1);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper grain — very subtle */
.paper-grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(rgba(33,56,59,.04) 1px, transparent 1.4px);
  background-size: 4px 4px;
}

#root { position: relative; z-index: 1; }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.eyebrow.muted { color: var(--ink-faint); }

.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.01em;
  color: var(--ink);
}

.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 30px;
  transition: transform .35s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--sage-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary:disabled {
  background: var(--paper-3);
  color: var(--ink-faint);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); background: rgba(255,255,255,.4); }

.btn-arrow svg { transition: transform .35s var(--ease); }
.btn-primary:hover .btn-arrow svg { transform: translateX(4px); }

/* ---------- generic screen wrapper ---------- */
.screen {
  position: relative;
  min-height: 100dvh;
  width: 100%;
}

/* fade/slide transitions between screens */
.fade-enter   { opacity: 0; transform: translateY(14px); }
.fade-in      { opacity: 1; transform: translateY(0); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.fade-out     { opacity: 0; transform: translateY(-10px); transition: opacity 1s var(--ease), transform 1s var(--ease); }

/* tiny line-art divider */
.hr-dot {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink-faint);
}
.hr-dot::before, .hr-dot::after {
  content: ""; width: 34px; height: 1px; background: var(--line);
}

/* image slot defaults */
image-slot {
  --is-bg: var(--paper-2);
  display: block;
}

::selection { background: var(--sage); color: var(--paper); }

/* ============================================================
   WELCOME
   ============================================================ */
.welcome {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 100dvh;
  padding: clamp(24px, 4vh, 44px) 40px;
  gap: clamp(10px, 2vh, 22px);
  overflow-y: auto;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--paper) 40%, var(--paper-2) 100%);
}
.welcome-display {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  line-height: .86;
  letter-spacing: -.015em;
  margin: 0;
}
.welcome-n   { font-size: clamp(56px, 11vw, 152px); display: block; }
.welcome-yoga {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: clamp(.16em, 2.2vw, .5em);
  text-transform: uppercase;
  font-size: clamp(17px, 4vw, 44px);
  color: var(--sage-deep);
  margin-top: clamp(6px, 1.2vw, 14px);
  padding-left: clamp(.16em, 2.2vw, .5em); /* optical centre vs tracking */
}

/* ---- hosts & collaborators on the welcome screen ---- */
.collab {
  margin-top: clamp(26px, 4vh, 48px);
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
}
.collab-label {
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.host-badge {
  width: clamp(64px, 9vw, 84px); aspect-ratio: 1;
  border-radius: 50%; background: #0a0a0a;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
}
.host-badge img { width: 100%; height: 100%; object-fit: contain; }
.collab-divider { height: clamp(10px, 2vh, 18px); }
.collab-row {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: clamp(12px, 1.6vw, 20px);
}
.collab-chip {
  height: clamp(48px, 7vh, 62px);
  padding: 8px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(44,42,38,.06);
}
.collab-chip img { height: 100%; width: auto; max-width: 130px; object-fit: contain; display: block; }

/* ============================================================
   AUTH (split)
   ============================================================ */
.auth {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100dvh;
}
.auth-left {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(40px, 5vw, 80px);
  display: flex; flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-right {
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}
.prize-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  padding: 26px 0;
  border-top: 1px solid rgba(244,241,232,.16);
  align-items: start;
}
.prize-row:last-child { border-bottom: 1px solid rgba(244,241,232,.16); }
.prize-place {
  font-family: var(--serif);
  font-size: 54px; font-weight: 500; line-height: 1;
  color: rgba(244,241,232,.32);
}
.prize-row.is-gold  .prize-place { color: var(--gold); }
.prize-row.is-sage  .prize-place { color: #9bb585; }

.auth-card {
  width: 100%;
  max-width: 420px;
}
.tabs {
  display: flex; gap: 4px;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 30px;
}
.tab {
  flex: 1; text-align: center;
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  padding: 11px; border-radius: 999px; cursor: pointer;
  color: var(--ink-soft); border: none; background: transparent;
  transition: all .3s var(--ease);
}
.tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border .25s var(--ease), box-shadow .25s var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-tint);
}
.field input::placeholder { color: var(--ink-faint); }

/* ============================================================
   INFO
   ============================================================ */
.info {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 5vw, 72px);
  background: radial-gradient(120% 100% at 80% 0%, var(--paper) 50%, var(--paper-2) 100%);
}
.info-card {
  width: 100%;
  max-width: 880px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(34px, 4.5vw, 64px);
  box-shadow: var(--shadow-lg);
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 40px;
  margin: 34px 0 38px;
}
.info-point {
  display: grid; grid-template-columns: auto 1fr; gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.info-point .n {
  font-family: var(--serif); font-size: 30px; color: var(--sage);
  line-height: 1;
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: clamp(20px, 3vw, 40px);
  background: radial-gradient(130% 100% at 15% 0%, var(--paper) 45%, var(--paper-2) 100%);
}
.quiz-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  max-width: 920px; width: 100%; margin: 0 auto;
}
.progress-track {
  flex: 1;
  height: 3px; background: var(--paper-3);
  border-radius: 3px; overflow: hidden; margin: 0 24px;
}
.progress-fill {
  height: 100%; background: var(--sage);
  border-radius: 3px; transition: width .6s var(--ease);
}
.quiz-body {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}
.quiz-card {
  width: 100%; max-width: 760px;
}
.q-options { display: grid; gap: 12px; margin-top: 34px; }
.opt {
  display: flex; align-items: center; gap: 16px;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  cursor: pointer;
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  transition: all .25s var(--ease);
  width: 100%;
}
.opt:hover { border-color: var(--sage); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.opt.selected {
  border-color: var(--sage);
  background: var(--sage-tint);
  box-shadow: 0 0 0 3px var(--sage-tint);
}
.opt-bullet {
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  transition: all .25s var(--ease);
}
.opt.selected .opt-bullet { background: var(--sage); border-color: var(--sage); color: var(--paper); }

.quiz-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 34px; gap: 16px;
}
.quiz-nav-right { display: flex; align-items: center; gap: 18px; }

/* ============================================================
   RESULT + CERTIFICATE
   ============================================================ */
.result {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 5vw, 64px);
  background: radial-gradient(120% 100% at 50% -10%, var(--paper) 45%, var(--paper-2) 100%);
}
.result-inner { width: 100%; max-width: 940px; }
.score-ring {
  --p: 0;
  width: 180px; height: 180px; border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(closest-side, var(--card) 79%, transparent 80% 100%),
    conic-gradient(var(--sage) calc(var(--p) * 1%), var(--paper-3) 0);
  box-shadow: var(--shadow-md);
}

.certificate {
  position: relative;
  background:
    linear-gradient(180deg, #fdfbf5, #f7f2e6);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: clamp(30px, 4vw, 56px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
}
.certificate::before {
  content: "";
  position: absolute; inset: 12px;
  border: 1px solid rgba(176,141,79,.4);
  border-radius: 4px;
  pointer-events: none;
}
.cert-seal {
  width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid var(--gold);
  display: grid; place-items: center;
  margin: 0 auto;
  background: var(--gold-tint);
}
.cert-name {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(38px, 6vw, 64px);
  color: var(--ink); line-height: 1;
  border-bottom: 1px solid var(--line);
  display: inline-block; padding: 0 30px 14px;
  margin: 6px 0 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { order: 2; padding: clamp(36px, 8vw, 56px); }
  .auth-right { order: 1; padding-top: 48px; padding-bottom: 48px; }
  .info-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
  /* welcome */
  .welcome { padding: clamp(20px, 4vh, 36px) 20px; }

  /* quiz top bar — tighten the progress gutters */
  .progress-track { margin: 0 12px; }

  /* quiz bottom nav — let it wrap instead of overflowing */
  .quiz-nav { flex-wrap: wrap; gap: 12px; margin-top: 26px; }
  .quiz-nav-right { gap: 12px; margin-left: auto; }

  /* info header counter sits inline, not pushed far right */
  .info-card { border-radius: 20px; }
}

@media (max-width: 560px) {
  .btn { padding: 13px 22px; font-size: 14.5px; }
  .opt { padding: 15px 16px; font-size: 15px; }
  .opt-bullet { width: 24px; height: 24px; }
  .q-options { margin-top: 24px; }
  .prize-place { font-size: 42px; }
  .prize-row { gap: 16px; padding: 20px 0; }
  .info-point { padding: 16px 0; }
  .score-ring { width: 150px; height: 150px; }
}

@media (max-width: 420px) {
  /* profile: stack city / state */
  .field-row { flex-direction: column; gap: 0 !important; }

  /* quiz nav: full-width buttons, drop the redundant counter */
  .quiz-answered { display: none; }
  .quiz-nav { flex-direction: column-reverse; align-items: stretch; }
  .quiz-nav .btn { width: 100%; }
  .quiz-nav-right { flex-direction: column; align-items: stretch; gap: 10px; margin-left: 0; }

  /* result stats: wrap if needed */
  .welcome-yoga { letter-spacing: .16em; }

  /* welcome collaborator chips: keep clear spacing, avoid crowding */
  .collab-row { gap: 12px 14px; }
  .collab-chip { height: 50px; padding: 6px 14px; }
  .collab-chip img { max-width: 104px; }
}

/* ============================================================
   CERTIFICATE (image template + overlaid dynamic fields)
   Positions are percentages of the template; tweak left/top
   inline in quiz.jsx to nudge any field.
   ============================================================ */
.cert-template {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  aspect-ratio: 1536 / 1024;
  container-type: inline-size;        /* enables cqw font sizing */
  border-radius: 6px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.cert-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* feathered masks that hide the template's baked placeholder text */
.cmask {
  position: absolute; transform: translate(-50%, -50%);
  background: #fcfdfb; border-radius: 50%;
  box-shadow: 0 0 16px 12px #fcfdfb; z-index: 2;
}
/* generic overlaid text field */
.cf {
  position: absolute; transform: translate(-50%, -50%);
  text-align: center; white-space: nowrap; line-height: 1; z-index: 3;
}
.cert-name-script { font-family: "Great Vibes", cursive; font-size: 4cqw; color: #2c6b3a; }
.cert-sig-name    { font-family: "Great Vibes", cursive; font-size: 2.2cqw; color: #1c3a5e; }
.cert-no          { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 1.5cqw; letter-spacing: .02em; color: #333; font-weight: 600; }
.cert-sig {
  position: absolute; transform: translate(-50%, -50%);
  width: 9cqw; height: auto; z-index: 3;   /* signature has a transparent background */
}

/* print — certificate only */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body * { visibility: hidden; }
  #cert-print, #cert-print * { visibility: visible; }
  #cert-print {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none; border-radius: 0;
  }
  .no-print { display: none !important; }
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
