:root {
    --bg: #f0f2f5;
    --card: #fff;
    --text: #1d2327;
    --muted: #646970;
    --line: #c3c4c7;
    --accent: #2271b1;
    --accent-text: #fff;
    --error: #b32d2e;
    --error-bg: #fcf0f1;
    --success: #1a7f37;
    --success-bg: #edfaef;
    --info-bg: #eaf2fa;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121417;
        --card: #1d2125;
        --text: #e6e8ea;
        --muted: #9aa0a6;
        --line: #3c434a;
        --accent: #4f94d4;
        --accent-text: #0b0f13;
        --error: #f28b82;
        --error-bg: #3a2022;
        --success: #81c995;
        --success-bg: #1d3325;
        --info-bg: #1c2b3a;
    }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.card {
    width: 100%;
    max-width: 360px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px 24px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.brand { text-align: center; margin-bottom: 20px; }
.brand img { border-radius: 8px; margin-bottom: 8px; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 600; }
form[hidden], [data-view][hidden], .msg[hidden] { display: none; }
label { display: block; margin-bottom: 14px; font-weight: 500; }
label.check { font-weight: 400; display: flex; align-items: center; gap: 8px; }
input[type=text], input[type=password] {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 11px;
    font: inherit;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.pwd { position: relative; display: block; }
.pwd input { padding-right: 42px; }
.toggle {
    position: absolute; right: 2px; top: 6px;
    width: 38px; height: 34px;
    background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--muted);
}
.code { letter-spacing: .4em; text-align: center; font-size: 22px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.primary {
    width: 100%;
    padding: 10px;
    font: inherit;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}
.primary:disabled { opacity: .6; cursor: wait; }
.links, .back { text-align: center; margin: 16px 0 0; font-size: 13px; }
.back { border-top: 1px solid var(--line); padding-top: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a[aria-disabled=true] { color: var(--muted); pointer-events: none; }
.hint { color: var(--muted); margin: 0 0 14px; }
.msg { padding: 10px 12px; margin-bottom: 16px; border-radius: 4px; border-left: 4px solid; font-size: 14px; }
.msg.error { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.msg.success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.msg.info { background: var(--info-bg); border-color: var(--accent); }
.meter { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; font-size: 12px; color: var(--muted); }
.meter span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.meter[data-score="1"] span { background: linear-gradient(90deg, var(--error) 33%, var(--line) 33%); }
.meter[data-score="2"] span { background: linear-gradient(90deg, #dba617 66%, var(--line) 66%); }
.meter[data-score="3"] span { background: var(--success); }
.shake { animation: shake .4s; }
@keyframes shake {
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
body.interim-login { align-items: flex-start; padding: 8px; }
body.interim-login .card { border: 0; box-shadow: none; padding: 8px 4px; background: transparent; }
body.interim-login .brand { display: none; }
body.interim-login html, html:has(body.interim-login) { background: transparent; }
body.interim-login { background: transparent; }
