/* Look shared by the sign-in, offer, account, recover and owner pages:
   one night-sky stage and a dark glass card.
   Inter loaded on sign-in only; other pages stay system-font. */
:root {
  --sky-0: #070a18;
  --sky-1: #0d1330;
  --ink: #eef0fb;
  --ink-soft: #a7adcc;
  --glass: rgba(18, 24, 56, 0.62);
  --glass-edge: rgba(190, 200, 255, 0.18);
  --accent: #8b7cff;
  --accent-ink: #0b0d1f;
  --good: #5fd9a4;
  --bad: #ff8d8d;
  --font-display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--sky-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-block: 28px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  position: relative;
  overflow-x: hidden;
}
a { color: var(--accent); }

.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none;
       background: radial-gradient(120% 90% at 50% 0%, var(--sky-1), var(--sky-0) 70%); }
/* "Aurora" strength: the two drifting glows, no starfield. */
.glow { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(70px);
        opacity: 0.55; will-change: transform; }
.glow.a { left: -20vmax; top: -25vmax; background: radial-gradient(circle, var(--accent), transparent 62%); }
.glow.b { right: -25vmax; bottom: -30vmax; background: radial-gradient(circle, #3a8bd8, transparent 62%); }

main { position: relative; z-index: 1; max-width: 440px; margin: 0 auto; display: flex;
       flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 34px; height: 34px; border-radius: 10px;
        background: conic-gradient(from 210deg, var(--accent), #3a8bd8, var(--accent));
        display: grid; place-items: center; }
.mark::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--sky-0); }
.brand b { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }

.card { position: relative; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-edge);
        border-radius: 18px; padding: 26px 22px; backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 16px;
        animation: rise 0.7s cubic-bezier(.2,.7,.2,1) both; }
/* The passkey orb: a round button, about 172px, with a short looping clip
   inside it. The clip and the CSS glow behind it fade out at the edge with a
   soft radial mask, so the circle melts into the card. The button itself is
   not masked, so its focus ring stays visible. */
.orbwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
:root { --orb: min(172px, 42vw, 22vh); --orb: min(172px, 42vw, 22dvh); }
.orb { position: relative; display: block; padding: 0; border: 0; border-radius: 50%;
       width: var(--orb); aspect-ratio: 1;
       background: transparent; cursor: pointer; overflow: visible; }
