/* Shared styles: sign-in pages and the setup wizard */
:root {
    --ink: #0a0a0a;
    --text: #111827;
    --muted: #6b7280;
    --faint: #9ca3af;
    --border: #e5e7eb;
    --field: #f9fafb;
    --bg: #ffffff;
    --panel: #0a0a0a;
    --panel-text: #f9fafb;
    --panel-muted: #9ca3af;
    --panel-line: #262626;
    --error-bg: #fef2f2; --error-text: #991b1b; --error-line: #fecaca;
    --ok-bg: #f0fdf4;    --ok-text: #166534;    --ok-line: #bbf7d0;
    --info-bg: #f3f4f6;  --info-text: #111827;  --info-line: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.login { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }

/* Brand panel */
.brand { background: var(--panel); color: var(--panel-text); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.brand::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; mask-image: linear-gradient(to bottom, transparent, #000 60%); }
.logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 8px; background: #fff; color: #000; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.logo-text strong { display: block; font-size: 15px; letter-spacing: -0.01em; }
.logo-text span { font-size: 12px; color: var(--panel-muted); }
.brand-copy { position: relative; z-index: 1; max-width: 420px; }
.brand-copy h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 600; margin: 0 0 16px; }
.brand-copy p { color: var(--panel-muted); font-size: 15px; line-height: 1.6; margin: 0 0 40px; }
.journey { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.journey li { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #d4d4d4; position: relative; padding: 9px 0; }
.journey li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #525252; background: var(--panel); flex-shrink: 0; position: relative; z-index: 1; }
.journey li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 50%; height: 100%; width: 1.5px; background: var(--panel-line); }
.journey li:last-child::before { background: #fff; border-color: #fff; }
.journey li:last-child { color: #fff; font-weight: 600; }
.brand-foot { position: relative; z-index: 1; font-size: 12px; color: #737373; }

/* Form side */
.form-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; }
.form-wrap { width: 100%; max-width: 380px; }
.mobile-logo { display: none; margin-bottom: 40px; color: var(--text); }
.mobile-logo .logo-mark { background: #000; color: #fff; }
.mobile-logo .logo-text span { color: var(--muted); }
.form-wrap h2 { font-size: 28px; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 14.5px; margin: 0 0 32px; line-height: 1.5; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); text-decoration: none; margin-bottom: 28px; }
.back-link:hover { color: var(--text); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.45; margin-bottom: 24px; border: 1px solid; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.alert-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-line); }

.field { margin-bottom: 18px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.field label { font-size: 13.5px; font-weight: 500; }
.field-head a { font-size: 13px; color: var(--muted); text-decoration: none; }
.field-head a:hover { color: var(--text); text-decoration: underline; }
.input-wrap { position: relative; }
.input { width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--text); background: var(--field); border: 1px solid var(--border); border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #d1d5db; }
.input:focus { background: #fff; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,0.08); }
.input.has-toggle { padding-right: 48px; }
.input.is-bad { border-color: #f87171; }
.toggle-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.toggle-pw:hover { color: var(--text); background: #f3f4f6; }
.toggle-pw:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.toggle-pw .eye-shut { display: none; }
.toggle-pw[aria-pressed="true"] .eye-open { display: none; }
.toggle-pw[aria-pressed="true"] .eye-shut { display: block; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.hint.ok { color: var(--ok-text); }
.hint.bad { color: var(--error-text); }
.caps { display: none; font-size: 12.5px; color: var(--error-text); margin-top: 6px; }

.btn-primary { width: 100%; height: 46px; margin-top: 8px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .05s; text-decoration: none; }
.btn-primary:hover { background: #262626; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-primary[disabled] { opacity: .7; cursor: default; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.help { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.help a { color: var(--text); font-weight: 500; }

.demo { margin-top: 32px; border: 1px dashed var(--border); border-radius: 10px; }
.demo summary { cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 500; color: var(--muted); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.demo summary::-webkit-details-marker { display: none; }
.demo summary::after { content: "+"; font-size: 16px; }
.demo[open] summary::after { content: "–"; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.demo-grid button { text-align: left; padding: 10px 12px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
.demo-grid button:hover { border-color: var(--ink); }
.demo-grid strong { display: block; font-size: 13px; }
.demo-grid span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.copyright { display: none; margin-top: 40px; text-align: center; font-size: 12px; color: var(--faint); }

@media (max-width: 960px) {
    .login { grid-template-columns: 1fr; }
    .brand { display: none; }
    .mobile-logo { display: flex; }
    .copyright { display: block; }
    .form-side { justify-content: flex-start; padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ── Setup wizard ─────────────────────────────── */
.wizard { grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); }
.wizard .form-side { justify-content: flex-start; padding: 56px 32px 64px; }
.wizard .form-wrap { max-width: 620px; }
.steps { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: step; position: relative; z-index: 1; }
.steps li { position: relative; }
.steps a { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; text-decoration: none; color: #a3a3a3; }
.steps a:hover { color: #fff; }
.step-num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #404040; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; background: var(--panel); position: relative; z-index: 1; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 36px; bottom: -10px; width: 1.5px; background: var(--panel-line); }
.step-text strong { display: block; font-size: 14px; font-weight: 500; }
.step-text span { font-size: 12px; color: #737373; }
.steps li.done .step-num { background: #fff; border-color: #fff; color: #000; }
.steps li.current a { color: #fff; }
.steps li.current .step-num { border-color: #fff; color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.12); }
.steps li.current .step-text strong { font-weight: 600; }
.steps li.locked a { pointer-events: none; opacity: .55; }

.step-kicker { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.section { border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.section h3 { font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.section > p { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.check-list li:last-child { border-bottom: 0; }
.check-list .ok, .check-list .bad, .check-list .warn { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 700; }
.check-list .ok { background: var(--ok-bg); color: var(--ok-text); }
.check-list .bad { background: var(--error-bg); color: var(--error-text); }
.check-list .warn { background: #fef3c7; color: #92400e; }
.check-list small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.day-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.day-picks label { position: relative; }
.day-picks input { position: absolute; opacity: 0; }
.day-picks span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; cursor: pointer; user-select: none; }
.day-picks input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.day-picks input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 10px 8px 10px 0; border-bottom: 1px dashed var(--border); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; }
.tag.dark { background: var(--ink); color: #fff; }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.wizard-nav .btn-primary { width: auto; margin: 0; padding: 0 22px; }
.btn-secondary { height: 42px; padding: 0 16px; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-secondary:hover { border-color: var(--ink); }
.link-skip { font-size: 13.5px; color: var(--muted); }
.creds { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }

@media (max-width: 960px) {
    .wizard { grid-template-columns: 1fr; }
    .wizard .form-side { padding: 32px 20px 48px; }
    .mobile-steps { display: block !important; }
}
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr !important; } .wizard-nav { flex-wrap: wrap; } .mini-table { display: block; overflow-x: auto; } }
.mobile-steps { display: none; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.mobile-steps .bar { height: 4px; background: var(--border); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.mobile-steps .bar span { display: block; height: 100%; background: var(--ink); }

/* ── Brand logo ───────────────────────────────── */
.brand-logo { display: inline-flex; background: #fff; border-radius: 16px; padding: 14px 18px; position: relative; z-index: 1; box-shadow: 0 8px 30px rgba(0,0,0,.35); align-self: flex-start; }
.brand-logo img { width: 190px; height: auto; display: block; }
.product-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: #fff; margin-bottom: 18px; position: relative; z-index: 1; }
.product-name span { font-weight: 400; color: var(--panel-muted); }
.mobile-logo { display: none; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 36px; text-decoration: none; }
.mobile-logo img { width: 150px; height: auto; }
.mobile-logo .product-name { color: var(--text); margin: 0; font-size: 14px; }
.mobile-logo .product-name span { color: var(--muted); }
@media (max-width: 960px) { .mobile-logo { display: flex; } }
