/* Luna Card: customer app */
body { min-height: 100dvh; transition: background-color .9s var(--ease), color .9s var(--ease); }
.view { min-height: 100dvh; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- welcome ---------- */
body[data-view="welcome"] { background: var(--luna); }
.v-welcome {
  color: #fff; display: grid; place-items: center; padding: calc(28px + var(--safe-t)) 24px calc(28px + var(--safe-b));
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(255, 255, 255, .22), transparent 70%),
    radial-gradient(80% 60% at 50% 110%, rgba(91, 75, 176, .45), transparent 70%),
    var(--luna);
}
.v-welcome { position: relative; isolation: isolate; overflow: hidden; }
.w-film { position: absolute; inset: 0; z-index: -1; }
.w-film img, .w-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w-film video { opacity: 0; transition: opacity 1.4s var(--ease); }
.w-film video.playing { opacity: 1; }
.w-film::after { /* Luna periwinkle over the sky, deeper where the text sits */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(118, 142, 214, .2) 0%, rgba(110, 134, 208, .5) 40%, rgba(104, 128, 204, .55) 75%, rgba(104, 128, 204, .45) 100%);   /* deeper logo blue behind the text so white reads clearly (3 Nov) */
}
.w-inner { width: 100%; max-width: 400px; display: grid; justify-items: center; text-align: center; }
.w-logo {
  width: min(62vw, 232px); aspect-ratio: 1; border-radius: 50%; display: grid; align-content: center; justify-items: center;
  position: relative; padding: 18px; animation: rise 1s var(--ease) both;
}
.w-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.w-ring circle { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: .9; }
.w-ch { display: inline-block; }
.js-motion .w-logo, .js-motion .w-title, .js-motion .w-lede, .js-motion .w-actions, .js-motion .w-phases svg { animation: none; }
.w-mark svg { width: 46px; height: 46px; margin: 0 auto 6px; }
.w-name { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 7.4vw, 29px); letter-spacing: .04em; line-height: 1; }
.w-tag { font-family: var(--display); font-weight: 700; font-size: clamp(8.5px, 2.6vw, 10.5px); letter-spacing: .02em; margin-top: 8px; }
.w-title { font-family: var(--display); font-weight: 600; font-size: clamp(18px, 5.6vw, 24px); line-height: 1.15; margin: 30px 0 14px; white-space: nowrap; letter-spacing: .03em; animation: rise 1s .15s var(--ease) both; }
.w-lede { margin: 0 0 26px; max-width: 30ch; font-size: 15px; color: rgba(255, 255, 255, .94); animation: rise 1s .25s var(--ease) both; }
.w-phases { display: flex; gap: 8px; margin-bottom: 34px; }
.w-phases svg { width: 26px; height: 26px; animation: phase .7s calc(.5s + var(--i) * .09s) var(--ease) both; }
.w-actions { width: 100%; display: grid; gap: 6px; animation: rise 1s .4s var(--ease) both; }
.w-actions .btn-ghost { color: #fff; font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes phase { from { opacity: 0; transform: scale(.4); } }

/* ---------- forms ---------- */
.v-form { background: var(--mist); padding: calc(10px + var(--safe-t)) 20px calc(30px + var(--safe-b)); }
.f-top { display: flex; align-items: center; justify-content: space-between; max-width: 440px; margin: 0 auto; }
.f-mark, .h-mark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; letter-spacing: .16em; font-size: 13px; color: var(--dusk); }
.f-mark svg, .h-mark svg { width: 20px; height: 20px; }
.f-top .f-mark { margin-right: 44px; flex: 1; justify-content: center; }
.f-body { max-width: 440px; margin: 0 auto; padding-top: 22px; display: grid; gap: 18px; }
.f-title { font-size: 27px; }
.f-lede { margin: -8px 0 6px; color: var(--muted); }
.opt { font-weight: 400; }
.otp { position: relative; }
.otp .input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.otp-boxes span { height: 62px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 24px; font-weight: 500; }
.otp-boxes span.cur { border-color: var(--dusk); box-shadow: 0 0 0 4px rgba(91, 75, 176, .14); }
.demo-note { margin: -6px 0 0; font-size: 13px; color: var(--dusk); }

