/*
 * Auth shell (2026-11-06) — full redesign of login / register / forgot /
 * reset / verify-email / confirm-password, per owner's request ("تغيير جذري
 * للشكل والآلية وتكون سهلة").
 *
 * Self-contained on purpose: these pages no longer load the heavy public
 * template (main.css + vendors.css + preloader + barba). One small file, the
 * brand palette from theme-green-override.css repeated here as local tokens.
 */
:root {
    /* DGA Unified Design System ("كود المنصات") tokens — contrast-checked (WCAG 2.1 AA) */
    --g-900: #104631;   /* Primary SA 900 */
    --g-800: #14573A;   /* 800 */
    --g-700: #166A45;   /* 700 — links/borders, white text 6.6:1 */
    --g-600: #1B8354;   /* 600 — buttons, white text 4.75:1 */
    --g-500: #25935F;   /* 500 — fills/graphics only (3.9:1 on white) */
    --g-200: #B8EACB;
    --g-100: #DFF6E7;
    --g-50: #F3FCF6;
    --accent: #FDB022;  /* Warning 400 — decoration only */
    --ink: #161616;
    --ink-2: #4D5761;   /* 7.4:1 */
    --ink-3: #6C737F;   /* 4.8:1 on white, 4.6:1 on tinted surfaces */
    --line: #D2D6DB;    /* decorative separators */
    --input-line: #8A929C; /* input borders: 3.15:1 on white (WCAG 1.4.11) */
    --surface: #FFFFFF;
    --page: #F9FAFB;
    --danger: #B42318;  /* Error 700 — 6.6:1 */
    --danger-bg: #FEF3F2;
    --ok: #067647;      /* Success 700 */
    --ok-bg: #ECFDF3;
    --warn: #B54708;    /* Warning 700 */
    --radius: 14px;
    --font: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.auth {
    font-family: var(--font);
    color: var(--ink);
    background: var(--page);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: var(--g-700); text-decoration: none; }
a:hover { color: var(--g-800); text-decoration: underline; }

/* ---------- Layout ---------- */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    min-height: 100vh;
}

.auth-main {
    display: flex;
    flex-direction: column;
    padding: 28px 48px 24px;
    min-width: 0;
}
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.auth-topbar__home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 14px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    transition: border-color .15s, color .15s;
}
.auth-topbar__home:hover { color: var(--g-700); border-color: var(--g-600); text-decoration: none; }
.auth-topbar__switch { font-size: 14px; color: var(--ink-2); }
.auth-topbar__switch a { font-weight: 700; }

.auth-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}
.auth-card {
    width: 100%;
    max-width: 460px;
}
.auth-card--wide { max-width: 540px; }

.auth-foot {
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
    margin: 0;
}

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 15% 85%, rgba(136, 216, 173, .45) 0, rgba(136, 216, 173, 0) 45%),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, 0) 35%),
        linear-gradient(155deg, var(--g-800) 0%, var(--g-700) 55%, var(--g-600) 100%);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
}
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    pointer-events: none;
}
.auth-brand::before { width: 520px; height: 520px; left: -180px; bottom: -220px; }
.auth-brand::after { width: 320px; height: 320px; left: -80px; bottom: -120px; border-color: rgba(255, 255, 255, .18); }

