/* ================================================================
   AUTH & ACCOUNT PAGES — "Trading Desk Daylight" (Light Theme)
   مسیر: static/css/auth.css
   خودکفا — فقط به فونت Shabnam وابسته است.
   ================================================================ */

/* ---------- Shabnam Font ----------
   ⚠️ اگر فایل fonts.css قبلاً Shabnam را register کرده،
   این چهار بلاک را حذف کنید (duplicate بی‌ضرر است).
   نام فایل‌ها را با محتوای پوشه static/fonts/shabnam چک کنید. */
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/shabnam/Shabnam.woff2') format('woff2'),
         url('../fonts/shabnam/Shabnam.woff') format('woff'),
         url('../fonts/shabnam/Shabnam.ttf') format('truetype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/shabnam/Shabnam-Bold.woff2') format('woff2'),
         url('../fonts/shabnam/Shabnam-Bold.woff') format('woff'),
         url('../fonts/shabnam/Shabnam-Bold.ttf') format('truetype');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/shabnam/Shabnam-Medium.woff2') format('woff2'),
         url('../fonts/shabnam/Shabnam-Medium.woff') format('woff'),
         url('../fonts/shabnam/Shabnam-Medium.ttf') format('truetype');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/shabnam/Shabnam-Light.woff2') format('woff2'),
         url('../fonts/shabnam/Shabnam-Light.woff') format('woff'),
         url('../fonts/shabnam/Shabnam-Light.ttf') format('truetype');
    font-weight: 300; font-style: normal; font-display: swap;
}

/* ============ TOKENS ============ */
.au-scene {
    --au-blue: #2563EB;
    --au-blue-dark: #1D4ED8;
    --au-cyan: #0891B2;
    --au-cyan-strong: #0E7490;
    --au-green: #059669;
    --au-green-strong: #047857;
    --au-gold: #D97706;
    --au-gold-strong: #B45309;
    --au-red: #DC2626;
    --au-text: #0F172A;
    --au-text-2: #64748B;
    --au-muted: #94A3B8;
    --au-border: #E2E8F0;
    --au-border-soft: #EEF2F8;
    --au-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 28px -14px rgba(15,23,42,.10);
    --au-shadow-lift: 0 6px 14px rgba(15,23,42,.05), 0 26px 54px -22px rgba(37,99,235,.22);
}

