/* ==========================================================================
   Login page (loaded by baseLTR.html after theme.css).
   A two-part card: the form, and a brand panel with a small dashboard
   illustration. Mirrors in Arabic; follows the light / dark theme.
   ========================================================================== */

:root {
    --auth-dot: rgba(5, 68, 94, 0.12);
    --auth-card-shadow: 0 30px 80px rgba(5, 68, 94, 0.16);
    --auth-visual: linear-gradient(150deg, #1eaac4 0%, #0d6f86 45%, #05445E 100%);
}

html[data-theme="dark"] {
    --auth-dot: rgba(255, 255, 255, 0.06);
    --auth-card-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    --auth-visual: linear-gradient(150deg, #17404d 0%, #10303b 50%, #0c222b 100%);
}

html[data-theme] body.auth-body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ------------------------------------------------------------ background */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--auth-dot) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.auth-blob-teal {
    width: 520px;
    height: 520px;
    top: -180px;
    inset-inline-start: -140px;
    background: #189AB4;
    opacity: 0.35;
}

.auth-blob-gold {
    width: 420px;
    height: 420px;
    bottom: -180px;
    inset-inline-end: -100px;
    background: #c8a86b;
    opacity: 0.3;
}

html[data-theme="dark"] .auth-blob {
    opacity: 0.16;
}

/* ---------------------------------------------------------------- top bar */
.auth-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
}

.auth-brandmark {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    font-size: 1.02rem;
    color: var(--text);
}

.auth-brandmark img {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.auth-tools {
    display: flex;
    gap: 0.5rem;
}

/* ------------------------------------------------------------------- card */
.auth-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem clamp(1rem, 4vw, 3rem) 1.5rem;
}

.auth-card {
    width: min(1080px, 100%);
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--auth-card-shadow), var(--shadow-sm);
    overflow: hidden;
    animation: auth-rise 0.5s ease both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- form side */
.auth-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
}

.auth-eyebrow {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
}

html[data-theme] .auth-form-side h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

html[data-theme] .auth-subtitle {
    margin: 0 0 2rem;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.auth-field {
    margin-bottom: 1.15rem;
}

html[data-theme] .auth-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > i {
    position: absolute;
    top: 50%;
    inset-inline-start: 1rem;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input-wrap:focus-within > i {
    color: var(--brand);
}

html[data-theme] .auth-input {
    width: 100%;
    height: 52px;
    padding-inline: 2.8rem 3rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.97rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

html[data-theme] .auth-input:hover {
    border-color: var(--text-soft);
}

html[data-theme] .auth-input:focus {
    outline: 0;
    border-color: var(--brand);
    background: var(--input-bg);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

html[data-theme] .auth-input::placeholder {
    color: var(--text-soft);
}

html[data-theme] .auth-eye {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.5rem;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

html[data-theme] .auth-eye:hover {
    background: var(--surface-3);
    color: var(--text);
}

html[data-theme] .auth-submit {
    width: 100%;
    height: 52px;
    margin-top: 0.6rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #1eaac4 0%, #0b6278 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(24, 154, 180, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

html[data-theme] .auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 30px rgba(24, 154, 180, 0.34);
}

html[data-theme] .auth-submit:focus-visible {
    outline: 4px solid var(--brand-soft);
    outline-offset: 2px;
}

html[dir="rtl"] .auth-submit .fa-sign-in-alt {
    transform: scaleX(-1);
}

html[data-theme="dark"] body .auth-submit {
    background: #1f8ea3;
    box-shadow: none;
}

.auth-help {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.84rem;
}

.auth-help i {
    color: var(--accent);
}

/* ----------------------------------------------------------- brand panel */
.auth-visual {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 3.5vw, 3rem);
    background: var(--auth-visual);
    color: #fff;
    overflow: hidden;
}

.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-visual::before {
    width: 460px;
    height: 460px;
    top: -170px;
    inset-inline-end: -170px;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.03), 0 0 0 120px rgba(255, 255, 255, 0.02);
}

.auth-visual::after {
    width: 300px;
    height: 300px;
    bottom: -140px;
    inset-inline-start: -90px;
    background: radial-gradient(circle, rgba(200, 168, 107, 0.35) 0%, rgba(200, 168, 107, 0) 70%);
    border: 0;
}

.auth-visual-copy h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 2.3vw, 2rem);
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
}

.auth-visual-copy p {
    margin: 0;
    max-width: 30rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.6;
}

/* Small dashboard illustration (decorative) */
.auth-preview {
    position: relative;
    margin-top: 0.5rem;
    animation: auth-float 6s ease-in-out infinite;
}

@keyframes auth-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.preview-window {
    position: relative;
    z-index: 1;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.preview-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 0.9rem;
}

.preview-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.preview-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.preview-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-tile i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
}

.preview-line {
    display: block;
    height: 6px;
    width: 70%;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.28);
}

.preview-line.short {
    width: 45%;
}

.preview-chart {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    height: 96px;
    padding: 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.preview-chart span {
    flex: 1;
    height: var(--h);
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #ecd6a6 0%, #c8a86b 100%);
    animation: auth-bar 0.9s ease both;
    animation-delay: calc(var(--i) * 70ms);
}

@keyframes auth-bar {
    from { height: 6%; }
}

.preview-chip {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    color: #05445E;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.preview-chip.chip-top {
    top: -16px;
    inset-inline-end: 18px;
}

.preview-chip.chip-bottom {
    bottom: -16px;
    inset-inline-start: 18px;
}

html[data-theme="dark"] .preview-chip {
    background: var(--surface-2);
    color: var(--text);
}

.auth-visual-foot {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
}

/* ----------------------------------------------------------------- footer */
html[data-theme] .auth-foot {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0 1rem 1.25rem;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 991.98px) {
    .auth-card {
        max-width: 480px;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-brandmark span {
        display: none;
    }

    .auth-card {
        border-radius: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-preview,
    .preview-chart span {
        animation: none !important;
    }
}
