:root {
    color-scheme: dark;
    --bg-app: #06061f;
    --bg-panel: #0f1038;
    --bg-field: #151641;
    --border: rgba(101, 108, 196, .28);
    --text-main: #f5f3ff;
    --text-sub: #b6b2d8;
    --text-dim: #8581ad;
    --accent: #ff6200;
    --accent-hover: #ed5b00;
    --accent-text: #ff8c42;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[data-theme="light"] {
    color-scheme: light;
    --bg-app: #f6f7fb;
    --bg-panel: #fff;
    --bg-field: #fff;
    --border: #e4e7f0;
    --text-main: #161c33;
    --text-sub: #4a5168;
    --text-dim: #565d75;
    --accent: #ff6200;          /* CTA / logo fill only */
    --accent-hover: #ef5c00;
    --accent-text: #4c5fd7;     /* links: indigo, never orange text */
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg-app); color: var(--text-main); }
.auth-page { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.auth-header { width: 100%; padding: 22px clamp(20px, 3vw, 48px); border-bottom: 1px solid var(--border); }
.brand { width: fit-content; display: inline-flex; align-items: center; gap: 11px; color: var(--text-main); text-decoration: none; }
.brand-logo { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); }
.brand-logo svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.brand-logo rect { fill: #fff; stroke: none; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-family: Outfit, Inter, sans-serif; font-size: 17px; font-weight: 700; line-height: 1.1; }
.brand-copy span { color: var(--text-sub); font-size: 12px; line-height: 1.2; }
.auth-main { display: flex; justify-content: center; align-items: flex-start; padding: clamp(42px, 9vh, 104px) 20px 48px; }
.auth-card { width: min(100%, 440px); padding: clamp(26px, 4vw, 38px); border: 1px solid var(--border); border-radius: 16px; background: var(--bg-panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .18); }
.auth-card h1 { margin: 0; font-family: Outfit, Inter, sans-serif; font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
.auth-lead { margin: 9px 0 28px; color: var(--text-sub); font-size: 14px; line-height: 1.5; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; color: var(--text-main); font-size: 13px; font-weight: 600; }
.field input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-field); color: var(--text-main); font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--text-dim); opacity: 1; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 98, 0, .15); }
.field small { display: block; margin-top: 7px; color: var(--text-dim); font-size: 11px; line-height: 1.4; }
.submit { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.submit:hover { background: var(--accent-hover); }
.submit span { font-size: 21px; line-height: 1; }
.resend-button { display: block; margin: 18px auto 0; padding: 2px 4px; border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.resend-button:hover, .auth-links a:hover { text-decoration: underline; }
.auth-links { display: flex; justify-content: center; gap: 30px; margin-top: 26px; padding-top: 19px; border-top: 1px solid var(--border); }
.auth-links a { color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: none; }
.brand:focus-visible, .submit:focus-visible, .resend-button:focus-visible, .auth-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message { margin: 0 0 22px; padding: 11px 13px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.error { border: 1px solid rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .13); color: #ffb4b4; }
.notice { border: 1px solid rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .11); color: #a8e9bd; }
html[data-theme="light"] .error { border-color: #f3c9c9; background: #fbe9e9; color: #8c2020; }
html[data-theme="light"] .notice { border-color: #bfe6da; background: #e4f5f0; color: #0f7a66; }
html[data-theme="light"] .auth-header { background: #edf0f8; border-bottom-color: #dce1f2; }
html[data-theme="light"] .auth-card { box-shadow: 0 1px 2px rgba(22, 28, 51, .04), 0 4px 16px -4px rgba(22, 28, 51, .06); }
html[data-theme="light"] .auth-card h1 { color: #20285a; }
html[data-theme="light"] .field input { border-color: #d3d8e8; }
html[data-theme="light"] .field input:focus { border-color: #4c5fd7; box-shadow: 0 0 0 3px rgba(76, 95, 215, .15); }
html[data-theme="light"] .submit { background: linear-gradient(135deg, #ff6200 0%, #ff7b00 100%); box-shadow: 0 6px 16px rgba(255, 98, 0, .28); }
html[data-theme="light"] .submit:hover { filter: brightness(1.04); }
html[data-theme="light"] :is(.brand, .submit, .resend-button, .auth-links a):focus-visible { outline-color: #4c5fd7; }
@media (max-width: 600px) {
    .auth-header { padding: 17px 20px; }
    .brand-copy strong { font-size: 15px; }
    .brand-copy span { font-size: 11px; }
    .brand-logo { width: 34px; height: 34px; }
    .auth-main { padding: 28px 14px 36px; }
    .auth-card { padding: 26px 22px; }
    .auth-card h1 { font-size: 31px; }
}