/* ---------- home ---------- */
.v-home { padding: calc(6px + var(--safe-t)) 20px calc(104px + var(--safe-b)); max-width: 480px; margin: 0 auto; }
.h-top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--paper); color: var(--dusk); font-family: var(--display); font-weight: 700; font-size: 16px; box-shadow: 0 0 0 1px var(--line); }
.h-hello { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 10px 2px 16px; }

.flip { perspective: 1400px; }
.flip-inner { display: grid; width: 100%; padding: 0; border: 0; background: none; text-align: inherit; transform-style: preserve-3d; transition: transform .8s var(--ease); border-radius: var(--r-lg); }
.flip-inner > * { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-back {
  transform: rotateY(180deg); border-radius: var(--r-lg); background: var(--moon); color: var(--night);
  display: grid; align-content: center; justify-items: center; padding: 22px; text-align: center;
  box-shadow: 0 34px 60px -30px rgba(56, 44, 140, .55), inset 0 0 0 1px rgba(91, 75, 176, .12);
}
.cb-name { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0 0 12px; }
.cb-qr { width: min(62vw, 230px); aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 0 0 1px rgba(28, 29, 68, .06); }
.cb-qr svg { width: 100%; height: 100%; display: block; }
.cb-timer { width: min(62vw, 230px); height: 4px; border-radius: 9px; background: rgba(91, 75, 176, .14); margin: 14px 0 10px; overflow: hidden; }
.cb-timer span { display: block; height: 100%; background: var(--dusk); transform-origin: left; }
.cb-hint { margin: 0; font-size: 13px; color: var(--muted); max-width: 28ch; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) {
  .flip-inner { transform: none !important; }
  .flip-inner > * { backface-visibility: visible; transition: opacity .2s; }
  .flip-back { transform: none; opacity: 0; pointer-events: none; }
  .flip.flipped .flip-back { opacity: 1; }
  .flip.flipped .flip-front { opacity: 0; }
}

.h-progress { text-align: center; margin: 22px 8px 16px; font-size: 15px; color: var(--muted); }
.h-progress strong { color: var(--night); font-weight: 600; }

.bday { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-md); background: rgba(164, 157, 233, .2); color: var(--dusk); font-size: 14px; line-height: 1.45; }
.bday svg { width: 26px; height: 26px; flex: none; }

.teaser { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px; padding: 10px 14px 10px 10px; border: 0; border-radius: 20px; background: var(--paper); text-align: left; box-shadow: 0 0 0 1px var(--line); }
.teaser img { width: 58px; height: 58px; border-radius: 13px; object-fit: cover; flex: none; }
.teaser > span { flex: 1; display: grid; }
.t-k { font-size: 12px; color: var(--muted); }
.t-t { font-weight: 500; font-size: 15px; line-height: 1.3; }
.teaser svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.t-head { font-size: 26px; margin: 12px 2px 18px; }
.t-sub { font-size: 17px; margin: 30px 2px 10px; }

.special { background: var(--paper); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 24px 50px -34px rgba(28, 29, 68, .45); }
.sp-img { aspect-ratio: 1; background: var(--lilac); }
.sp-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-body { padding: 20px 22px 24px; }
.sp-body h2 { font-size: 22px; margin-bottom: 8px; }
.sp-body p { margin: 0; color: var(--muted); }
.sp-body .sp-until { margin-top: 14px; font-size: 13px; color: var(--dusk); font-weight: 500; }
.sp-empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.sp-empty svg { width: 40px; height: 40px; color: var(--lilac); margin: 0 auto 10px; }

