:root {
    --bg: #080808;
    --surface: #11100c;
    --surface-2: #191711;
    --surface-3: #211e16;
    --text: #f8f3e5;
    --muted: #b8af9b;
    --line: #403921;
    --border: var(--line);
    --accent: #ffca1a;
    --accent-bright: #ffd85c;
    --accent-dark: #3a2e00;
    --danger: #ff9a8f;
    --danger-surface: #321b18;
    --radius: 20px;
    color-scheme: dark;
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% -10%, rgba(255, 202, 26, .16), transparent 34%),
        radial-gradient(circle at 100% 18%, rgba(255, 202, 26, .07), transparent 28%),
        var(--bg);
    color: var(--text);
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: linear-gradient(rgba(255, 202, 26, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 202, 26, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    content: "";
    mask-image: radial-gradient(circle at 50% 0, black, transparent 72%);
    pointer-events: none;
}

a { color: var(--accent); text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    padding: 14px clamp(20px, 5vw, 70px);
    border-bottom: 1px solid rgba(255, 202, 26, .18);
    background: rgba(0, 0, 0, .82);
    backdrop-filter: blur(16px);
}

.brand { display: flex; gap: 12px; align-items: center; color: var(--text); }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-logo {
    display: block;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 202, 26, .34);
    border-radius: 13px;
    box-shadow: 0 0 0 4px rgba(255, 202, 26, .05), 0 9px 24px rgba(0, 0, 0, .35);
}
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }

nav { display: flex; align-items: center; gap: 18px; }
nav a:not(.nav-cta) { color: var(--muted); }
nav a:not(.nav-cta):hover { color: var(--accent); }
.nav-cta {
    padding: 10px 15px;
    border: 1px solid var(--accent);
    border-radius: 11px;
    background: var(--accent);
    color: #090800;
    font-weight: 800;
}
.nav-cta:hover { color: #090800; text-decoration: none; filter: brightness(1.08); }

.page-shell { width: min(1080px, calc(100% - 32px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 68px 0; }
.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
    gap: clamp(34px, 7vw, 96px);
    align-items: center;
}
.hero { position: relative; padding: 20px 0; }
.hero::after {
    position: absolute;
    right: -22px;
    bottom: -18px;
    width: 84px;
    height: 84px;
    border: 1px solid rgba(255, 202, 26, .18);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}
.hero h1 { max-width: 680px; margin: 18px 0 20px; font-size: clamp(38px, 7vw, 78px); line-height: 1.08; letter-spacing: -.04em; }
.hero p { max-width: 610px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.95; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { width: 26px; height: 2px; background: var(--accent); content: ""; }

.card {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(29, 27, 19, .97), rgba(13, 13, 11, .97));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 202, 26, .025);
}
.card::before { position: absolute; top: 0; right: 28px; left: 28px; height: 2px; background: var(--accent); content: ""; opacity: .85; }
.card h1, .card h2 { margin-top: 0; }
.card h1 { margin-bottom: 12px; font-size: clamp(26px, 4vw, 36px); }
.card h2 { font-size: 24px; }
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
label { color: #e7dfcf; font-size: 14px; }
input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    background: #080807;
    color: var(--text);
    font: inherit;
    direction: rtl;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input[type=email], input[type=password] { direction: ltr; text-align: left; }
input:hover { border-color: #675a2c; }
input:focus { border-color: var(--accent); background: #0c0c0a; box-shadow: 0 0 0 3px rgba(255, 202, 26, .14); }
input:disabled { cursor: not-allowed; opacity: .7; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.checkbox input { width: 18px; margin-top: 4px; accent-color: var(--accent); }

button, .button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    border: 1px solid var(--accent);
    border-radius: 11px;
    background: var(--accent);
    color: #090800;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease, border-color .2s ease, background .2s ease;
}
button:hover, .button:hover { color: #090800; text-decoration: none; filter: brightness(1.08); transform: translateY(-1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
button.secondary, .button.secondary { border-color: var(--line); background: var(--surface-3); color: var(--text); }
button.secondary:hover, .button.secondary:hover { border-color: #76642d; color: var(--text); filter: none; }
button.danger { border-color: #70403a; background: var(--danger-surface); color: var(--danger); }
button.danger:hover { color: #ffb6ad; filter: brightness(1.1); }
.link-button { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--accent); font-weight: 400; }
.link-button:hover { color: var(--accent-bright); background: transparent; filter: none; transform: none; }
.inline-form { display: inline; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.providers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.provider { width: 100%; border-color: var(--line); background: var(--surface-3); color: var(--text); }
.provider:hover { color: var(--text); }

.validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary-errors, .field-validation-error { color: var(--danger); font-size: 13px; }
.validation-summary-errors ul { margin: 0; padding-right: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.8; }
.alert { margin-bottom: 22px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.alert.success { border-color: #806313; background: rgba(255, 202, 26, .08); color: var(--accent-bright); }

.narrow-card { max-width: 560px; margin: 0 auto; }
.auth-card { text-align: center; }
.auth-card form { margin-top: 24px; }
.auth-card .button-row { justify-content: center; }
.subform { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }

.settings-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; align-items: start; }
.settings-nav { position: sticky; top: 106px; display: grid; align-content: start; gap: 7px; }
.settings-nav a { padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); }
.settings-nav a:hover { border-color: var(--line); color: var(--accent); text-decoration: none; }
.settings-nav a.active { border-color: rgba(255, 202, 26, .22); color: var(--text); background: var(--surface-2); }
.setting-section { margin-bottom: 24px; }
.list { display: grid; gap: 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 8, 7, .7); }
.list-row strong, .list-row span { display: block; overflow-wrap: anywhere; }
.list-row small { display: block; margin-top: 5px; color: var(--muted); }
footer { padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
code { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 760px) {
    .site-header { align-items: flex-start; }
    nav { gap: 10px; font-size: 13px; }
    .auth-grid, .settings-grid { grid-template-columns: 1fr; }
    .hero { padding: 0 0 16px; text-align: center; }
    .hero p { margin-right: auto; margin-left: auto; }
    .hero::after { right: 4%; bottom: -10px; width: 60px; height: 60px; }
    .settings-nav { position: static; grid-template-columns: repeat(2, 1fr); }
    .list-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
    .site-header { padding-right: 16px; padding-left: 16px; }
    .brand small { display: none; }
    .page-shell { width: min(100% - 24px, 1080px); padding-top: 44px; }
    .nav-cta { padding: 9px 11px; }
    .providers { grid-template-columns: 1fr; }
}
