/* ============================================================
   Kottab Auth — fully self-contained (no external variables)
   ============================================================ */

@font-face {
    font-family: "Avenir Arabic";
    src: url("../fonts/AvenirRegular.77ce85fec67e.ttf") format("truetype");
    font-weight: 400;
}
@font-face {
    font-family: "DG Heaven";
    src: url("../fonts/ArbFONTS-DG-Heaven-Bold.f3e2c1fed3fd.ttf") format("truetype");
    font-weight: 800;
}

/* ---------- Tokens (light) ---------- */
:root {
    --a-bg:          #F6F2EC;
    --a-card:        #ffffff;
    --a-panel:       #F3EAD7;
    --a-border:      #e5e7eb;
    --a-text:        #141414;
    --a-muted:       #6b7280;
    --a-label:       #3a3a3a;
    --a-input-bg:    #ffffff;
    --a-input-bd:    #e5e7eb;
    --a-header-bg:   #ffffff;
    --a-header-bd:   #e5e7eb;
    --a-footer-bg:   #1f1f1f;
    --a-footer-txt:  #d7d7d7;
    --a-shadow:      0 18px 40px rgba(15,23,42,.13);
    --a-grad:        linear-gradient(90deg,#FFB400 0%,#E30613 100%);
    --a-accent:      #E30613;
    --a-focus-ring:  rgba(255,180,0,.18);
    --a-err-bg:      #fff2f2;
    --a-err-txt:     #c0392b;
    --a-err-bd:      #f5c6c6;
    --a-ok-bg:       #f0fdf4;
    --a-ok-txt:      #166534;
    --a-ok-bd:       #bbf7d0;
}

/* ---------- Tokens (dark) ---------- */
[data-theme="dark"] {
    --a-bg:          #0f0f0f;
    --a-card:        #1a1a1a;
    --a-panel:       #1f1b13;
    --a-border:      #2e2e2e;
    --a-text:        #f0ece4;
    --a-muted:       #9ca3af;
    --a-label:       #d1cdc6;
    --a-input-bg:    #242424;
    --a-input-bd:    #3a3a3a;
    --a-header-bg:   #141414;
    --a-header-bd:   #2a2a2a;
    --a-footer-bg:   #0a0a0a;
    --a-footer-txt:  #9ca3af;
    --a-shadow:      0 18px 40px rgba(0,0,0,.45);
    --a-err-bg:      #2d1111;
    --a-err-txt:     #f87171;
    --a-err-bd:      #7f1d1d;
    --a-ok-bg:       #052e16;
    --a-ok-txt:      #86efac;
    --a-ok-bd:       #14532d;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Base ---------- */
.auth-page {
    min-height: 100vh;
    background: var(--a-bg);
    font-family: "Avenir Arabic", system-ui, sans-serif;
    color: var(--a-text);
    display: flex;
    flex-direction: column;
    transition: background .3s, color .3s;
}

/* ---------- Header ---------- */
.auth-header {
    background: var(--a-header-bg);
    border-bottom: 1px solid var(--a-header-bd);
    padding: 0 28px;
    height: 64px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    transition: background .3s, border-color .3s;
}

.auth-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--a-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    min-width: 80px;
    transition: color .2s;
}
.auth-back-link:hover { color: var(--a-text); }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: "DG Heaven", sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--a-text);
}
.auth-brand img {
    height:     34px;
    filter:     none;
}
.auth-brand .logo-dark  { display: none; }
[data-theme="dark"] .auth-brand .logo-light { display: none; }
[data-theme="dark"] .auth-brand .logo-dark  { display: block; }

.auth-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 80px;
    justify-content: flex-end;
}

/* Dark mode toggle */
.dark-toggle {
    background: none;
    border: 1.5px solid var(--a-border);
    border-radius: 999px;
    width: 40px;
    height: 24px;
    cursor: pointer;
    position: relative;
    transition: border-color .3s, background .3s;
    flex-shrink: 0;
}
.dark-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--a-muted);
    transition: transform .3s, background .3s;
}
[data-theme="dark"] .dark-toggle::after {
    transform: translateX(16px);
    background: #FFB400;
}

/* ---------- Main ---------- */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ---------- Split card (signup) ---------- */
.auth-split-card {
    display: flex;
    width: 100%;
    max-width: 960px;
    background: var(--a-card);
    border-radius: 20px;
    box-shadow: var(--a-shadow);
    overflow: hidden;
    min-height: 580px;
    transition: background .3s, box-shadow .3s;
}

/* Left decorative panel */
.auth-left-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--a-panel);
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: background .3s;
}
.auth-left-panel::before {
    content: '';
    position: absolute;
    top: -70px; right: -70px;
    width: 220px; height: 220px;
    background: var(--a-grad);
    border-radius: 50%;
    opacity: .12;
    pointer-events: none;
}
.auth-left-panel::after {
    content: '';
    position: absolute;
    bottom: -50px; left: -50px;
    width: 160px; height: 160px;
    background: var(--a-grad);
    border-radius: 50%;
    opacity: .08;
    pointer-events: none;
}

.auth-left-content { position: relative; z-index: 1; }

.auth-left-badge {
    display: inline-block;
    background: var(--a-grad);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 22px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.auth-left-title {
    font-family: "DG Heaven", sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--a-text);
    margin-bottom: 12px;
}

