:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    background: #fff;
    font-synthesis: none;
    --accent: #604ab6;
    --accent-dark: #4f3b9a;
    --muted: #727780;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
main { flex: 1; min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 3fr) minmax(460px, 2fr); grid-template-rows: minmax(0, 1fr); }
.color-panel { background: var(--accent); grid-column: 1; grid-row: 1 / -1; }
.login-panel { grid-column: 2; grid-row: 1; min-height: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 32px clamp(32px, 5.45vw, 84px); }
.auth-shell { width: 100%; max-width: 380px; }
.brand { display: inline-flex; margin-bottom: 28px; }
.brand-logo { display: block; width: 152px; height: auto; }
h1 { font-size: 28px; font-weight: 300; line-height: 1.5; margin: 0 0 4px; letter-spacing: -.5px; }
h1:focus, .auth-card:focus { outline: none; }
.intro { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 28px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 6px; }

.field select { width: 100%; height: 40px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; background: #f3f4f6; color: #111827; font-size: 14px; }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #604ab618; }
.access-notice { margin-top: 32px; padding-top: 18px; border-top: 1px solid #ececf1; color: #6b6b78; }
.access-notice h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: #626270; }
.access-notice p { margin: 0; font-size: 12px; line-height: 1.65; }
.access-notice p + p { margin-top: 10px; }
input { width: 100%; height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 9px 12px; background: #f3f4f6; color: #111827; font-size: 14px; transition: background .15s, border-color .15s, box-shadow .15s; }
input:hover { background: #eceff1; }
input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px #604ab618; }
input[aria-invalid=true] { border-color: #bf4545; }
input::placeholder { color: #8b949c; opacity: 1; }
.primary { width: 100%; min-height: 40px; margin-top: 4px; padding: 10px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.primary:hover { background: var(--accent-dark); }
a.primary { display: block; text-align: center; }
.session-copy { margin: 0 0 28px; font-size: 14px; line-height: 1.7; color: #626270; }
.session-actions { display: grid; gap: 10px; }
.secondary-action { display: block; border: 1px solid #e2e2ea; border-radius: 6px; text-align: center; padding: 10px 16px; font-size: 14px; color: #4a4a5a; }
.secondary-action:hover { background: #f6f5f9; }
.signed-out-check { margin-bottom: 20px; }
.close-browser-note { display: flex; gap: 12px; padding: 18px; border-radius: 8px; background: #f5f3fa; margin-bottom: 16px; }
.close-browser-note svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.close-browser-note h2 { font-size: 14px; font-weight: 600; margin: 0 0 7px; color: #4f3b9a; }
.close-browser-note p { font-size: 13px; line-height: 1.7; margin: 0; color: #626270; }
.session-fine-print { font-size: 12px; line-height: 1.7; color: #6b6b78; margin: 0 0 24px; }
.text-button { padding: 0; background: none; border: 0; color: var(--accent-dark); font-size: 13px; line-height: 1.6; }
.text-button:hover { text-decoration: underline; }
.account-help { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 26px 0 0; }
.account-help .text-button { font-size: inherit; color: inherit; text-align: left; }
.account-chip { display: flex; gap: 10px; align-items: center; border-radius: 6px; background: #f6f7f8; padding: 12px; margin-bottom: 24px; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; font-size: 11px; color: #604ab6; border-radius: 50%; background: #ebe8f5; }
.account-chip strong { display: block; font-size: 12px; font-weight: 600; }
.account-chip small { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin-top: 3px; }
.account-chip .text-button { margin-left: auto; font-size: 12px; }
.code-field { padding: 0; border: 0; min-width: 0; }
.code-field legend { font-size: 13px; font-weight: 600; line-height: 1.5; padding: 0; margin-bottom: 10px; }
.code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-digit { min-width: 0; height: 58px; padding: 0; text-align: center; font-size: 25px; font-weight: 500; font-variant-numeric: tabular-nums; caret-color: var(--accent); border-radius: 8px; }
.code-digit.filled { background: #f3f0fa; border-color: #cfc7e8; color: #4f3b9a; }
.code-digit:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 3px #604ab620; }
.recovery-input { font-family: Consolas, monospace; font-size: 16px; letter-spacing: 2px; }
.field-hint { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 9px 0 0; }
.alternative { display: block; margin: 18px auto 0; text-align: center; }
.alert { display: flex; align-items: flex-start; gap: 9px; padding: 12px; margin: 0 0 20px; background: #fff5f4; color: #a12f32; border: 1px solid #f2d7d5; border-radius: 6px; font-size: 13px; line-height: 1.6; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; margin-top: 2px; }
.completion { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 24px; }
.completion p { margin: 14px 0 6px; color: #1e1e2f; }
.completion-check { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #604ab6; background: #ebe8f5; font-size: 24px; }
.icon-button { width: 36px; height: 36px; background: none; border: none; color: #626270; font-size: 24px; }
.skip-link { position: absolute; top: -60px; left: 20px; background: #fff; padding: 10px; z-index: 1; }
.skip-link:focus { top: 10px; }
@media (max-width: 800px) {
    main { grid-template-columns: minmax(0, 1fr); }
    .color-panel { display: none; }
    .login-panel { grid-column: 1; padding: 28px; }
}
@media (max-width: 360px) {
    .login-panel { padding: 32px 22px; }
    .account-chip { gap: 7px; padding: 10px; }
    .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

.setup-qr { display:block; max-width:100%; height:auto; margin:16px auto; }
.setup-details { margin: 16px 0 24px; font-size:14px; }
.setup-key { display:block; overflow-wrap:anywhere; margin:12px 0; }
.recovery-codes { list-style:none; padding:0; font-size:15px; line-height:1.9; margin-bottom:24px; }
.scope-list { padding-left:20px; line-height:1.8; margin-bottom:24px; }
.button-link { display:flex; align-items:center; justify-content:center; text-decoration:none; text-align:center; }
