:root {
    --auth-navy: #0f172a;
    --auth-navy-deep: #08111f;
    --auth-blue: #0369a1;
    --auth-blue-hover: #075985;
    --auth-blue-soft: #e0f2fe;
    --auth-canvas: #f8fafc;
    --auth-surface: #ffffff;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #dbe3ed;
    --auth-danger: #b91c1c;
    --auth-focus: 0 0 0 3px rgba(2, 132, 199, 0.24);
    --auth-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
}

html[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", sans-serif; }
html:not([dir="rtl"]) body { font-family: "Plus Jakarta Sans", sans-serif; }

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-text);
    background: var(--auth-canvas);
}

body *, body *::before, body *::after { box-sizing: border-box; }

body :focus-visible {
    outline: 2px solid #0284c7 !important;
    outline-offset: 2px;
    box-shadow: var(--auth-focus) !important;
}

.auth-shell {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
}

.auth-showcase {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 100%;
    align-items: center;
    color: #fff;
    background-color: var(--auth-navy);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
}

.auth-showcase::after {
    position: absolute;
    inset-inline-end: -90px;
    inset-block-end: -90px;
    width: 280px;
    height: 280px;
    border: 54px solid rgba(3, 105, 161, 0.32);
    border-radius: 50%;
    content: "";
}

.auth-showcase-inner {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(100%, 600px);
    min-height: 100dvh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(32px, 5vw, 72px);
}

.auth-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 13px;
    color: #fff;
    text-decoration: none;
}

.auth-brand:hover { color: #fff; text-decoration: none; }

.auth-brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: var(--auth-blue);
    font-size: 16px;
    font-weight: 800;
}

.auth-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand strong { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand small { margin-block-start: 3px; color: #94a3b8; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }

.auth-showcase-copy { max-width: 540px; margin-block: clamp(56px, 12vh, 120px); }

.auth-kicker {
    display: inline-flex;
    margin-block-end: 18px;
    padding: 7px 10px;
    border: 1px solid rgba(125, 211, 252, 0.25);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(3, 105, 161, 0.22);
    font-size: 11px;
    font-weight: 700;
}

.auth-showcase-copy h1 {
    max-width: 14ch;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(34px, 4.5vw, 58px);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.15;
    text-wrap: balance;
}

html[dir="rtl"] .auth-showcase-copy h1 { letter-spacing: 0; line-height: 1.35; }

.auth-showcase-copy p {
    max-width: 58ch;
    margin: 0;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.8;
}

.auth-trust-list {
    display: grid;
    gap: 12px;
}

.auth-trust-list > div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
}

.auth-trust-list svg { width: 18px; height: 18px; color: #7dd3fc; stroke-width: 1.8; }

.auth-panel {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 6vw, 80px);
    background: var(--auth-canvas);
}

.auth-card {
    width: min(100%, 480px);
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

.auth-company {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-block-end: 30px;
    padding-block-end: 22px;
    border-block-end: 1px solid var(--auth-border);
}

.auth-company-logo {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fff;
}

.auth-company-logo img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.auth-company > div:last-child { display: flex; min-width: 0; flex-direction: column; }
.auth-company span { color: var(--auth-muted); font-size: 11px; }
.auth-company strong { overflow-wrap: anywhere; color: var(--auth-text); font-size: 14px; font-weight: 700; }

.auth-card-header { margin-block-end: 26px; }
.auth-card-header h2 { margin: 0 0 7px; color: var(--auth-text); font-size: 27px; font-weight: 700; letter-spacing: -0.035em; }
html[dir="rtl"] .auth-card-header h2 { letter-spacing: 0; }
.auth-card-header p { margin: 0; color: var(--auth-muted); font-size: 13px; line-height: 1.6; }

.auth-card .alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-block-end: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
}

.auth-card .alert svg { width: 18px; height: 18px; flex: 0 0 18px; }

.auth-form { display: grid; gap: 20px; }
.auth-form .form-group { margin: 0; }
.auth-form label { display: inline-block; margin-block-end: 8px; color: #334155; font-size: 12px; font-weight: 700; }

.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-label-row a { margin-block-end: 8px; color: var(--auth-blue); font-size: 11px; font-weight: 700; }

.auth-form .form-control,
.auth-form .form-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: var(--auth-text);
    background-color: #fff;
    font-size: 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-form .form-control:focus,
.auth-form .form-select:focus { border-color: #0284c7; box-shadow: var(--auth-focus); }

.auth-input-wrap { position: relative; }
.auth-input-wrap > svg {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 15px;
    z-index: 2;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input-wrap .form-control { padding-inline-start: 44px; }
.auth-form .is-invalid { border-color: var(--auth-danger); }
.auth-form .invalid-feedback { display: block; margin-block-start: 6px; color: var(--auth-danger); font-size: 11px; }

.auth-demo-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    color: #075985;
    background: #f0f9ff;
    font-size: 11px;
    line-height: 1.6;
}

.auth-demo-note svg { width: 17px; height: 17px; flex: 0 0 17px; margin-block-start: 1px; }

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--auth-blue);
    border-radius: 10px;
    color: #fff;
    background: var(--auth-blue);
    font-size: 13px;
    font-weight: 700;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover,
.auth-submit:active { border-color: var(--auth-blue-hover); background: var(--auth-blue-hover); }
.auth-submit svg { width: 18px; height: 18px; }
html[dir="ltr"] .auth-submit svg { transform: rotate(180deg); }

.auth-footer-note { margin: 26px 0 0; color: var(--auth-muted); font-size: 10px; text-align: center; }

body[data-theme="dark"] {
    --auth-canvas: #0b1220;
    --auth-surface: #111c2e;
    --auth-text: #f1f5f9;
    --auth-muted: #a7b3c5;
    --auth-border: #29374c;
    --auth-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"] .auth-form label { color: #cbd5e1; }
body[data-theme="dark"] .auth-form .form-control,
body[data-theme="dark"] .auth-form .form-select { border-color: #3a4a62; color: #f1f5f9; background: #172338; }
body[data-theme="dark"] .auth-company-logo { border-color: #3a4a62; }
body[data-theme="dark"] .auth-demo-note { border-color: #164e63; color: #bae6fd; background: #0c2d3e; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { min-height: auto; }
    .auth-showcase-inner { min-height: auto; padding: 28px clamp(20px, 6vw, 48px); }
    .auth-showcase-copy { margin-block: 44px 30px; }
    .auth-showcase-copy h1 { max-width: 18ch; font-size: clamp(30px, 7vw, 44px); }
    .auth-trust-list { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .auth-panel { padding: 40px 20px; }
}

@media (max-width: 640px) {
    .auth-showcase-copy { margin-block: 36px 20px; }
    .auth-showcase-copy h1 { font-size: 32px; }
    .auth-showcase-copy p { font-size: 14px; }
    .auth-trust-list { display: none; }
    .auth-panel { padding: 24px 14px 36px; }
    .auth-card { padding: 24px 20px; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1); }
}

@media (max-width: 420px) {
    .auth-showcase-copy h1 { font-size: 28px; }
    .auth-showcase-inner { padding-inline: 20px; }
    .auth-company { margin-block-end: 24px; }
    .auth-card-header h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    body *, body *::before, body *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