/* ============ SCENE (پس‌زمینه صفحه) ============ */
.au-scene {
    position: relative;
    overflow: hidden;
    min-height: max(560px, calc(100vh - 260px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 6vh, 72px) 24px;
    font-family: 'Shabnam', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(120% 90% at 78% -12%, rgba(59,130,246,.10), transparent 55%),
        radial-gradient(90% 70% at 6% 112%, rgba(16,185,129,.08), transparent 60%),
        linear-gradient(180deg, #FFFFFF 0%, #F6F9FE 100%);
}
.au-grid-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(37,99,235,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 72%);
    animation: auGridMove 22s linear infinite;
}
@keyframes auGridMove { to { background-position: 0 48px, 48px 0; } }
.au-orb {
    position: absolute; border-radius: 50%; filter: blur(90px);
    opacity: .4; pointer-events: none; z-index: 0;
}
.au-orb-1 { width: 420px; height: 420px; background: #BAE6FD; top: -170px; inset-inline-start: -110px; animation: auFloat 13s ease-in-out infinite; }
.au-orb-2 { width: 340px; height: 340px; background: #A7F3D0; bottom: -140px; inset-inline-end: -90px; animation: auFloat 17s ease-in-out infinite reverse; }
@keyframes auFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }

/* ============ CARD ============ */
.au-card {
    position: relative; z-index: 2; width: 100%;
    background: #fff;
    border: 1px solid var(--au-border);
    border-radius: 24px;
    box-shadow: var(--au-shadow);
    overflow: hidden;
    animation: auCardIn .6s ease both;
}
@keyframes auCardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.au-card--split { max-width: 1000px; display: grid; grid-template-columns: 1fr 1.05fr; }
.au-card--center { max-width: 640px; }
.au-card--wide { max-width: 920px; }

/* ============ SIDE PANEL (پنل گرادیانی برند) ============ */
.au-side {
    position: relative; overflow: hidden; color: #fff;
    padding: 44px 40px;
    display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(70% 90% at 50% 115%, rgba(34,211,238,.28), transparent 60%),
        radial-gradient(50% 70% at 50% -20%, rgba(96,165,250,.25), transparent 60%),
        linear-gradient(135deg, #0F2A5E 0%, #1D4ED8 60%, #0E7490 130%);
}
.au-side::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 72%);
}
.au-side-candles {
    position: absolute; bottom: -4px; left: 0; right: 0; z-index: 1;
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 0 4%; height: 150px; opacity: .5; pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, black 15%, transparent 95%);
    mask-image: linear-gradient(to top, black 15%, transparent 95%);
}
.au-side-candles span {
    width: 10px; border-radius: 4px 4px 0 0; height: var(--h);
    transform-origin: bottom;
    animation: auCandleGrow .9s cubic-bezier(.34,1.56,.64,1) var(--d) both,
               auBob 6s ease-in-out calc(var(--d) + 1.2s) infinite;
}
.au-side-candles .up   { background: linear-gradient(180deg, #34D399, #059669); box-shadow: 0 0 14px rgba(52,211,153,.5); }
.au-side-candles .down { background: linear-gradient(180deg, #FB7185, #E11D48); box-shadow: 0 0 14px rgba(244,63,94,.45); }
@keyframes auCandleGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes auBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.au-side-body { position: relative; z-index: 2; }
.au-side-brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-weight: 700; font-size: 13.5px; letter-spacing: .02em;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
    padding: 7px 14px; border-radius: 999px; margin-bottom: 26px; width: fit-content;
}
.au-side-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.25; margin-bottom: 12px; }
.au-side-sub { color: rgba(255,255,255,.82); font-size: 14.5px; line-height: 1.75; max-width: 380px; }
.au-side-list { list-style: none; display: grid; gap: 12px; margin-top: 28px; }
.au-side-list li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: rgba(255,255,255,.9); }
.au-side-list li::before {
    content: "✓"; flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px;
    display: grid; place-items: center; background: rgba(255,255,255,.15);
    font-size: 12px; font-weight: 800;
}

/* ============ MAIN PANEL (فرم) ============ */
.au-main {
    padding: clamp(30px, 4.5vw, 48px);
    display: flex; flex-direction: column; justify-content: center;
    background: #fff;
}
.au-head { text-align: center; margin-bottom: 24px; }
.au-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 700; color: var(--au-text); }
.au-head p { color: var(--au-text-2); font-size: 14.5px; margin-top: 6px; }

