:root {
    color-scheme: dark;
    --ink: #f7f0dc;
    --muted: #b9b29e;
    --gold: #d8b66c;
    --gold-light: #f0d99e;
    --red: #761d19;
    --panel: rgba(28, 28, 23, .94);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(ellipse at 50% 12%, rgba(112, 76, 31, .38), transparent 45%),
        radial-gradient(ellipse at 50% 100%, rgba(108, 32, 25, .19), transparent 48%),
        #171714;
}
.auth-page { display: grid; place-items: center; padding: 36px 18px; }
.auth-shell {
    width: min(100%, 440px);
    padding: 34px clamp(24px, 7vw, 48px) 28px;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(145deg, rgba(39, 39, 31, .98), var(--panel) 58%, rgba(32, 27, 23, .98));
    border: 1px solid rgba(216, 182, 108, .68);
    border-radius: 13px;
    box-shadow: 0 24px 80px #0009, inset 0 0 0 5px rgba(216, 182, 108, .055), 0 0 36px #b7812520;
}
.auth-shell::before, .auth-shell::after { content: ""; position: absolute; width: 34px; height: 34px; border-color: var(--gold); opacity: .72; }
.auth-shell::before { top: 10px; right: 10px; border-top: 1px solid; border-right: 1px solid; }
.auth-shell::after { bottom: 10px; left: 10px; border-bottom: 1px solid; border-left: 1px solid; }
.brand-mark {
    width: 64px; height: 64px; margin: 0 auto 13px; display: grid; place-items: center;
    border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light);
    background: radial-gradient(circle, #503d1d, #201e18 68%);
    box-shadow: 0 0 0 5px #d8b66c12, inset 0 0 0 3px #d8b66c20;
}
.brand-mark span { font-size: 34px; line-height: 1; font-weight: 800; }
.eyebrow { margin: 0 0 3px; color: var(--gold); font-size: 14px; }
h1 { margin: 0; color: #fff8e7; font-size: clamp(27px, 7vw, 34px); font-weight: 700; }
.intro { margin: 4px 0 23px; color: var(--muted); font-size: 15px; }
.auth-form { display: grid; gap: 9px; text-align: start; }
.auth-form label { margin-top: 5px; color: #e5d5ad; font-size: 14px; }
.auth-form input {
    width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #66583a;
    border-radius: 6px; outline: none; background: #121310; color: var(--ink); font: inherit; direction: ltr; text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d8b66c24; }
.password-field { position: relative; }
.password-field input { padding-left: 65px; }
.reveal { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--gold); cursor: pointer; font: inherit; font-size: 12px; }
.field-help { color: var(--muted); font-size: 12px; margin-top: -5px; }
.primary-button {
    min-height: 49px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px;
    border: 1px solid #d3ad61; border-radius: 6px; color: #fff5dc; cursor: pointer;
    background: linear-gradient(#902b22, #641914); box-shadow: inset 0 1px #ffffff29, 0 5px 15px #0004;
    font: inherit; font-size: 17px; font-weight: 700; transition: filter .16s ease, transform .16s ease;
}
.primary-button:hover { filter: brightness(1.15); }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible, a:focus-visible, .reveal:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.notice { margin: 0 0 16px; padding: 8px 12px; border-radius: 6px; text-align: start; font-size: 14px; }
.notice p { margin: 2px 0; }
.notice.error { border: 1px solid #a9493e; background: #5e201e55; color: #ffd5c9; }
.notice.success { border: 1px solid #71915a; background: #34492755; color: #e4f0c8; }
.auth-switch { margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--gold-light); text-decoration-color: #d8b66c70; text-underline-offset: 4px; font-weight: 700; }
.auth-footnote { margin: 19px 0 0; padding-top: 14px; border-top: 1px solid #ffffff12; color: #898474; font-size: 12px; }
@media (max-width: 480px) { .auth-page { padding: 16px 12px; } .auth-shell { padding-top: 27px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