.auth-brand__logo img { width: 230px; max-width: 100%; height: auto; display: block; }
.auth-brand__body { position: relative; z-index: 1; max-width: 440px; }
.auth-brand__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.auth-brand__eyebrow::before {
    content: "";
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.auth-brand__title {
    font-size: 34px;
    line-height: 1.35;
    font-weight: 700;
    margin: 0 0 14px;
}
.auth-brand__text { font-size: 16px; opacity: .88; margin: 0 0 28px; }
.auth-brand__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-brand__list li { display: flex; gap: 14px; align-items: flex-start; }
.auth-brand__list .ic {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    font-size: 16px;
}
.auth-brand__list strong { display: block; font-size: 15px; }
.auth-brand__list span { font-size: 13.5px; opacity: .8; }
.auth-brand__foot { position: relative; z-index: 1; font-size: 13px; opacity: .7; }

/* ---------- Card content ---------- */
.auth-head { margin-bottom: 26px; }
.auth-head__icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--g-100);
    color: var(--g-700);
    font-size: 21px;
    margin-bottom: 18px;
}
.auth-head h1 { font-size: 28px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; color: var(--ink); }
.auth-head p { margin: 0; color: var(--ink-2); }

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.auth-alert i { margin-top: 3px; }
.auth-alert--error { background: var(--danger-bg); color: #7A271A; border-color: #FDA29B; }
.auth-alert--ok { background: var(--ok-bg); color: #085D3A; border-color: #75E0A7; }
.auth-alert ul { margin: 0; padding: 0 18px 0 0; }

/* fields */
.f { margin-bottom: 18px; }
.f__label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}
.f__label small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.f__control { position: relative; }
.f__control > i.lead {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--ink-3);
    font-size: 15px;
    pointer-events: none;
    transition: color .15s;
}
.f__input {
    width: 100%;
    height: 52px;
    border: 1.5px solid var(--input-line);
    border-radius: 12px;
    background: var(--surface);
    padding: 0 46px 0 16px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none;
    appearance: none;
}
.f__input[dir="ltr"] { text-align: right; }
.f__input[dir="ltr"]:not(:placeholder-shown) { text-align: left; }
.f__input::placeholder { color: var(--ink-3); opacity: 1; }
.f__input:hover { border-color: var(--ink-2); }
.f__input:focus {
    outline: none;
    border-color: var(--g-700);
    box-shadow: 0 0 0 4px rgba(27, 131, 84, .25);
}
.f__control:focus-within > i.lead { color: var(--g-700); }
.f.is-invalid .f__input { border-color: var(--danger); background: #FFFBFA; }
.f.is-invalid .f__input:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .2); }
.f.is-valid .f__input { border-color: #079455; }
.f__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.f__error { font-size: 13px; color: var(--danger); margin-top: 6px; display: none; }
.f.is-invalid .f__error { display: block; }
.f.is-invalid .f__hint { display: none; }

.f__toggle {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 15px;
}
.f__toggle:hover { background: var(--g-50); color: var(--g-700); }
.f__control.has-toggle .f__input { padding-left: 52px; }
.f__caps { display: none; font-size: 12.5px; color: var(--warn); margin-top: 6px; }
.f__caps.on { display: block; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.auth-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -4px 0 22px;
    font-size: 14px;
}
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--g-700); margin: 0; }

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 22px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s, border-color .15s, color .15s;
    text-decoration: none !important;
}
.btn--primary {
    width: 100%;
    color: #fff;
    background: var(--g-700);
    box-shadow: 0 8px 20px -10px rgba(22, 106, 69, .7);
}
.btn--primary:hover { transform: translateY(-1px); background: var(--g-800); box-shadow: 0 12px 24px -12px rgba(22, 106, 69, .8); color: #fff; }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--g-600); color: var(--g-700); }
.btn--link { height: auto; padding: 0; background: none; border: 0; color: var(--g-700); font-weight: 600; font-size: 14px; }
.btn--link:hover { text-decoration: underline !important; }
.btn[disabled], .btn.is-loading { opacity: .75; cursor: progress; pointer-events: none; }
.btn .spin {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authspin .7s linear infinite;
}
.btn.is-loading .spin { display: inline-block; }
@keyframes authspin { to { transform: rotate(360deg); } }

.auth-alt {
    text-align: center;
    margin-top: 22px;
    font-size: 14.5px;
    color: var(--ink-2);
}
.auth-alt a { font-weight: 700; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-3);
    font-size: 13px;
    margin: 22px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Register wizard ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 28px;
    counter-reset: step;
}
.steps__item { font-size: 13px; color: var(--ink-3); }
.steps__bar { height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 8px; overflow: hidden; position: relative; }
.steps__bar::after {
    content: "";
    position: absolute; inset: 0;
    width: 0;
    background: linear-gradient(90deg, var(--g-600), var(--g-700));
    transition: width .35s ease;
}
.steps__item.is-active, .steps__item.is-done { color: var(--ink); font-weight: 600; }
.steps__item.is-active .steps__bar::after,
.steps__item.is-done .steps__bar::after { width: 100%; }
.steps__item.is-done .steps__label::before { content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; color: var(--g-700); margin-left: 6px; font-size: 11px; }