/* ---------- Buttons ---------- */
.au-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 22px; border-radius: 12px;
    font-weight: 700; font-size: 15px; font-family: inherit;
    cursor: pointer; border: none; text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s, color .25s;
}
.au-btn--primary {
    background: linear-gradient(135deg, #0891B2, #2563EB); color: #fff;
    box-shadow: 0 10px 26px -8px rgba(37,99,235,.5);
}
.au-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(37,99,235,.6); }
.au-btn--success {
    background: linear-gradient(135deg, #10B981, #059669); color: #fff;
    box-shadow: 0 10px 26px -8px rgba(5,150,105,.45);
}
.au-btn--success:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(5,150,105,.55); }
.au-btn--danger-outline { background: #fff; border: 1px solid #FCA5A5; color: #DC2626; }
.au-btn--danger-outline:hover { background: #FEF2F2; transform: translateY(-1px); }
.au-btn--block { width: 100%; }
.au-btn--lg { padding: 15px 26px; font-size: 16px; }
.au-btn--sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.au-arrow { display: inline-block; transition: transform .25s; }
a:hover .au-arrow, button:hover .au-arrow { transform: translateX(4px); }
[dir="rtl"] .au-arrow { transform: scaleX(-1); }
[dir="rtl"] a:hover .au-arrow, [dir="rtl"] button:hover .au-arrow { transform: scaleX(-1) translateX(4px); }

/* ---------- Form fields ---------- */
.au-form { text-align: start; }
.au-field { margin-bottom: 16px; }
.au-field > label, .au-label-row > label, .au-form p > label {
    display: block; margin-bottom: 7px;
    font-weight: 600; font-size: 14px; color: var(--au-text);
}
.au-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.au-form input[type="text"]:not(.au-otp-box),
.au-form input[type="email"],
.au-form input[type="password"],
.au-form select,
.au-form textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid #CBD5E1; border-radius: 10px;
    font-size: 15px; font-family: inherit; color: var(--au-text);
    background: #fff; transition: border-color .2s, box-shadow .2s;
}
.au-form select { cursor: pointer; }
.au-form input:focus, .au-form select:focus, .au-form textarea:focus {
    outline: none; border-color: var(--au-blue);
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.au-form input:disabled { background: #F8FAFC; color: var(--au-muted); }
.au-form p { margin: 0 0 16px; }
.au-form ul.errorlist { list-style: none; color: #DC2626; font-size: 13px; margin: 6px 0 0; padding: 0; }
.au-form .helptext { display: block; font-size: 12px; color: var(--au-muted); margin-top: 6px; }
.au-error { color: #DC2626; font-size: 13px; margin-top: 6px; }
.au-hint { display: block; font-size: 12px; color: var(--au-muted); margin-top: 6px; }
.au-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Password toggle (JS auto-attaches) */
.au-pass-wrap { position: relative; }
.au-pass-wrap input[type="password"], .au-pass-wrap input[type="text"] { padding-inline-end: 46px; }
.au-pass-toggle {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 8px; opacity: .55; border-radius: 8px;
}
.au-pass-toggle:hover { opacity: 1; background: #F1F5F9; }

/* Checkbox */
.au-check {
    display: flex; align-items: center; gap: 9px;
    font-size: 14px; color: #475569; margin: 4px 0 18px; cursor: pointer;
    line-height: 1.6;
}
.au-check input { width: 17px; height: 17px; accent-color: var(--au-blue); cursor: pointer; flex-shrink: 0; }

/* Divider */
.au-divider { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--au-muted); font-size: 13px; }
.au-divider::before, .au-divider::after { content: ""; flex: 1; height: 1px; background: var(--au-border); }

/* Links / footer */
.au-link { color: var(--au-blue); text-decoration: none; font-size: 14px; font-weight: 600; }
.au-link:hover { text-decoration: underline; }
.au-link--green { color: var(--au-green); }
.au-foot { margin-top: 22px; text-align: center; font-size: 14px; color: var(--au-text-2); }
.au-foot p + p { margin-top: 8px; }

/* ---------- OTP ---------- */
.au-otp { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.au-otp-box {
    width: 48px; height: 56px; text-align: center;
    font-size: 22px; font-weight: 700; font-family: inherit;
    border: 1.5px solid #CBD5E1; border-radius: 10px; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.au-otp-box:focus { outline: none; border-color: var(--au-blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.au-code-sent {
    text-align: center; direction: ltr;
    background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8;
    padding: 11px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px;
}

/* ---------- Password strength ---------- */
.au-strength { margin-top: 10px; }
.au-strength-bar { height: 5px; background: #E2E8F0; border-radius: 99px; overflow: hidden; }
.au-strength-fill { height: 100%; width: 0; border-radius: 99px; background: #E2E8F0; transition: width .3s, background .3s; }
.au-strength-text { font-size: 12px; color: var(--au-muted); margin-top: 5px; min-height: 16px; }

/* ---------- Icon badge / avatar / empty ---------- */
.au-icon-badge {
    width: 64px; height: 64px; border-radius: 18px;
    display: grid; place-items: center; font-size: 28px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #EFF6FF, #ECFEFF);
    border: 1px solid #BFDBFE;
}
.au-avatar {
    width: 76px; height: 76px; border-radius: 50%;
    display: grid; place-items: center; margin: 0 auto 14px;
    font-size: 30px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #0891B2, #2563EB);
    box-shadow: 0 12px 28px -10px rgba(37,99,235,.5);
    direction: ltr;
}
.au-empty {
    text-align: center; padding: 44px 20px;
    color: var(--au-text-2); font-size: 14.5px;
    border: 1px dashed #CBD5E1; border-radius: 14px; background: #fff;
}

/* ---------- Sessions table ---------- */
.au-table-wrap { overflow-x: auto; border: 1px solid var(--au-border); border-radius: 14px; }
table.au-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.au-table th {
    background: #F8FAFC; padding: 12px 16px; text-align: start;
    font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
    color: var(--au-text-2); text-transform: uppercase;
    white-space: nowrap;
}
.au-table td { padding: 12px 16px; border-top: 1px solid var(--au-border-soft); vertical-align: middle; }
.au-table tbody tr:hover td { background: #FBFCFE; }
.au-dev { font-size: 18px; margin-inline-end: 6px; }
.au-ua { color: var(--au-text-2); font-size: 12.5px; }
.au-mono { font-variant-numeric: tabular-nums; direction: ltr; }
.au-badge {
    display: inline-block; padding: 4px 12px; border-radius: 99px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.au-badge--green { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.au-terminall { margin-top: 18px; }

/* ---------- Toggle switches (notification prefs) ---------- */
.au-switch {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; margin-bottom: 12px;
    background: #fff; border: 1px solid var(--au-border); border-radius: 14px;
    transition: border-color .25s;
}
.au-switch:hover { border-color: #93C5FD; }
.au-switch input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 44px; height: 24px; border-radius: 99px;
    background: #CBD5E1; position: relative; cursor: pointer;
    transition: background .25s; flex-shrink: 0; margin: 0;
}
.au-switch input[type="checkbox"]::after {
    content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.au-switch input[type="checkbox"]:checked { background: linear-gradient(135deg, #0891B2, #2563EB); }
.au-switch input[type="checkbox"]:checked::after { transform: translateX(20px); }
[dir="rtl"] .au-switch input[type="checkbox"]:checked::after { transform: translateX(-20px); }
.au-switch-label { font-size: 14.5px; font-weight: 600; color: var(--au-text); cursor: pointer; }

/* ---------- Settings nav cards ---------- */
.au-nav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.au-nav-card {
    display: flex; align-items: center; gap: 16px;
    padding: 22px; background: #fff;
    border: 1px solid var(--au-border); border-radius: 16px;
    text-decoration: none; box-shadow: var(--au-shadow);
    transition: transform .3s, border-color .3s, box-shadow .3s;
}
.au-nav-card:hover { transform: translateY(-3px); border-color: #93C5FD; box-shadow: var(--au-shadow-lift); }
.au-nav-card h3 { font-size: 15.5px; color: var(--au-text); margin-bottom: 3px; font-weight: 700; }
.au-nav-card p { font-size: 13px; color: var(--au-text-2); }
.au-nav-ico {
    width: 48px; height: 48px; border-radius: 13px;
    display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.au-nav-ico--blue  { background: #EFF6FF; border: 1px solid #BFDBFE; }
.au-nav-ico--gold  { background: #FFFBEB; border: 1px solid #FDE68A; }
.au-nav-ico--cyan  { background: #ECFEFF; border: 1px solid #A5F3FC; }
.au-nav-ico--green { background: #ECFDF5; border: 1px solid #A7F3D0; }
.au-nav-card .au-arrow { margin-inline-start: auto; color: var(--au-muted); }

/* ---------- Profile meta ---------- */
.au-profile-email { text-align: center; color: var(--au-text-2); font-size: 14px; direction: ltr; margin-bottom: 26px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .au-card--split { grid-template-columns: 1fr; max-width: 540px; }
    .au-side { padding: 30px 28px; min-height: 200px; }
    .au-side-candles { height: 90px; opacity: .4; }
    .au-side-list { display: none; }
    .au-side-sub { max-width: none; }
    .au-side-brand { margin-bottom: 16px; }
}
@media (max-width: 560px) {
    .au-otp-box { width: 40px; height: 50px; font-size: 19px; }
    .au-otp { gap: 7px; }
    .au-row-2 { grid-template-columns: 1fr; }
    .au-nav-grid { grid-template-columns: 1fr; }
    .au-scene { padding: 20px 14px; }
    .au-main { padding: 26px 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .au-scene *, .au-scene *::before, .au-scene *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}