/* SPCTR Auth — "Simply Clever" (login / register)
   Minimal surface, smart details. Tokens mirror DESIGN.md. Safe for reduced-motion: nothing here starts at opacity 0. */
.ac-card { width: 100%; max-width: 440px; margin: 0 auto; }
.ac-card.wide { max-width: 520px; }

.ac-brand { text-align: center; margin-bottom: 28px; }
.ac-mark {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, rgba(167,139,250,.2), rgba(124,58,237,.05));
    border: 1px solid rgba(167,139,250,.32);
    box-shadow: 0 0 26px rgba(124,58,237,.22);
}
.ac-mark img { width: 30px; height: 30px; object-fit: contain; }
.ac-mark i { font-size: 1.4rem; color: #a78bfa; }
.ac-title { margin: 0; font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(1.45rem, 5vw, 1.85rem); letter-spacing: .07em; color: #fff; line-height: 1.2; }
.ac-sub { margin: 8px 0 0; font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(240,240,248,.48); }

.ac-alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; margin-bottom: 20px; border-radius: 14px; font-size: .84rem; line-height: 1.5; background: rgba(255,68,102,.08); border: 1px solid rgba(255,68,102,.3); color: #ff8da0; }
.ac-alert i { margin-top: 3px; }
.ac-alert code { display: block; font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .1em; color: rgba(240,240,248,.45); margin-bottom: 3px; }

.ac-info { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; margin-bottom: 22px; border-radius: 14px; font-size: .8rem; line-height: 1.55; color: rgba(240,240,248,.66); background: rgba(167,139,250,.06); border: 1px solid rgba(167,139,250,.18); }
.ac-info i { color: #a78bfa; margin-top: 3px; }

.ac-field { margin-bottom: 18px; }
.ac-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(240,240,248,.55); margin-bottom: 8px; }
.ac-label small { text-transform: none; letter-spacing: 0; font-size: .68rem; color: rgba(240,240,248,.34); text-align: right; }
.ac-control { position: relative; }
.ac-control > i.lead { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: rgba(240,240,248,.35); font-size: .95rem; pointer-events: none; transition: color .2s; }
.ac-control input[type=text], .ac-control input[type=email], .ac-control input[type=password] {
    width: 100%; height: 52px; box-sizing: border-box; padding: 0 46px 0 46px;
    background: rgba(0,0,0,.45); color: #f0f0f8; border: 1px solid rgba(139,92,246,.18); border-radius: 14px;
    font-family: 'JetBrains Mono', monospace; font-size: .92rem; outline: none; transition: border-color .25s, box-shadow .25s;
}
.ac-control input::placeholder { color: rgba(240,240,248,.24); }
.ac-control input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.12), 0 0 18px rgba(167,139,250,.18); }
.ac-control:focus-within > i.lead { color: #a78bfa; }
.ac-control .state { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
.ac-control.valid .state { opacity: 1; color: #34d399; }
.ac-control.invalid .state { opacity: 1; color: #ff4466; }
.ac-control.invalid input { border-color: rgba(255,68,102,.55); }
.ac-control .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: rgba(240,240,248,.45); cursor: pointer; transition: color .2s, background .2s; }
.ac-control .eye:hover, .ac-control .eye:focus-visible { color: #c4b5fd; background: rgba(167,139,250,.1); outline: none; }
.ac-hint { min-height: 1.1em; margin-top: 6px; font-size: .72rem; color: rgba(240,240,248,.4); line-height: 1.4; }
.ac-hint.warn { color: #fbbf24; }
.ac-hint.bad { color: #ff6b81; }

/* Password strength */
.ac-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.ac-meter span { height: 4px; border-radius: 4px; background: rgba(167,139,250,.14); transition: background .25s; }
.ac-meter[data-level="1"] span:nth-child(1) { background: #ff4466; }
.ac-meter[data-level="2"] span:nth-child(-n+2) { background: #fb923c; }
.ac-meter[data-level="3"] span:nth-child(-n+3) { background: #fbbf24; }
.ac-meter[data-level="4"] span { background: #34d399; }

.ac-btn {
    width: 100%; height: 54px; margin-top: 6px; border: 0; border-radius: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
    color: #0f0c29; background: linear-gradient(135deg, #e9d5ff, #c4b5fd);
    box-shadow: 0 8px 28px rgba(124,58,237,.28); transition: transform .2s, box-shadow .2s, opacity .2s;
}
.ac-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(124,58,237,.42); }
.ac-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ac-btn:disabled { opacity: .5; cursor: not-allowed; }
.ac-btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(15,12,41,.25); border-top-color: #0f0c29; border-radius: 50%; animation: acSpin .7s linear infinite; }
.ac-btn.loading .spin { display: inline-block; }
.ac-btn.loading .arrow { display: none; }
@keyframes acSpin { to { transform: rotate(360deg); } }

.ac-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(167,139,250,.12); font-size: .82rem; }
.ac-links a { color: rgba(240,240,248,.62); text-decoration: none; transition: color .2s; }
.ac-links a:hover { color: #c4b5fd; }
.ac-links.center { justify-content: center; }

.ac-secure { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(240,240,248,.32); }
.ac-secure i { color: #34d399; }

/* Terms accordion (register) */
.ac-terms { margin: 24px 0 4px; }
.ac-terms-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; cursor: pointer; text-align: left; color: #f0f0f8; font: inherit; font-size: .85rem; font-weight: 500; background: rgba(255,255,255,.03); border: 1px solid rgba(167,139,250,.16); transition: border-color .2s; }
.ac-terms-head:hover { border-color: rgba(167,139,250,.4); }
.ac-terms-head .left { display: flex; align-items: center; gap: 10px; }
.ac-terms-head .left i { color: #a78bfa; }
.ac-terms-head .right { display: flex; align-items: center; gap: 12px; }
.ac-terms-status { font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .08em; font-weight: 600; color: rgba(240,240,248,.4); }
.ac-terms-status.read { color: #c4b5fd; }
.ac-terms-status.ok { color: #34d399; }
.ac-terms-head .chev { transition: transform .3s; color: rgba(240,240,248,.4); }
.ac-terms-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ac-terms-box { max-height: 0; overflow: hidden; transition: max-height .4s ease; border-radius: 14px; background: rgba(0,0,0,.28); }
.ac-terms-box.open { max-height: 300px; margin-top: 10px; border: 1px solid rgba(167,139,250,.14); }
.ac-terms-scroll { max-height: 280px; overflow-y: auto; padding: 18px; font-size: .82rem; line-height: 1.7; color: rgba(240,240,248,.7); }
.ac-terms-scroll p { margin: 0 0 12px; }
.ac-terms-end { text-align: center; padding-top: 14px; margin-top: 16px; border-top: 1px dashed rgba(240,240,248,.18); font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .1em; color: #c4b5fd; }
.ac-progress { height: 3px; margin-top: 10px; border-radius: 3px; background: rgba(167,139,250,.12); overflow: hidden; }
.ac-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c3aed, #c4b5fd); transition: width .15s; }
.ac-check { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 0 2px; }
.ac-check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: #a78bfa; cursor: pointer; }
.ac-check input:disabled { cursor: not-allowed; }
.ac-check label { font-size: .84rem; line-height: 1.5; color: rgba(240,240,248,.4); cursor: not-allowed; }
.ac-check.ready label { color: rgba(240,240,248,.85); cursor: pointer; }

/* Success */
.ac-done { text-align: center; padding: 6px 0 2px; }
.ac-done .badge { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; color: #34d399; background: radial-gradient(circle at 30% 30%, rgba(52,211,153,.22), rgba(52,211,153,.04)); border: 1px solid rgba(52,211,153,.45); box-shadow: 0 0 28px rgba(52,211,153,.25); }
.ac-done h2 { margin: 0 0 10px; font-family: 'Syne', sans-serif; font-size: 1.4rem; color: #fff; }
.ac-done p { margin: 0 0 22px; font-size: .9rem; line-height: 1.65; color: rgba(240,240,248,.68); }
.ac-done .timeline { list-style: none; margin: 0 0 24px; padding: 0; text-align: left; display: grid; gap: 10px; }
.ac-done .timeline li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .8rem; line-height: 1.5; color: rgba(240,240,248,.68); background: rgba(255,255,255,.025); border: 1px solid rgba(167,139,250,.12); }
.ac-done .timeline li i { color: #a78bfa; margin-top: 3px; width: 16px; text-align: center; }
.ac-done a.ac-btn { text-decoration: none; }

@media (max-width: 480px) {
    .ac-label { flex-direction: column; gap: 2px; }
    .ac-label small { text-align: left; }
    .ac-links { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .ac-btn, .ac-terms-box, .ac-meter span { transition: none; }
}

/* ── Verification flows (OTP / TOTP / Passkey / legal) ───────────────────── */
.ac-otp { display: flex; justify-content: center; gap: 10px; margin: 6px 0 22px; }
.ac-otp input {
    width: 54px; height: 64px; box-sizing: border-box; text-align: center; padding: 0;
    font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; font-weight: 600; color: #fff;
    background: rgba(0,0,0,.45); border: 1px solid rgba(139,92,246,.22); border-radius: 14px; outline: none;
    caret-color: #a78bfa; transition: border-color .2s, box-shadow .2s, transform .15s;
}
.ac-otp input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.14), 0 0 18px rgba(167,139,250,.2); transform: translateY(-2px); }
.ac-otp input.filled { border-color: rgba(196,181,253,.6); background: rgba(124,58,237,.12); }
.ac-otp.shake { animation: acShake .35s; }
@keyframes acShake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.ac-otp.six input { width: 46px; height: 58px; font-size: 1.4rem; }
@media (max-width: 400px) { .ac-otp { gap: 6px; } .ac-otp input { width: 46px; height: 58px; } .ac-otp.six input { width: 40px; height: 52px; font-size: 1.2rem; } }

.ac-panel { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; margin-bottom: 14px; border-radius: 14px; font-size: .8rem; line-height: 1.55; color: rgba(240,240,248,.68); background: rgba(255,255,255,.025); border: 1px solid rgba(167,139,250,.14); }
.ac-panel > i { color: #a78bfa; margin-top: 3px; }
.ac-panel strong { color: #fff; }
.ac-panel.warn { background: rgba(251,191,36,.05); border-color: rgba(251,191,36,.2); }
.ac-panel.warn > i { color: #fbbf24; }
.ac-panel.danger { background: rgba(255,68,102,.06); border-color: rgba(255,68,102,.25); }
.ac-panel.danger > i { color: #ff6b81; }
.ac-alert.ok { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.3); color: #6ee7b7; }

.ac-btn-ghost {
    width: 100%; height: 46px; margin-top: 12px; border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: .74rem; letter-spacing: .04em; color: rgba(240,240,248,.65);
    background: transparent; border: 1px solid rgba(167,139,250,.2); transition: border-color .2s, color .2s, background .2s;
}
.ac-btn-ghost:hover:not(:disabled) { border-color: rgba(167,139,250,.55); color: #fff; background: rgba(167,139,250,.07); }
.ac-btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.ac-btn-link { background: none; border: 0; padding: 0; font: inherit; font-size: .82rem; color: rgba(240,240,248,.6); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.ac-btn-link:hover { color: #c4b5fd; }
.ac-center { text-align: center; }
.ac-btn.as-link { text-decoration: none; }

/* Countdown ring (code lifetime) */
.ac-timer { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -6px 0 16px; font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: rgba(240,240,248,.5); }
.ac-timer b { color: #c4b5fd; font-weight: 600; }
.ac-timer.low b { color: #fbbf24; }

/* Passkey orb */
.ac-orb {
    position: relative; width: 112px; height: 112px; margin: 6px auto 18px; border-radius: 50%; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: #c4b5fd;
    background: radial-gradient(circle at 30% 30%, rgba(167,139,250,.28), rgba(124,58,237,.07));
    box-shadow: 0 0 0 1px rgba(167,139,250,.35), 0 0 34px rgba(124,58,237,.3);
    transition: transform .2s, box-shadow .2s, color .2s;
}
.ac-orb:hover { transform: scale(1.04); }
.ac-orb:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.ac-orb::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1px solid rgba(167,139,250,.28); animation: acPing 2.4s ease-out infinite; }
.ac-orb.busy::after { animation-duration: 1.1s; }
.ac-orb.ok { color: #34d399; box-shadow: 0 0 0 1px rgba(52,211,153,.5), 0 0 34px rgba(52,211,153,.35); }
.ac-orb.ok::after { border-color: rgba(52,211,153,.4); animation: none; }
.ac-orb.err { color: #ff6b81; box-shadow: 0 0 0 1px rgba(255,68,102,.45), 0 0 30px rgba(255,68,102,.25); }
@keyframes acPing { 0% { transform: scale(.92); opacity: .8; } 100% { transform: scale(1.22); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ac-orb::after { animation: none; } .ac-otp.shake { animation: none; } }
.ac-status { text-align: center; min-height: 1.4em; margin: 0 0 18px; font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: rgba(240,240,248,.55); line-height: 1.5; }
.ac-status.err { color: #ff8da0; }
.ac-status.ok { color: #6ee7b7; }

/* Standalone state pages (timeout / locked) */
.ac-state { text-align: center; }
.ac-state .badge { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.ac-state .badge.warn { color: #fbbf24; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.4); box-shadow: 0 0 26px rgba(251,191,36,.18); }
.ac-state .badge.danger { color: #ff6b81; background: rgba(255,68,102,.08); border: 1px solid rgba(255,68,102,.4); box-shadow: 0 0 26px rgba(255,68,102,.2); }
.ac-state h1 { margin: 0 0 10px; font-family: 'Syne', sans-serif; font-size: 1.5rem; letter-spacing: .05em; color: #fff; }
.ac-state p { margin: 0 0 24px; font-size: .88rem; line-height: 1.65; color: rgba(240,240,248,.66); }

/* Legal page */
.ac-card.legal { max-width: 700px; }
.ac-legal { max-height: 46vh; overflow-y: auto; padding: 4px 6px 4px 2px; margin-bottom: 22px; font-size: .88rem; line-height: 1.7; color: rgba(240,240,248,.74); scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.35) transparent; }
.ac-legal p { margin: 0 0 14px; }
.ac-legal .ac-panel { margin-top: 18px; }

/* Passkey notice overlay */
.ac-overlay { position: fixed; inset: 0; z-index: 9998; display: none; align-items: flex-start; justify-content: center; padding: 6vh 18px; overflow-y: auto; background: rgba(8,6,28,.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.ac-overlay.show { display: flex; }
.ac-overlay .ac-card { margin: 0 auto auto; }
