:root {
  --night: #0f2a4a;
  --night-2: #17406b;
  --red: #c8102e;
  --red-dark: #9c0c24;
  --gold: #f2c14e;
  --snow: #ffffff;
  --ink: #1d2433;
  --muted: #5b6478;
  --card: #ffffff;
  --line: #e3e7ef;
  --green: #1f7a4d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--snow);
  background: radial-gradient(ellipse at top, var(--night-2), var(--night) 60%) fixed, var(--night);
  display: flex; flex-direction: column;
  overflow-x: hidden;
}

/* falling snow, pure CSS */
.snow, .snow::before, .snow::after {
  position: fixed; inset: -200px 0 0 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(3px 3px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 80px 120px, #fff, transparent),
    radial-gradient(3px 3px at 150px 60px, #fff, transparent),
    radial-gradient(2px 2px at 210px 170px, #fff, transparent),
    radial-gradient(2px 2px at 260px 20px, #fff, transparent);
  background-size: 300px 200px;
  animation: snow 14s linear infinite; opacity: .55;
}
.snow::before { content: ""; background-size: 220px 260px; animation-duration: 20s; opacity: .4; }
.snow::after { content: ""; background-size: 380px 300px; animation-duration: 28s; opacity: .3; }
@keyframes snow { to { transform: translateY(200px); } }
@media (prefers-reduced-motion: reduce) { .snow, .snow::before, .snow::after, .pulse { animation: none !important; } }

.top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.brand { font-family: "Mountains of Christmas", cursive; font-size: 26px; color: var(--gold); }
.lang { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 800; cursor: pointer; }

main { position: relative; z-index: 1; flex: 1; display: flex; justify-content: center; padding: 8px 16px 32px; }
.screen { width: 100%; max-width: 560px; text-align: center; animation: in .35s ease; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

.hero { width: 100%; height: auto; border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
h1, h2 { font-family: "Mountains of Christmas", cursive; color: var(--gold); line-height: 1.1; margin: 18px 0 10px; }
h1 { font-size: clamp(36px, 9vw, 52px); }
h2 { font-size: clamp(30px, 7vw, 42px); }
.lead { font-size: 18px; line-height: 1.5; margin: 0 0 18px; }
.small { font-size: 14px; color: rgba(255,255,255,.75); line-height: 1.5; }

.steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; text-align: left; }
.steps li { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 14px; font-size: 17px; }
.steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--red); display: grid; place-items: center; }

.btn { font: inherit; font-weight: 800; font-size: 18px; border: 0; border-radius: 999px; padding: 14px 28px; cursor: pointer;
  background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark); transition: transform .1s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.big { font-size: 22px; padding: 18px 44px; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); box-shadow: none; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); box-shadow: 0 4px 0 var(--red-dark), 0 0 0 12px rgba(200,16,46,.2); } }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* the parent's form: a white card */
