/*
 * Sign-in pages (layouts/focus): sign in, sign up, forgot and new password, the two-step code,
 * confirm password, confirm email, switched-off account.
 * One centred card on paper, the logo above it and nothing else to click away to. Behind the card,
 * faint rings like a radar sweep with one clay "ping": the only decoration. Colours and fonts come
 * from the paper tokens in site-paper.css (light and dark).
 */
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin: 0; background: var(--paper-canvas); color: var(--paper-ink);
    font: 400 15px/1.5 var(--paper-sans); -webkit-font-smoothing: antialiased; position: relative; overflow-x: clip; }
.gate *, .gate *::before, .gate *::after { box-sizing: border-box; }

/* ---------- backdrop ---------- */
.gate-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.gate-bg::before { content: ""; position: absolute; inset: 0;
    background: repeating-radial-gradient(circle at 50% 300px, transparent 0 63px, var(--paper-chalk) 63px 64px);
    -webkit-mask-image: radial-gradient(circle at 50% 300px, #000 0 140px, transparent 600px);
    mask-image: radial-gradient(circle at 50% 300px, #000 0 140px, transparent 600px); }
.gate-ping { position: absolute; top: calc(300px - 192px); left: calc(50% + 333px); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--paper-clay); }
.gate-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--paper-clay); animation: gate-ping 3.2s ease-out infinite; }
@keyframes gate-ping { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gate-ping::after { animation: none; opacity: 0; } }

/* ---------- frame ---------- */
.gate-top, .gate-main, .gate-foot { position: relative; z-index: 1; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.gate-top { display: flex; justify-content: center; padding-block: 36px 24px; }
.gate-logo { display: inline-flex; border-radius: 6px; }
.gate-logo img { display: block; width: 200px; height: auto; }
.gate-logo .gate-logo-dark { display: none; }
:root[data-theme="dark"] .gate-logo .gate-logo-light { display: none; }
:root[data-theme="dark"] .gate-logo .gate-logo-dark { display: block; }
.gate-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding-block: 8px 40px; }
.gate-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding-block: 20px 28px; font-size: 13px; color: var(--paper-ashen); }
.gate-foot a { color: var(--paper-ashen); text-decoration: none; }
.gate-foot a:hover { color: var(--paper-ink); text-decoration: underline; text-underline-offset: 3px; }
.gate-foot strong { font-weight: 500; color: var(--paper-graphite); }

/* ---------- the card ---------- */
.gate-card { width: 100%; max-width: 440px; background: var(--paper-card); border: 1px solid var(--paper-chalk); border-radius: 20px;
    padding: 40px 40px 34px; box-shadow: 0 1px 2px rgba(18, 18, 18, .04), 0 18px 40px -18px rgba(18, 18, 18, .16); }
:root[data-theme="dark"] .gate-card { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); }
.gate-badge { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%; background: var(--paper-stone); color: var(--paper-ink); }
.gate-h1 { margin: 0; font-family: var(--paper-serif) !important; font-weight: 500 !important; font-size: clamp(30px, 4vw + 14px, 38px); line-height: 1.1; letter-spacing: -0.015em; text-align: center; text-wrap: balance; color: var(--paper-ink); }
.gate-sub { margin: 10px auto 0; max-width: 34ch; font-size: 15px; color: var(--paper-ashen); text-align: center; text-wrap: pretty; }
.gate-sub a { white-space: nowrap; }
.gate-sub a, .gate-link { color: var(--paper-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--paper-mist); text-underline-offset: 3px; }
.gate-sub a:hover, .gate-link:hover { text-decoration-color: var(--paper-ink); }
.gate-body { display: grid; gap: 18px; margin-top: 28px; }

/* status and errors */
.gate-note { margin: 0; padding: 11px 14px; border-radius: 12px; font-size: 14px; background: var(--paper-stone); color: var(--paper-graphite); }
.gate-note.is-ok { background: var(--paper-good-bg); color: var(--paper-good); }
.gate-note.is-bad { background: var(--paper-bad-bg); color: var(--paper-bad); }
.gate-err { margin: 6px 0 0; font-size: 13.5px; color: var(--paper-bad); }
.gate-err[hidden] { display: none; }
.gate-help { margin: 6px 0 0; font-size: 13px; color: var(--paper-ashen); }
.gate-help.is-ok { color: var(--paper-good); }

/* the passkey button (where other sites put "Continue with Google") */
.gate-alt { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 12px;
    border: 1px solid var(--paper-chalk); background: var(--paper-card); color: var(--paper-ink); font: 500 15px/1 var(--paper-sans); cursor: pointer;
    transition: background-color .15s, border-color .15s; }
