:root {
    --bg: #ffffff;
    --text: #0a0a0a;
    --muted: #6b6b6b;
    --faint: #989898;
    --border: rgba(0, 0, 0, 0.08);
    --surface: rgb(251, 251, 251);
    --green: #1dcc5d;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.5;
    letter-spacing: -0.02em; -webkit-font-smoothing: antialiased;
    min-height: 100vh; display: flex; flex-direction: column;
}
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(120% 80% at 50% 0%, #f4f4f5 0%, #ffffff 55%),
        radial-gradient(60% 50% at 15% 20%, rgba(10,10,10,0.04) 0%, transparent 70%);
}
a { color: inherit; }

.top {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1200px; width: 100%; margin: 0 auto; padding: 19px 36px;
}
.logo {
    font-family: 'Source Serif 4', Georgia, serif; font-size: 30px; font-weight: 600;
    font-style: italic; letter-spacing: -0.06em; line-height: 1; text-decoration: none;
}
.logo sup {
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
    font-style: normal; letter-spacing: 0; vertical-align: super;
}
.back { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }

.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 20px 64px; }
.auth { width: 100%; max-width: 430px; }
.auth h1 {
    font-size: 40px; line-height: 1.06; letter-spacing: -0.055em; font-weight: 600;
    margin-bottom: 8px; text-align: center;
}
.auth h1 .serif { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; letter-spacing: -0.05em; }
.auth .lede { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 28px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: 0 24px 60px -32px rgba(0,0,0,0.16); }

.tabs {
    display: flex; padding: 4px; margin-bottom: 24px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.tabs a {
    flex: 1; text-align: center; text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 9px 12px; border-radius: 999px; color: var(--muted);
}
.tabs a.active { background: var(--text); color: #fff; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field input {
    width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 12px;
    padding: 0 16px; font: inherit; font-size: 15px; color: var(--text); background: #fff;
    transition: border-color 0.15s;
}
.field input:focus { outline: none; border-color: var(--text); }
.field input.bad { border-color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint a { color: var(--text); font-weight: 600; text-decoration: none; }
.hint a:hover { text-decoration: underline; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; }
.row-between a { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.row-between a:hover { color: var(--text); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; border-radius: 8px; background: none;
    color: var(--faint); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.pw-toggle[aria-pressed="true"] { color: var(--text); }

.phone-wrap { display: flex; }
.phone-wrap span {
    display: flex; align-items: center; padding: 0 14px; font-size: 15px; color: var(--muted);
    border: 1px solid var(--border); border-right: 0; border-radius: 12px 0 0 12px; background: var(--surface);
}
.phone-wrap input { border-radius: 0 12px 12px 0; }

.consent {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px;
    padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--muted); cursor: pointer;
    border: 1px solid var(--border); border-radius: 12px; background: #fcfcfc;
    transition: border-color 0.15s, background 0.15s;
}
.consent a { color: var(--text); font-weight: 500; }
.consent input {
    appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0;
    border: 1.5px solid rgba(0,0,0,0.28); border-radius: 6px; background: #fff; cursor: pointer; position: relative;
}
.consent input:checked { background: var(--text); border-color: var(--text); }
.consent input:checked::after {
    content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.consent input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.consent:has(input:checked) { background: #fff; border-color: rgba(0,0,0,0.24); }
.consent.missing { border-color: var(--danger); background: #fff5f5; }

.btn {
    width: 100%; height: 52px; border: none; border-radius: 999px; cursor: pointer;
    background: var(--text); color: #fff; font: inherit; font-size: 15px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
}
.btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { font-size: 14px; padding: 12px 16px; border-radius: 10px; line-height: 1.4; margin-bottom: 18px; display: none; }
.notice.show { display: block; }
.notice.ok { background: rgba(16,140,80,0.08); color: rgb(10,110,62); }
.notice.error { background: rgba(200,40,40,0.07); color: rgb(170,30,30); }

.foot-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.foot-note a { color: var(--text); font-weight: 600; text-decoration: none; }

.code-input { letter-spacing: 0.4em; text-align: center; font-size: 20px !important; font-weight: 600; }

[hidden] { display: none !important; }

/* ── Split layout: form on the left, product panel on the right ── */
.auth-shell { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); min-height: 100vh; }
.auth-main { display: flex; flex-direction: column; min-width: 0; }
.auth-main .top { max-width: none; padding: 22px 40px; }
.auth-side {
    position: sticky; top: 0; height: 100vh; margin: 12px 12px 12px 0; height: calc(100vh - 24px);
    background: #0a0a0a; color: #fff; border-radius: 24px; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px 48px 40px;
}
.auth-side::before {         /* faint arcs, same motif as the homepage hero */
    content: ''; position: absolute; width: 760px; height: 760px; right: -380px; top: -200px;
    border: 2px solid rgba(255,255,255,0.06); border-radius: 50%; pointer-events: none;
    box-shadow: 0 0 0 90px rgba(255,255,255,0.015), 0 0 0 180px rgba(255,255,255,0.01);
}
.side-copy h2 {
    font-size: 40px; line-height: 1.06; letter-spacing: -0.055em; font-weight: 600; max-width: 420px;
}
.side-copy h2 .serif { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; letter-spacing: -0.05em; }
.side-copy p { color: rgba(255,255,255,0.6); font-size: 15px; margin-top: 12px; max-width: 380px; }

.side-thread { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 32px 0; }
.side-bubble {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px 18px 18px 6px; padding: 12px 16px; font-size: 14px; line-height: 1.45;
    color: rgba(255,255,255,0.92); animation: rise 0.6s cubic-bezier(.2,.8,.2,1) both;
}
.side-bubble:nth-child(2) { animation-delay: 0.25s; }
.side-bubble:nth-child(3) { animation-delay: 0.5s; }
.side-bubble .from { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: rgba(255,255,255,0.45); margin-bottom: 4px; }
.side-bubble b { letter-spacing: 0.12em; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.side-list { list-style: none; display: grid; gap: 18px; margin: 32px 0; max-width: 400px; }
.side-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.45; }
.side-list .n {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.18);
    display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.side-list b { color: #fff; font-weight: 600; display: block; }

.side-nets { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; }
.side-nets span { font-size: 12px; color: rgba(255,255,255,0.45); display: block; margin-bottom: 14px; }
.side-nets .logos { display: flex; align-items: center; gap: 36px; }
.side-nets img { height: 20px; width: auto; filter: brightness(0) invert(1); opacity: 0.85; }
.side-nets img.at { height: 24px; }
.side-nets svg { height: 26px; width: auto; color: #fff; opacity: 0.85; }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main .top { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .side-bubble { animation: none; } }

@media (max-width: 560px) {
    .top { padding: 20px 20px; }
    .card { padding: 24px 20px; }
    .auth h1 { font-size: 32px; }
    .field input { font-size: 16px; } /* stops iOS zoom on focus */
}

/* ── Continue with Google ── */
.btn-google {
    width: 100%; height: 50px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.14); background: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    font: inherit; font-size: 15px; font-weight: 600; color: var(--text); transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.btn-google:hover { background: var(--surface); border-color: rgba(0,0,0,0.24); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 12px; color: var(--faint); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-who {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 14px;
}
.google-who .av { width: 34px; height: 34px; border-radius: 999px; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.google-who b { display: block; font-size: 14px; }
.google-who span { color: var(--muted); font-size: 13px; }