form, .card { background: var(--card); color: var(--ink); border-radius: 20px; padding: 22px; text-align: left; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
form label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
form label > span { display: block; margin-bottom: 6px; }
select { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 2px solid var(--line); border-radius: 12px;
  color: var(--ink); background: #fff; }
select:focus { outline: none; border-color: var(--red); }
input[type=email], input[type=text], input[type=number] {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; color: var(--ink); }
input:focus { outline: none; border-color: var(--red); }
.row { display: flex; gap: 12px; }
.row .grow { flex: 1; }
.row .age { width: 90px; }
.plans { border: 0; padding: 0; margin: 6px 0 16px; display: grid; gap: 10px; }
.plans legend { font-weight: 700; margin-bottom: 8px; }
.plan { margin: 0 !important; cursor: pointer; }
.plan input { position: absolute; opacity: 0; }
.plan > span { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px;
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.plan small { grid-column: 1; font-weight: 400; color: var(--muted); }
.plan em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-size: 24px; font-weight: 800; color: var(--red); }
.plan input:checked + span { border-color: var(--red); background: #fff4f5; }
.plan input:focus-visible + span { outline: 3px solid var(--gold); }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--red); }
.check a { color: var(--red); }
.check > span { display: block !important; margin: 0 !important; }
.check > span span { display: inline !important; }
form .actions .btn.ghost { color: var(--ink); border-color: var(--line); }
.error { color: #ffd2d8; background: rgba(200,16,46,.25); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
form .error { color: var(--red); background: #fff0f2; }

.summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary .line b { text-align: right; word-break: break-word; }
.summary .total { border: 0; font-size: 20px; }
.summary .total b { color: var(--red); }

.badge { display: inline-block; background: var(--green); border-radius: 999px; padding: 6px 16px; font-weight: 800; margin-top: 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; font-size: 18px; }
.checklist li { background: rgba(255,255,255,.08); border-radius: 12px; padding: 12px; }

/* the call */
.screen.call { max-width: 760px; }
.stage { position: relative; aspect-ratio: 3 / 4; max-height: 76vh; margin: 0 auto 14px; border-radius: 22px; overflow: hidden;
  background: #000 url(santa.webp) 64% center / cover; box-shadow: 0 0 0 4px var(--gold), 0 16px 50px rgba(0,0,0,.5); }
@media (min-width: 700px) { .stage { aspect-ratio: 16 / 10; } }
.stage video, .stage #demoSanta { width: 100%; height: 100%; object-fit: cover; object-position: 64% center; display: block; background: #000; }
.hero { aspect-ratio: 16 / 9; object-fit: cover; }
.connecting { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; background: rgba(15,42,74,.85); font-size: 20px; font-weight: 800; }
.connecting[hidden] { display: none; }
.tap { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: 12px 22px; background: var(--gold); color: var(--ink); }
.timer { position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: rgba(0,0,0,.45); stroke: rgba(255,255,255,.25); stroke-width: 4; }
.timer #ring { fill: none; stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.listening { position: absolute; left: 12px; bottom: 12px; background: rgba(31,122,77,.9); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; }
.banner { position: absolute; left: 12px; right: 12px; top: 12px; margin-right: 76px; background: rgba(15,42,74,.9); border-radius: 12px; padding: 8px 12px; font-weight: 700; text-align: left; }
.small-btn { font-size: 15px; padding: 10px 20px; }
.install { margin-top: 16px; }

.spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 5px solid rgba(255,255,255,.25); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.spinner.big { width: 64px; height: 64px; margin-top: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.elf, .tree { font-size: 84px; margin-top: 20px; }
.wish { font-family: Georgia, serif; font-size: 19px; line-height: 1.6; background: rgba(255,255,255,.08); border-left: 4px solid var(--gold); border-radius: 12px; padding: 16px 18px; margin: 0 0 24px; text-align: left; }

#s-parent > h2 { display: none; }
.plans legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }  /* for screen readers */
.pair { display: block; }  /* the wizard already says "Your details" */
.plan > span { grid-template-columns: 1fr auto !important; grid-template-rows: auto auto; align-items: baseline; }
.plan b { grid-column: 1; grid-row: 1; }
.plan em { grid-column: 2 !important; grid-row: 1 !important; align-self: baseline; }
.plan small { grid-column: 1 / -1 !important; grid-row: 2; }

/* the wizard's steps */
.wizard { list-style: none; display: flex; gap: 6px; padding: 0; margin: 4px 0 14px; counter-reset: s; }
.wizard li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,.55); position: relative; }
.wizard li::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 3px; background: rgba(255,255,255,.2); z-index: -1; }
.wizard li:first-child::before { display: none; }
.wizard b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.15); color: #fff; }
.wizard li.now { color: #fff; }
.wizard li.now b { background: var(--red); box-shadow: 0 0 0 4px rgba(200,16,46,.3); }
.wizard li.done { color: var(--gold); }
.wizard li.done b { background: var(--green); font-size: 0; }
.wizard li.done b::after { content: "✓"; font-size: 16px; }
.wizard li.done::before, .wizard li.now::before { background: var(--gold); }

.side { display: none; }

/* phone and tablet: every step fits on one screen */
@media (max-width: 959px) {
  .top { padding: 8px 14px; }
  .brand { font-size: 22px; }
  main { padding: 0 14px 8px; }
  .screen h1 { font-size: clamp(28px, 8vw, 38px); margin: 10px 0 6px; }
  .screen h2 { font-size: clamp(26px, 7vw, 34px); margin: 6px 0 8px; }
  .lead { font-size: 15px; line-height: 1.4; margin-bottom: 10px; }
  .small { font-size: 12px; margin: 8px 0 0; line-height: 1.35; }
  .foot { display: none; }
  #s-intro .hero { max-height: 24dvh; object-fit: cover; object-position: 62% center; border-radius: 16px; }
  .steps { gap: 6px; margin-bottom: 12px; }
  .steps li { padding: 7px 10px; font-size: 14px; border-radius: 12px; }
  .steps b { width: 26px; height: 26px; font-size: 14px; }
  .btn.big { font-size: 20px; padding: 14px 36px; }
  .install { margin-top: 8px; }
  .wizard { margin: 0 0 8px; }
  .wizard li { font-size: 11px; }
  .wizard b { width: 28px; height: 28px; }
  .wizard li::before { top: 13px; }
  form, .card { padding: 14px; border-radius: 16px; }
  form label { margin-bottom: 9px; font-size: 14px; }
  form label > span { margin-bottom: 4px; }
  input[type=email], input[type=text], input[type=number] { padding: 9px 12px; font-size: 16px; border-radius: 10px; }
  .row { flex-wrap: nowrap; gap: 10px; }
  .row .age { width: 74px; }
  .plans { grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 10px; }
  .plans legend { margin-bottom: 6px; font-size: 14px; }
  .plan > span { grid-template-columns: 1fr; padding: 9px 10px; border-radius: 12px; }
  .plan small { display: none; }
  .plan em { grid-row: auto; grid-column: 1; font-size: 20px; }
  .check { font-size: 13px; }
  .actions { margin-top: 10px; gap: 10px; flex-wrap: nowrap; }
  .actions .btn { padding: 12px 18px; font-size: 17px; }
  .actions .btn:last-child { flex: 1; }
  .summary .line { padding: 8px 0; font-size: 15px; }
  .checklist { font-size: 15px; gap: 6px; margin-bottom: 14px; }
  .checklist li { padding: 9px; }
  .badge { margin-top: 4px; }
  .elf, .tree { font-size: 60px; margin-top: 6px; }
  .wish { font-size: 16px; padding: 12px 14px; margin-bottom: 14px; }
  .stage { aspect-ratio: auto; height: calc(100dvh - 175px); max-height: none; margin-bottom: 10px; }
  .foot { padding: 4px; font-size: 12px; }
  body[data-screen="s-call"] .foot { display: none; }
}

@media (min-width: 960px) {
  .pair { display: flex; gap: 12px; }
  .pair .grow { flex: 1; min-width: 0; }
}

/* short laptop screens */
@media (min-width: 960px) and (max-height: 760px) {
  .wizard { margin-bottom: 8px; }
  form label { margin-bottom: 7px; font-size: 14px; }
  form label > span { margin-bottom: 3px; }
  input[type=email], input[type=text], input[type=number] { padding: 8px 12px; }
  .plan > span { padding: 8px 12px; }
  .actions .btn { padding: 11px 24px; }
  .side .hero { max-height: 40vh; }
  form { padding: 14px 18px; }
  .check { font-size: 13px; }
  .plans { margin-bottom: 8px; }
  .flow { max-height: calc(100vh - 92px); }
  .top { padding-top: 6px; padding-bottom: 6px; }
}

/* laptop: two columns, no scrolling */
@media (min-width: 960px) and (min-height: 600px) {
  body { height: 100vh; overflow: hidden; }
  .top { padding: 10px 28px; }
  main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); gap: 40px; align-items: start;
    max-width: 1240px; width: 100%; margin: 0 auto; padding: 4px 28px 0; min-height: 0; overflow: hidden; }
  .side { display: block; text-align: left; }
  .side .hero { max-height: 46vh; width: 100%; object-fit: cover; object-position: 60% center; }
  .side h1 { font-size: clamp(34px, 3.6vw, 48px); margin: 14px 0 8px; }
  .side .lead { font-size: 17px; margin-bottom: 10px; }
  .flow { max-height: calc(100vh - 110px); overflow-y: auto; padding: 0 4px 12px; }
  .flow .screen { max-width: none; }
  .flow h2 { font-size: 30px; margin: 4px 0 10px; }
  #s-parent .actions .btn.ghost { display: none; }  /* nothing to go back to: the intro is on the left */
  form { padding: 18px 20px; }
  form label { margin-bottom: 10px; }
  input[type=email], input[type=text], input[type=number] { padding: 10px 12px; font-size: 16px; }
  .plans { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
  .plans legend { grid-column: 1 / -1; }
  .plan > span { grid-template-columns: 1fr; padding: 12px 14px; }
  .plan em { grid-row: auto; grid-column: 1; font-size: 22px; }
  .actions { margin-top: 12px; }
  .elf, .tree { font-size: 64px; margin-top: 8px; }
  .foot { padding: 6px; }
  /* the call: Santa gets the whole width */
  body[data-screen="s-call"] main { grid-template-columns: 1fr; max-width: 1100px; }
  body[data-screen="s-call"] .side, body[data-screen="s-call"] #wizard { display: none; }
  body[data-screen="s-call"] .flow { max-height: none; overflow: visible; }
  body[data-screen="s-call"] .stage { aspect-ratio: 16 / 9; max-height: calc(100vh - 150px); }
}

.foot { position: relative; z-index: 1; text-align: center; padding: 14px; font-size: 13px; }
.foot a { color: rgba(255,255,255,.7); }



/* the call language has no default: grey until chosen */
select#callLang:invalid { color: #8a8f99; }
select#callLang option { color: #222; }

/* page language menu */
select.lang { appearance: none; -webkit-appearance: none; max-width: 46vw; text-overflow: ellipsis; }
select.lang option { color: #222; background: #fff; }
/* right-to-left (Arabic): the line between the steps joins the previous step, which is on the right */
[dir="rtl"] .wizard li::before { left: 50%; right: -50%; }