.orb-glow, .orb-video { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%;
       -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 71%);
       mask-image: radial-gradient(circle, #000 52%, transparent 71%); pointer-events: none; }
.orb-glow { background: radial-gradient(circle, rgba(139,124,255,.75), rgba(58,139,216,.3) 55%, transparent 72%); }
.orb { isolation: isolate; }
/* On top: the video. Its dark parts let what is underneath (the glow, and the
   sweep below) show through, which is how the light seems to run through them. */
.orb-video { object-fit: cover; mix-blend-mode: screen; }
/* Under the video, 125% of the orb: the one-time sweep of light. */
.orb-sheen { position: absolute; inset: -12.5%; border-radius: 50%; pointer-events: none; opacity: 0;
       background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.75) 50%, transparent 62%);
       background-size: 260% 100%; background-position: 160% 0;
       -webkit-mask-image: radial-gradient(circle, #000 50%, transparent 70%);
       mask-image: radial-gradient(circle, #000 50%, transparent 70%); }

/* The opening sequence, for people with a passkey on this device (the page is
   marked "cine"): the video waits invisible until its first frame is ready. */
html.cine .orb-video { opacity: 0; }
html.cine .orb.orb-in .orb-video { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  html.cine main { animation: pagefade .45s ease both; }
  html.cine .orb-video { transform: scale(.92); transition: opacity .5s ease, transform .5s ease; }
  html.cine .orb.orb-in .orb-video { transform: none; }
  .orbwrap.sheen .orb-sheen { animation: sheen .9s ease-out 1 both; }
  .orbwrap.sheen .orb-glow { animation: pulse 1.2s ease-out 1; }
}
@keyframes pagefade { from { opacity: 0; } }
@keyframes sheen { 0% { opacity: 1; background-position: 160% 0; }
                   100% { opacity: 0; background-position: -60% 0; } }
@keyframes pulse { 50% { filter: brightness(1.6); transform: scale(1.1); } }
.orb:hover .orb-glow, .orb:focus-visible .orb-glow { filter: brightness(1.25); }
.orb:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.orb-label { margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* Portrait phones (narrow, tall enough): no scrolling at all, and the orb sits
   where an under-display fingerprint sensor usually is: horizontally centred,
   its centre about 78% of the way down (22dvh up from the bottom), so a thumb
   goes straight from the orb to the sensor. The card stays at the top, clear of
   it. On a short screen (under 640px tall) or a wide one, the orb stays inside
   the card as usual. */
@media (max-width: 500px) and (orientation: portrait) and (min-height: 640px) {
  html, body.centered { height: 100vh; height: 100dvh; overflow: hidden; }
  body.centered { align-items: flex-start; padding-top: max(14px, env(safe-area-inset-top, 0px)); }
  /* A blurred or animated card would become the "screen" its fixed child is
     placed against, so in this layout the card is plain glass and still. */
  body.centered .card { backdrop-filter: none; -webkit-backdrop-filter: none; animation: none;
                        background: rgba(18, 24, 56, 0.78); }
  body.centered .orbwrap {
    position: fixed; left: 50%; transform: translateX(-50%); z-index: 2;
    /* label (about 26px) sits under the orb; the orb's centre is 22dvh up */
    bottom: max(calc(22vh - var(--orb) / 2 - 26px), env(safe-area-inset-bottom, 0px));
    bottom: max(calc(22dvh - var(--orb) / 2 - 26px), env(safe-area-inset-bottom, 0px));
  }
}

/* Sign-in: one centred card that fits a phone screen (about 412 x 915 CSS px)
   with no scrolling. Compact spacing; the page is exactly one viewport tall. */
body.centered { min-height: 100vh; min-height: 100dvh; padding-block: 10px; display: flex;
                align-items: center; justify-content: center; }
body.centered main { width: 100%; gap: 14px; }
body.centered .card { padding: 20px 18px; gap: 12px; }
body.centered h1 { font-size: 20px; }
body.centered input { padding: 9px 12px; }
body.centered .btn, body.centered button { padding: 11px 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.25;
     text-wrap: balance; }
h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.sub { margin: 0; color: var(--ink-soft); font-size: 14px; }
label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
        color: var(--ink-soft); margin-bottom: 6px; }
input, select { width: 100%; font: inherit; color: var(--ink); background: rgba(5, 8, 22, 0.55);
        border: 1px solid var(--glass-edge); border-radius: 10px; padding: 11px 12px; }
input:focus-visible, select:focus-visible, .btn:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.btn, button { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 13px 16px;
        cursor: pointer; background: transparent; color: var(--ink); border: 1px solid var(--glass-edge); }
.btn.main, button.main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.wide, button.wide { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--glass-edge); }
.fine { font-size: 12px; color: var(--ink-soft); margin: 0; }
.note { margin: 0; font-size: 14px; color: var(--ink-soft); }
.note.bad { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
           border: 1px solid var(--glass-edge); border-radius: 12px; padding: 11px 12px; font-size: 14px; }
.list li div { min-width: 0; }
.list small { display: block; color: var(--ink-soft); font-size: 12px; }
.pill { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px;
        background: rgba(95, 217, 164, 0.16); color: var(--good); white-space: nowrap; }
.pill.temp { background: rgba(240, 180, 76, 0.16); color: #f0b44c; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--glass-edge); vertical-align: top; }

/* Float-orb: shared ambient glow behind the card's content on sign-in.
   Absolutely placed so it glides without affecting layout. */
.float-orb {
  position: absolute;
  width: 280px; height: 280px; border-radius: 50%;
  pointer-events: none; z-index: 0;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 42% 38%,
    rgba(139,124,255,.28) 0%,
    rgba(80,100,255,.10) 48%,
    transparent 70%);
  animation: orb-breathe 4.5s ease-in-out infinite;
}
@keyframes orb-breathe {
  0%,100% { box-shadow: 0 0 60px rgba(139,124,255,.10); }
  50%      { box-shadow: 0 0 90px rgba(139,124,255,.20); }
}
/* All card children sit above the float-orb */
.card > *:not(.float-orb) { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .glow, .card, .float-orb { animation: none; }
}
