:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #16161a;
  --muted: #6b6b73;
  --line: #dcdad3;
  --accent: #2f5bea;
  --accent-soft: rgba(47, 91, 234, 0.08);
  --accent-line: rgba(47, 91, 234, 0.55);
  --error: #c2362b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

/* Top bar + progress */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.bar { max-width: 1040px; margin: 0 auto; padding: 18px 16px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.progress { height: 3px; background: var(--line); }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width 0.45s var(--ease); }

/* Stage */
main { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 680px; margin: 0 auto; padding: 48px 16px; }
main.wide { max-width: 1040px; justify-content: flex-start; padding-top: 40px; }
.stage.in-up { animation: in-up 0.34s var(--ease) both; }
.stage.in-down { animation: in-down 0.34s var(--ease) both; }
.stage.out-up { animation: out-up 0.16s ease-in both; }
.stage.out-down { animation: out-down 0.16s ease-in both; }
@keyframes in-up { from { opacity: 0; transform: translateY(28px); } }
@keyframes in-down { from { opacity: 0; transform: translateY(-28px); } }
@keyframes out-up { to { opacity: 0; transform: translateY(-28px); } }
@keyframes out-down { to { opacity: 0; transform: translateY(28px); } }

.num { margin: 0 0 14px; font-size: 0.95rem; font-weight: 600; color: var(--accent); }
h1 { margin: 0; font-size: clamp(1.55rem, 4.2vw, 2.2rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.sub { margin: 12px 0 0; font-size: 1.05rem; line-height: 1.55; color: var(--muted); }

/* Choices */
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; max-width: 520px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 13px 16px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  font-size: 1.02rem; font-weight: 500; line-height: 1.35;
  transition: border-color 0.18s, background-color 0.18s;
}
.choice:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .key {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  transition: all 0.18s;
}
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice.on .key { border-color: var(--accent); background: var(--accent); color: #fff; }
.choice.blink { animation: blink 0.3s steps(2) 1; }
@keyframes blink { 50% { background: var(--card); } }
.choice small { display: block; margin-top: 2px; font-size: 0.85rem; font-weight: 400; color: var(--muted); }

/* Text answers */
.field {
  width: 100%; margin-top: 32px; padding: 0 0 10px;
  border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent;
  font: inherit; font-size: clamp(1.3rem, 3.6vw, 1.75rem); color: var(--ink); outline: none;
  transition: border-color 0.2s;
}
.field:focus { border-bottom-color: var(--accent); }
.field::placeholder { color: #b3b1aa; }
/* Lets the script notice a browser autofill pick. */
.field:-webkit-autofill { animation: autofill 1ms; }
@keyframes autofill { from { opacity: 1; } to { opacity: 1; } }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.ok {
  padding: 11px 22px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 1rem; font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}
.ok:hover { opacity: 0.88; }
.ok:active { transform: scale(0.98); }
.ok:disabled { opacity: 0.5; cursor: default; }
.back { padding: 8px 4px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--ink); }
.hint { font-size: 0.82rem; color: var(--muted); }
.hint b { font-weight: 600; }
.error { min-height: 1.4em; margin: 14px 0 0; font-size: 0.92rem; font-weight: 500; color: var(--error); }
.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

/* Up / down */
.nav { position: fixed; right: 16px; bottom: 16px; display: flex; gap: 6px; }
.nav[hidden] { display: none; }
.nav button {
  display: grid; place-items: center; width: 38px; height: 34px; cursor: pointer;
  border: 0; border-radius: 6px; background: var(--ink); color: #fff;
}
.nav button:disabled { opacity: 0.3; cursor: default; }
.nav svg { width: 16px; height: 16px; }

/* Footer. Right padding keeps it clear of the fixed up/down buttons. */
.foot { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 110px 20px 16px; font-size: 0.78rem; line-height: 1.7; color: var(--muted); }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* Booking */
.cal { margin-top: 24px; height: 720px; min-width: 320px; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }

@media (max-width: 640px) {
  main { justify-content: flex-start; padding-top: 36px; }
  .cal { height: 1020px; margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .hint { display: none; }
  /* Full width, sitting above the up/down buttons instead of beside them. */
  .foot { padding: 20px 16px 64px; }
}

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