.gate-alt:hover { background: var(--paper-canvas); border-color: var(--paper-mist); }
.gate-alt[hidden], .gate-or[hidden] { display: none; }
.gate-alt svg { flex: none; }
.gate-or { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 13px; color: var(--paper-ashen); }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--paper-chalk); }

/* fields */
.gate-form { display: grid; gap: 16px; margin: 0; }
.gate-field { display: grid; gap: 6px; min-width: 0; }
.gate-field > label, .gate-label { font-size: 13.5px; font-weight: 500; color: var(--paper-graphite); }
.gate-input, .gate input.gate-input { width: 100%; min-height: 48px; margin: 0; padding: 0 14px; border-radius: 12px; border: 1px solid var(--paper-mist);
    background: var(--paper-card); color: var(--paper-ink); font: 400 16px/1.2 var(--paper-sans); transition: border-color .15s, box-shadow .15s; }
.gate-input::placeholder { color: var(--paper-ashen); opacity: 1; }
.gate-input:hover { border-color: var(--paper-ashen); }
.gate-input:focus { outline: none; border-color: var(--paper-ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--paper-ink) 14%, transparent); }
.gate-input[aria-invalid="true"] { border-color: var(--paper-bad); }
.gate-pw { position: relative; }
.gate-pw .gate-input { padding-right: 52px; }
.gate-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px;
    background: transparent; color: var(--paper-ashen); cursor: pointer; }
.gate-eye:hover { color: var(--paper-ink); background: var(--paper-stone); }
.gate-eye[hidden] { display: none; }
.gate-eye .gate-eye-off, .gate-eye[aria-pressed="true"] .gate-eye-on { display: none; }
.gate-eye[aria-pressed="true"] .gate-eye-off { display: block; }
.gate-caps { margin: 6px 0 0; font-size: 13px; color: var(--paper-warn); }
.gate-caps[hidden] { display: none; }
.gate-otp { text-align: center; font-size: 26px !important; font-weight: 500 !important; letter-spacing: .32em; font-variant-numeric: tabular-nums; min-height: 60px !important; }
.gate-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--paper-graphite); cursor: pointer; }
.gate-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--paper-ink); }
.gate-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* buttons */
.gate-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 18px; border-radius: 12px; border: 0;
    background: var(--paper-ink); color: var(--paper-canvas); font: 500 16px/1 var(--paper-sans); text-decoration: none; cursor: pointer; transition: background-color .15s; }
.gate-btn:hover { background: var(--paper-graphite); }
:root[data-theme="dark"] .gate-btn { color: #121212; }
:root[data-theme="dark"] .gate-btn:hover { background: #ffffff; }
.gate-btn[disabled], .gate-btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.gate-btn[hidden] { display: none; }
.gate-btn-soft { background: transparent; color: var(--paper-ink); box-shadow: inset 0 0 0 1px var(--paper-chalk); }
.gate-btn-soft:hover { background: var(--paper-canvas); }
:root[data-theme="dark"] .gate-btn-soft { color: var(--paper-ink); }
:root[data-theme="dark"] .gate-btn-soft:hover { background: var(--paper-stone); }
.gate-actions { display: grid; gap: 10px; }
.gate-center { margin: 0; text-align: center; font-size: 14px; }

/* folded extras: "Use your password instead", "Use a recovery code" */
.gate-more > summary { list-style: none; margin: 0 auto; width: fit-content; font-size: 14px; font-weight: 500; color: var(--paper-ink); cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--paper-mist); text-underline-offset: 3px; }
.gate-more > summary::-webkit-details-marker { display: none; }
.gate-more > summary[hidden] { display: none; }
.gate-more[open] > summary:not([hidden]) { margin-bottom: 16px; }

/* under the card */
.gate-after { width: 100%; max-width: 440px; margin-top: 22px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.gate-trust { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--paper-ashen); }
.gate-trust svg { flex: none; color: var(--paper-good); }
.gate-perks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--paper-graphite); text-align: left; }
.gate-perks li { display: flex; gap: 10px; align-items: flex-start; }
.gate-perks svg { flex: none; margin-top: 3px; color: var(--paper-good); }

/* the bot check box (osh-human.js): invisible unless Cloudflare asks for a click */
.osh-human:not(.is-asking) { height: 0; overflow: hidden; }
.gate .osh-human:not(.is-asking) { margin-block: -8px; }
.osh-human-msg { margin: 0; font-size: 13.5px; color: var(--paper-ashen); }
.osh-human-msg[hidden] { display: none; }

/* focus */
.gate a:focus-visible, .gate button:focus-visible, .gate summary:focus-visible, .gate input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--paper-ink); outline-offset: 3px; }

@media (max-width: 560px) {
    .gate-top { padding-block: 24px 16px; }
    .gate-logo img { width: 170px; }
    .gate-card { padding: 30px 22px 26px; border-radius: 18px; }
    .gate-body { margin-top: 24px; }
}
