@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600.woff2) format("woff2"); }

:root {
    color-scheme: light;
    --bg: #ffffff; --ink: #16191c; --muted: #5f6670; --line: #d9dde1; --line-strong: #b9bfc6;
    --field: #ffffff; --hover: #f3f4f5;
    --primary: #1b827a; --on-primary: #ffffff; --primary-hover: #166962;
    --accent: #167b75; --focus: rgba(35, 168, 158, .45);
    --error: #b3261e;
    --apple: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #111315; --ink: #eceef0; --muted: #9aa2ab; --line: #2e3338; --line-strong: #474e55;
        --field: #17191c; --hover: #1d2024;
        --primary: #1b827a; --on-primary: #ffffff; --primary-hover: #166962;
        --accent: #4fd1c5; --focus: rgba(79, 209, 197, .5);
        --error: #f2b8b5;
        --apple: invert(1);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111315; --ink: #eceef0; --muted: #9aa2ab; --line: #2e3338; --line-strong: #474e55;
    --field: #17191c; --hover: #1d2024;
    --primary: #1b827a; --on-primary: #ffffff; --primary-hover: #166962;
    --accent: #4fd1c5; --focus: rgba(79, 209, 197, .5);
    --error: #f2b8b5;
    --apple: invert(1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); caret-color: var(--accent); font-family: Poppins, system-ui, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--focus); }
a { color: var(--accent); text-underline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.digits { font-variant-numeric: tabular-nums; }

.page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; }
.main { display: grid; place-items: center; padding: 48px 24px 32px; }
.column { width: 100%; max-width: 360px; }
.drop { display: block; width: 40px; height: auto; margin: 0 auto 28px; }
.brand { margin-bottom: 32px; text-align: center; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.lede strong { color: var(--ink); font-weight: 600; }

.notice { margin-bottom: 28px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.notice strong { display: block; color: var(--ink); font-weight: 600; }

.stack { display: grid; gap: 12px; }
.field { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); outline: none; transition: border-color .15s, box-shadow .15s; }
.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.field.code { text-align: center; font-size: 22px; letter-spacing: .4em; padding-left: calc(16px + .4em); }

.btn-primary { height: 52px; border: 0; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-weight: 600; transition: background .15s; }
.btn-primary:hover { background: var(--primary-hover); }

.chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 6px 0 16px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 4px; }
.chip .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chip .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip a { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; }
.chip a:hover { background: var(--hover); }

.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: none; text-align: left; transition: background .15s, border-color .15s; }
.row:hover { background: var(--hover); border-color: var(--line-strong); }
.row .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .sub { display: block; color: var(--muted); font-size: 13px; }
.row .chev { color: var(--muted); }

.alert { color: var(--error); font-size: 14px; }
.stack + .alert { margin-top: 12px; }

.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .18; }
.circles { display: flex; justify-content: center; gap: 16px; }
.circle { display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--hover); overflow: hidden; transition: background .15s, border-color .15s; }
.circle:hover { border-color: var(--line-strong); background: var(--bg); }
.circle svg { width: 22px; height: 22px; }
.circle img { width: 100%; height: 100%; filter: var(--apple); }
.passkey-alert { margin-top: 16px; text-align: center; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 20px; font-size: 14px; }
.link { padding: 0; border: 0; background: none; color: var(--accent); }
.links a, .link, .foot a { text-decoration: none; }
.links a:hover, .link:hover, .foot a:hover { text-decoration: underline; }
.note { margin-top: 24px; color: var(--muted); font-size: 14px; text-align: center; }

.btn-primary:focus-visible, .row:focus-visible, .circle:focus-visible, .link:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[aria-busy="true"] { cursor: progress; }
[aria-busy="true"]::after { content: ""; flex: none; width: 20px; height: 20px; border: 2px solid; border-right-color: transparent; border-radius: 50%; animation: pulse .8s ease-in-out infinite alternate; }
body:has([aria-busy="true"]) button:not([aria-busy="true"]) { opacity: .5; pointer-events: none; }
.btn-primary, .circle { position: relative; }
.btn-primary[aria-busy="true"] { color: transparent; }
.btn-primary[aria-busy="true"]::after { color: var(--on-primary); }
.btn-primary[aria-busy="true"]::after, .circle[aria-busy="true"]::after { position: absolute; inset: 0; margin: auto; }
.row[aria-busy="true"]::after, .circle[aria-busy="true"]::after { color: var(--accent); }
.row[aria-busy="true"] .chev { display: none; }
.circle[aria-busy="true"] > * { visibility: hidden; }
.link[aria-busy="true"] { display: inline-flex; align-items: center; gap: 6px; }
.link[aria-busy="true"]::after { width: 14px; height: 14px; }

.foot { display: flex; justify-content: center; gap: 24px; padding: 20px 24px 28px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    .notice { view-transition-name: notice; }
    .drop { view-transition-name: drop; }
    .brand h1 { view-transition-name: title; }
    .chip { view-transition-name: chip; }
    .foot { view-transition-name: foot; }
    ::view-transition-old(root) { animation: 150ms ease-in both step-out; }
    ::view-transition-new(root) { animation: 260ms ease-out 60ms both step-in; }
    ::view-transition-old(title) { animation: 120ms ease-in both step-out; }
    ::view-transition-new(title) { animation: 220ms ease-out 110ms both step-in; }
    [aria-busy="true"]::after { animation: spin .7s linear infinite; }
}

@keyframes spin { to { transform: rotate(1turn); } }
@keyframes pulse { to { opacity: .3; } }
@keyframes step-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes step-in { from { opacity: 0; transform: translateY(12px); } }

@media (min-width: 720px) {
    .main { padding-top: 64px; }
    h1 { font-size: 30px; }
}