.info, .acct { background: var(--paper); border-radius: 22px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.row { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 16px 18px; text-decoration: none; border: 0; background: none; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row > svg { width: 22px; height: 22px; color: var(--dusk); flex: none; margin-top: 1px; }
.row > span { display: grid; flex: 1; }
.r-t { font-weight: 500; }
.r-s { font-size: 13px; color: var(--muted); }
.hours dl { margin: 0; flex: 1; display: grid; gap: 4px; }
.hours dl div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.hours dl div.today { color: var(--night); font-weight: 500; }
.hours dt, .hours dd { margin: 0; }
.row.link { min-height: 54px; align-items: center; }
.row.danger .r-t { color: var(--warn); font-weight: 400; }
.toggle { align-items: center; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle i { width: 50px; height: 30px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .25s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: translate .25s var(--ease); }
.toggle input:checked + i { background: var(--dusk); }
.toggle input:checked + i::after { translate: 20px 0; }
.toggle input:focus-visible + i { outline: 2px solid var(--dusk); outline-offset: 3px; }

/* tab bar */
.tabs {
  position: fixed; left: 50%; translate: -50% 0; bottom: calc(12px + var(--safe-b)); z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); width: min(calc(100% - 32px), 420px); padding: 6px;
  border-radius: 26px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -20px rgba(28, 29, 68, .45);
}
.tabs button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border: 0; background: none; border-radius: 20px; color: var(--muted); font-size: 12px; font-weight: 500; transition: background-color .25s, color .25s; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button.active { color: var(--dusk); background: rgba(164, 157, 233, .2); }

/* install hint */
.install { position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--safe-b)); z-index: 25; max-width: 440px; margin: 0 auto; display: flex; gap: 8px; align-items: center; padding: 12px 8px 12px 16px; border-radius: 18px; background: var(--night); color: var(--moon); font-size: 13px; line-height: 1.45; box-shadow: 0 18px 40px -16px rgba(28, 29, 68, .6); }
.install p { margin: 0; flex: 1; }
.install .ios-share { width: 17px; height: 17px; vertical-align: -3px; }