.auth-left-sub {
    font-size: 13px;
    color: var(--a-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.auth-features { display: flex; flex-direction: column; gap: 14px; }

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--a-text);
}

.auth-feature-icon {
    width: 34px; height: 34px;
    background: var(--a-card);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    flex-shrink: 0;
    transition: background .3s;
}

.auth-panel-logo {
    position: absolute;
    bottom: 28px; right: 28px;
    height: 48px;
    opacity: .2;
}

/* Right form panel */
.auth-right-panel {
    flex: 1;
    padding: 48px 52px;
    display: flex;
    align-items: center;
    overflow-y: auto;
}

.auth-form-wrap { width: 100%; }

/* ---------- OTP centered card ---------- */
.auth-otp-card {
    background: var(--a-card);
    border-radius: 20px;
    box-shadow: var(--a-shadow);
    padding: 56px 48px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    transition: background .3s;
}

.auth-otp-icon { font-size: 52px; margin-bottom: 18px; }

/* ---------- Form typography ---------- */
.auth-form-title {
    font-family: "DG Heaven", sans-serif;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--a-text);
}

.auth-form-sub {
    font-size: 14px;
    color: var(--a-muted);
    margin-bottom: 28px;
}
.auth-form-sub a { color: var(--a-accent); font-weight: 700; text-decoration: none; }
.auth-form-sub a:hover { text-decoration: underline; }

/* ---------- Fields ---------- */
.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.auth-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--a-label);
    margin-bottom: 7px;
    letter-spacing: .2px;
    text-transform: uppercase;
}

.auth-field input,
.auth-page input[type="text"],
.auth-page input[type="email"],
.auth-page input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--a-input-bd);
    border-radius: 9px;
    font-size: 14px;
    font-family: "Avenir Arabic", system-ui, sans-serif;
    background: var(--a-input-bg);
    color: var(--a-text);
    transition: border-color .2s, box-shadow .2s, background .3s;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-appearance: none;
}
.auth-field input::placeholder,
.auth-page input::placeholder { color: var(--a-muted); }

.auth-field input:focus,
.auth-page input[type="text"]:focus,
.auth-page input[type="email"]:focus,
.auth-page input[type="password"]:focus {
    outline: none;
    border-color: #FFB400;
    box-shadow: 0 0 0 3px var(--a-focus-ring);
}

/* OTP input */
.auth-otp-card input[type="text"] {
    text-align: center;
    font-size: 24px;
    letter-spacing: 10px;
    font-weight: 700;
    height: 60px;
}

/* ---------- Primary button ---------- */
.auth-btn-primary {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 9px;
    background: var(--a-grad);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: "Avenir Arabic", system-ui, sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .2s, transform .15s;
    letter-spacing: .3px;
}
.auth-btn-primary:hover  { opacity: .9; transform: translateY(-1px); }
.auth-btn-primary:active { transform: translateY(0); opacity: 1; }

/* ---------- Alerts ---------- */
.auth-alert {
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: start;
}
.auth-alert-error, .auth-alert-warning {
    background: var(--a-err-bg);
    color: var(--a-err-txt);
    border: 1px solid var(--a-err-bd);
}
.auth-alert-success {
    background: var(--a-ok-bg);
    color: var(--a-ok-txt);
    border: 1px solid var(--a-ok-bd);
}

.auth-error {
    font-size: 12px;
    color: var(--a-accent);
    margin-top: 5px;
    font-weight: 600;
}

/* ---------- OTP extras ---------- */
.auth-attempts-left {
    font-size: 12px;
    color: var(--a-muted);
    text-align: center;
    margin-bottom: 14px;
}

.auth-resend {
    margin-top: 24px;
    font-size: 13px;
    color: var(--a-muted);
    text-align: center;
}
.auth-resend a { color: var(--a-accent); font-weight: 700; text-decoration: none; }
.auth-resend a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.auth-footer {
    background: var(--a-footer-bg);
    color: var(--a-footer-txt);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    flex-shrink: 0;
    transition: background .3s;
}
.auth-footer-links { display: flex; gap: 22px; }
.auth-footer-links a { color: var(--a-footer-txt); text-decoration: none; transition: color .2s; }
.auth-footer-links a:hover { color: #FFB400; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .auth-split-card  { flex-direction: column; max-width: 500px; min-height: auto; }
    .auth-left-panel  { width: 100%; padding: 32px 28px; }
    .auth-panel-logo  { display: none; }
    .auth-right-panel { padding: 32px 28px; }
    .auth-row         { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 520px) {
    .auth-header  { padding: 0 16px; }
    .auth-brand span { display: none; }
    .auth-main    { padding: 24px 12px; }
    .auth-otp-card { padding: 36px 20px; }
    .auth-footer  { flex-direction: column; gap: 12px; text-align: center; }
    .auth-left-panel  { padding: 24px 22px; }
    .auth-right-panel { padding: 24px 22px; }
    .auth-left-title  { font-size: 22px; }
    .auth-form-title  { font-size: 22px; }
    .auth-left-panel::before,
    .auth-left-panel::after { display: none; }
    .auth-otp-card input[type="text"] { font-size: 20px; letter-spacing: 6px; height: 54px; }
}