.wstep { display: none; animation: authfade .3s ease; }
.wstep.is-active { display: block; }
@keyframes authfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wstep__title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.wstep__sub { font-size: 14px; color: var(--ink-2); margin: 0 0 20px; }
.wnav { display: flex; gap: 12px; margin-top: 8px; }
.wnav .btn--ghost { flex: 0 0 auto; }
.wnav .btn--primary { flex: 1; }

/* password rules + strength */
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.pw-meter span { height: 5px; border-radius: 99px; background: var(--line); transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #DC6803; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--g-500); }
.pw-meter[data-score="4"] span:nth-child(-n+4) { background: var(--g-700); }
.pw-rules {
    list-style: none;
    padding: 12px 14px;
    margin: 12px 0 0;
    background: var(--g-50);
    border: 1px solid var(--g-200);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    font-size: 13px;
    color: var(--ink-2);
}
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules li::before {
    content: "";
    width: 16px; height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    border: 1.5px solid var(--input-line);
    background: #fff;
    transition: all .15s;
}
.pw-rules li.ok { color: var(--g-800); }
.pw-rules li.ok::before {
    border-color: var(--g-700);
    background: var(--g-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4.5 8.5l2.2 2.2 4.8-5'/%3E%3C/svg%3E") center/14px no-repeat;
}
.pw-suggest { margin-top: 10px; }

.review {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 14px;
    margin-bottom: 18px;
    background: var(--surface);
    font-size: 14px;
}
.review div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.review div:last-child { border-bottom: 0; }
.review dt { color: var(--ink-3); margin: 0; }
.review dd { margin: 0; font-weight: 600; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.review dd.rtl { direction: rtl; text-align: right; }

.note {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-2);
    background: var(--g-50);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 18px;
}
.note i { color: var(--g-700); margin-top: 3px; }

/* verify-email page */
.big-icon {
    width: 76px; height: 76px;
    border-radius: 24px;
    background: var(--g-100);
    color: var(--g-700);
    display: grid; place-items: center;
    font-size: 30px;
    margin-bottom: 20px;
}
.stack { display: grid; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .auth-main { padding: 24px 32px; }
    .auth-brand { padding: 40px; }
    .auth-brand__title { font-size: 28px; }
}
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand {
        order: -1;
        padding: 22px 20px 26px;
        gap: 14px;
    }
    .auth-brand::before { width: 300px; height: 300px; left: -120px; bottom: -200px; }
    .auth-brand::after { display: none; }
    .auth-brand__logo img { width: 150px; }
    .auth-brand__eyebrow, .auth-brand__list, .auth-brand__foot, .auth-brand__text { display: none; }
    .auth-brand__title { font-size: 19px; margin: 0; font-weight: 600; }
    .auth-main { padding: 16px 16px 20px; }
    .auth-center { padding: 18px 0 24px; align-items: flex-start; }
    .auth-head h1 { font-size: 24px; }
}
@media (max-width: 480px) {
    .row-2 { grid-template-columns: 1fr; gap: 0; }
    .pw-rules { grid-template-columns: 1fr; }
    .auth-topbar__switch { display: none; }
    .steps__label { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Accessibility: visible keyboard focus ---------- */
:where(a, button, summary, input[type="checkbox"]):focus-visible { outline: 3px solid var(--g-700); outline-offset: 3px; border-radius: 6px; }
.auth-brand :where(a, button):focus-visible { outline-color: #FEC84B; }

/* 2026-11-14: decorative icons removed from the auth pages — no icon gutter in inputs */
.f__input { padding: 0 16px; }
.f__control.has-toggle .f__input { padding-left: 52px; }