/* ---------- full moon: the night sky ---------- */
body.night[data-view="home"] { background: var(--night); color: var(--moon); }
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.sky i { position: absolute; border-radius: 50%; background: #FFF8E8; box-shadow: 0 0 6px rgba(255, 248, 232, .8); }
body.night[data-view="home"] .sky { opacity: 1; }
.v-home { position: relative; z-index: 1; }
.js-motion .flip-inner { transition: none; }
body.night[data-view="home"] .h-mark { color: var(--luna); }
body.night[data-view="home"] .h-progress { color: rgba(255, 248, 232, .78); }
body.night[data-view="home"] .h-progress strong { color: var(--moon); }
body.night[data-view="home"] .btn-night { background: var(--moon); color: var(--night); }
body.night[data-view="home"] .avatar { background: var(--night-2); color: var(--moon); box-shadow: none; }
body.night[data-view="home"] .teaser, body.night[data-view="home"] .info, body.night[data-view="home"] .acct, body.night[data-view="home"] .special { background: var(--night-2); box-shadow: none; }
body.night[data-view="home"] .row + .row { border-color: rgba(255, 255, 255, .08); }
body.night[data-view="home"] .r-s, body.night[data-view="home"] .t-k, body.night[data-view="home"] .sp-body p, body.night[data-view="home"] .hours dl div { color: rgba(255, 248, 232, .65); }
body.night[data-view="home"] .hours dl div.today { color: var(--moon); }
body.night[data-view="home"] .tabs { background: rgba(43, 45, 102, .85); box-shadow: none; }
body.night[data-view="home"] .tabs button { color: rgba(255, 248, 232, .6); }
body.night[data-view="home"] .tabs button.active { color: var(--moon); background: rgba(255, 255, 255, .1); }
body.night[data-view="home"] .moon-card { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 30px 90px -30px rgba(164, 157, 233, .65); }

@media (min-width: 720px) {
  body[data-view="home"] { padding-top: 24px; }
}

/* review request (after a free drink) */
.sheet.review { text-align: center; padding-top: 12px; z-index: 46; }
#rvScrim { z-index: 45; }
.rv-art { width: 120px; height: 120px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #A9B6F1, #9B8FE2 70%); box-shadow: 0 18px 40px -18px rgba(56, 44, 140, .7); }
.rv-moon svg { width: 62px; height: 62px; color: var(--moon); filter: drop-shadow(0 0 14px rgba(255, 248, 232, .6)); }
.sheet.review h2 { font-size: 24px; margin-bottom: 8px; }
.sheet.review p { margin: 0 auto 20px; color: var(--muted); max-width: 30ch; }
.sheet.review .btn-ghost { color: var(--muted); }

/* ---------- premium: the full moon ---------- */
.moonrise { position: fixed; left: 50%; top: 38vh; z-index: 0; width: min(150vw, 820px); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; opacity: 0; visibility: hidden; }
body.night[data-view="home"][data-tab="card"] .moonrise.up { opacity: .5; visibility: visible; }
body:not([data-tab="card"]) .moonrise { opacity: 0 !important; visibility: hidden !important; transition: opacity .4s; }
.mr-moon { position: absolute; inset: 0; border-radius: 50%; background-size: cover; filter: saturate(.85) brightness(1.05);
  -webkit-mask: radial-gradient(circle, #000 66%, transparent 71%); mask: radial-gradient(circle, #000 66%, transparent 71%); }
.mr-glow { position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 214, .5) 30%, rgba(255, 244, 214, .12) 48%, transparent 66%); }
.fm-cap { position: absolute; left: 0; right: 0; top: -6px; z-index: 3; margin: 0; text-align: center; font-family: var(--display); font-weight: 600; font-size: clamp(34px, 10vw, 44px); line-height: 1; color: var(--moon); text-shadow: 0 0 24px rgba(255, 240, 200, .55); opacity: 0; visibility: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tilt { transform: none !important; } }

/* ---------- welcome fits the screen Safari leaves visible (svh = with the bars showing): no scrolling to reach the buttons ---------- */
.v-welcome { min-height: 100svh; height: 100svh; padding: calc(2.4svh + var(--safe-t)) 24px calc(2.4svh + var(--safe-b)); }
.w-logo { width: min(62vw, 232px, 29svh); padding: 14px; }
.w-mark svg { width: min(46px, 5.6svh); height: min(46px, 5.6svh); }
.w-name { font-size: clamp(20px, min(7.4vw, 3.6svh), 29px); }
.w-title { font-size: clamp(16px, 6.6vw, 28px); margin: 3svh 0 1.4svh; }
.w-lede { margin: 0 0 2.6svh; font-size: clamp(14px, 2.2svh, 15px); }
.w-phases { margin-bottom: 3.4svh; }
.w-phases svg { width: min(26px, 3.6svh); height: min(26px, 3.6svh); }
.w-actions { gap: 2px; }
.w-actions .btn-moon { min-height: min(54px, 7.4svh); }
@media (max-height: 600px) { .w-lede { display: none; } }   /* very short screens: the buttons matter more than the lede */
.w-tag { white-space: nowrap; font-size: clamp(7.5px, min(2.6vw, 1.35svh), 10.5px); }

/* ---------- the card screen fits above the tab bar on any iPhone (svh = with Safari's bars showing) ---------- */
.v-home { padding-bottom: calc(96px + var(--safe-b)); }
.h-top { height: min(56px, 7svh); }
.h-hello { font-size: clamp(17px, 2.9svh, 21px); margin: .6svh 2px 1.6svh; }
.mc-face { padding: 2.6svh 18px 1.8svh; }
.mc-title { font-size: clamp(15px, 6.4vw, 26px); margin: 0 0 1svh; }
.mc-copy { font-size: clamp(11.5px, 1.75svh, 13px); max-width: 34ch; margin-bottom: 1.6svh; }
.mc-moons { gap: .6svh 4px; }
.moon { max-width: min(78px, 9.2svh); }
.free-label { font-size: clamp(19px, 3.2svh, 26px); bottom: -2.6svh; }
.mc-moons:has(.free) { padding-bottom: 2.6svh; }
.mc-foot { margin-top: 1.2svh; }
.h-progress { margin: 1.8svh 8px 1.4svh; font-size: clamp(13.5px, 2svh, 15px); }
#codeBtn { min-height: min(54px, 7svh); }
/* the home-screen hint sits at the top, never over the card or the button */
.install { top: calc(10px + var(--safe-t)); bottom: auto; }
.moon { max-width: min(78px, 8.2svh); }
.mc-title { font-size: clamp(15px, 6.4vw, 26px); }
.h-progress { margin: 1.4svh 8px 1.1svh; }
@media (max-height: 620px) { .h-hello, .mc-copy { display: none; } .mc-title { margin-bottom: 1.4svh; } }

/* Safari: never trust backface-visibility under a tilted parent; hide the face that is turned away at the half-way point of the flip */
.flip:not(.flipped) .flip-back { visibility: hidden; transition: visibility 0s .45s; }
.flip.flipped .flip-front { visibility: hidden; transition: visibility 0s .45s; }
.flip.flipped .flip-back, .flip:not(.flipped) .flip-front { visibility: visible; transition: visibility 0s .45s; }
/* the code side is never taller than the moon side */
.cb-qr, .cb-timer { width: min(62vw, 230px, 28svh); }
.cb-name { margin-bottom: 1.2svh; }
/* the account button: a small real moon at your own phase, not a letter */
.avatar { width: 40px; height: 40px; padding: 3px; display: grid; place-items: center; background: #26285A; box-shadow: 0 0 0 1px rgba(246, 214, 136, .55), 0 6px 16px -6px rgba(28, 29, 68, .55); }
.avatar svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 3px rgba(255, 248, 232, .45)); }
body.night[data-view="home"] .avatar { background: #26285A; box-shadow: 0 0 0 1px rgba(246, 214, 136, .75), 0 0 18px -4px rgba(246, 214, 136, .5); }
/* the card is as tall as the moon side; the code side fits inside it (no gap under the card) */
.flip-inner { position: relative; }
.flip-back { position: absolute; inset: 0; padding: 2svh 18px; align-content: center; overflow: hidden; }
.cb-hint { font-size: clamp(11.5px, 1.75svh, 13px); }

/* the code side always fits inside the moon side: smaller code on short screens, hint never cut */
.cb-qr, .cb-timer { width: min(58vw, 220px, 24svh); }
.cb-qr { padding: 8px; }
.cb-name { font-size: 15px; margin: 0 0 1svh; }
.cb-timer { margin: 1.2svh 0 .8svh; }
.cb-hint { max-width: 34ch; line-height: 1.35; }
/* opened from the Home Screen: no Safari bars, so use the whole screen and keep clear of the notch and the home bar */
@media (display-mode: standalone) {
  .v-welcome { height: 100dvh; min-height: 100dvh; }
}
@media (max-height: 620px) { .cb-hint { display: none; } .cb-name { margin-top: 0; } }

/* Add to Apple Wallet (black, as Apple's own badge) */
.wallet-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; min-height: 52px; border-radius: 14px; background: #000; color: #fff; text-decoration: none; }
.wallet-btn[hidden] { display: none; }
.wallet-btn svg { width: 26px; height: 26px; flex: none; }
.wallet-btn span { display: grid; line-height: 1.05; font: 600 17px/1.05 -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif; letter-spacing: -.01em; }
.wallet-btn small { font-size: 11px; font-weight: 400; letter-spacing: 0; }

/* their logo in the header (3 Nov) */
.h-mark .luna-logo { width: 46px; height: 46px; display: block; }

/* soft shadow so the white welcome text stays readable over bright clouds (3 Nov) */
.w-title, .w-lede, .w-logo { text-shadow: 0 1px 2px rgba(40, 55, 130, .35), 0 2px 16px rgba(40, 55, 130, .3); }

/* their real logo in place of the typed name (3 Nov) */
.w-logo-img { width: 100%; height: 100%; display: block; border-radius: 50%; filter: drop-shadow(0 6px 24px rgba(40, 55, 130, .28)); }
.w-logo:has(.w-logo-img) { padding: 0; }
.f-mark .luna-logo { width: 52px; height: 52px; display: block; }
.t-logo { margin: 8px 2px 14px; }
.t-logo .luna-logo { width: 84px; height: 84px; display: block; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid rgba(28, 29, 68, .16); display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-google svg { width: 20px; height: 20px; }
.f-small { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 0; }

/* ---------- sign in (3 Nov): the welcome sky and logo carry on; one white sheet; one action ---------- */
.v-auth { min-height: 100svh; display: flex; flex-direction: column; background: var(--luna); position: relative; overflow: hidden; }
.a-sky { position: absolute; inset: 0 0 auto; height: 62svh; }
.a-sky img { width: 100%; height: 100%; object-fit: cover; display: block; }
.a-sky::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(118, 142, 214, .25), rgba(110, 134, 208, .55) 70%, rgba(144, 171, 231, 1)); }
.a-top { position: relative; z-index: 2; padding: calc(10px + var(--safe-t)) 14px 0; }
.a-back { color: #fff; background: rgba(255, 255, 255, .16); border-radius: 50%; }
.a-hero { position: relative; z-index: 1; flex: 1; min-height: 210px; display: grid; place-items: center; padding: 4px 0 30px; }
.a-logo { width: min(46vw, 172px, 24svh); height: auto; display: block; border-radius: 50%; filter: drop-shadow(0 10px 30px rgba(40, 55, 130, .3)); animation: rise .9s var(--ease) both; }
.a-sheet {
  position: relative; z-index: 1; background: var(--paper); border-radius: 30px 30px 0 0;
  padding: 34px 24px calc(26px + var(--safe-b)); display: grid; gap: 16px;
  box-shadow: 0 -18px 40px -24px rgba(28, 29, 68, .35); animation: sheetUp .7s var(--ios) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.a-sheet > * { width: 100%; max-width: 420px; margin-inline: auto; }
.a-title { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 6.4vw, 26px); letter-spacing: .03em; line-height: 1.15; text-align: center; margin: 0; white-space: nowrap; }
.a-lede { margin: -6px auto 4px; text-align: center; color: var(--muted); font-size: 15px; max-width: 30ch; }
/* the two optional choices: quiet rows on hairlines, not form boxes */
.a-rows { border-top: 1px solid var(--line); }
.a-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; border-bottom: 1px solid var(--line); cursor: pointer; }
.a-row > span { display: grid; font-size: 15px; font-weight: 500; line-height: 1.3; }
.a-row small { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.a-row select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--dusk); text-align: right; text-align-last: right; padding: 8px 18px 8px 4px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B4BB0' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 2px center; }
.a-row select:focus-visible { outline: 2px solid var(--dusk); outline-offset: 2px; border-radius: 6px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 30px; background: rgba(28, 29, 68, .14); position: relative; margin: 0; cursor: pointer; transition: background .25s var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(28, 29, 68, .25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--dusk); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--dusk); outline-offset: 3px; }
.v-auth .btn-google { background: var(--night); color: #fff; border: 0; min-height: 56px; gap: 12px; font-weight: 500; box-shadow: 0 14px 28px -16px rgba(28, 29, 68, .8); }
.g-dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.v-auth .btn-google .g-dot svg { width: 16px; height: 16px; }
.a-fine { margin: 0 auto; text-align: center; font-size: 12px; color: var(--muted); }
.a-fine a { color: inherit; }
.v-auth .error:empty { display: none; }
.v-auth .field { gap: 6px; }
@media (prefers-reduced-motion: reduce) { .a-logo, .a-sheet { animation: none; } }
.a-lede, .a-fine { text-wrap: balance; }
/* Google's own button (our page, our domain) and the email route under it */
.gsi-btn { display: flex; justify-content: center; min-height: 44px; }
.a-or { display: flex; align-items: center; gap: 14px; margin: -2px auto; color: var(--muted); font-size: 12px; }
.a-or::before, .a-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.a-email { display: grid; gap: 14px; }
.a-email[hidden] { display: none; }
.v-auth .btn-line { min-height: 44px; font-weight: 500; }
.a-resend { color: var(--muted); font-size: 14px; justify-self: center; }
.gwallet-btn { width: 100%; border: 0; cursor: pointer; }
.gwallet-btn[disabled] { opacity: .6; }

/* sign-in fits the visible screen (Safari's bars included): the logo gives way, the sheet never hides (3 Nov) */
.v-auth { min-height: 100dvh; }
.a-hero { flex: 1 1 auto; min-height: 0; padding: 0 0 22px; }
.a-logo { width: clamp(76px, 17dvh, 168px); }
.a-top { position: absolute; top: 0; left: 0; right: 0; }
.a-hero { padding-top: calc(44px + var(--safe-t)); }
.a-sheet { flex: none; gap: 12px; padding-top: 26px; }
.a-title { font-size: clamp(21px, 6vw, 25px); }
.a-lede { margin-bottom: 0; }
.a-row { min-height: 56px; }
.gsi-btn, .v-auth .btn-line { min-height: 44px; }
@media (max-height: 700px) {
  .a-sheet { gap: 10px; padding-top: 22px; }
  .a-row { min-height: 52px; }
  .a-row small { display: none; }
}
/* desktop and tablets: the sky fills the page, the sign-in is one centred card under the logo */
@media (min-width: 720px) {
  .v-auth { justify-content: center; align-items: center; padding: 40px 20px; }
  .a-sky { height: 100%; }
  .a-sky::after { background: linear-gradient(180deg, rgba(118, 142, 214, .2), rgba(110, 134, 208, .5)); }
  .a-hero { flex: none; padding: 0 0 26px; }
  .a-logo { width: 150px; }
  .a-sheet { width: 440px; border-radius: 28px; padding: 32px 32px 28px; box-shadow: 0 30px 60px -30px rgba(28, 29, 68, .45); }
}
