@font-face {
    font-family: "Cairo";
    src: url("../fonts/Cairo-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
}

:root {
    --brand-blue: #004f94;
    --brand-deep: #002647;
    --brand-purple: #352b58;
    --brand-red: #da1630;
    --brand-yellow: #fad400;
    --ink: #13263d;
    --muted: #65758b;
    --line: #d9e2ec;
    --soft: #f4f8fb;
    --white: #fff;
    --focus: rgba(0, 79, 148, .2);
    --shadow: 0 24px 60px rgba(0, 38, 71, .12);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--white); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--white);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(500px, .95fr);
}

.identity-panel {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding: clamp(34px, 5vw, 76px);
    overflow: hidden;
    color: var(--white);
    background:
        linear-gradient(142deg, rgba(0, 38, 71, .98), rgba(0, 79, 148, .95) 61%, rgba(53, 43, 88, .96)),
        var(--brand-deep);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.identity-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .2;
    background-image:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(145deg, #000, transparent 70%);
}

.identity-glow {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    filter: blur(2px);
}

.identity-glow-one {
    width: 540px;
    height: 540px;
    inset-inline-start: -260px;
    bottom: -230px;
    border: 92px solid rgba(63, 47, 101, .38);
}

.identity-glow-two {
    width: 330px;
    height: 330px;
    inset-inline-end: -145px;
    top: -130px;
    border: 62px solid rgba(74, 132, 188, .24);
}

.brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    width: fit-content;
    color: var(--white);
    text-decoration: none;
}

.brand-mark {
    width: 78px;
    height: 78px;
    padding: 7px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 15px 34px rgba(0, 20, 40, .24);
}

.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.brand-copy { display: flex; flex-direction: column; gap: 4px; }
.brand-copy strong { direction: ltr; font-size: 30px; line-height: 1; letter-spacing: -1.3px; }
.brand-copy strong span { color: #ff5267; }
.brand-copy small { color: rgba(255, 255, 255, .72); font-size: 12px; }

.identity-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: clamp(70px, 12vh, 150px) 0 72px;
}

.identity-label {
    display: inline-flex;
    padding: 7px 13px;
    color: rgba(255, 255, 255, .84);
    border: 1px solid rgba(255, 255, 255, .19);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 700;
}

.identity-content h1 {
    max-width: 700px;
    margin: 21px 0 16px;
    font-size: clamp(42px, 5vw, 72px);
    line-height: 1.12;
    letter-spacing: -1.5px;
}

.identity-content > p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.95;
}

.feature-list {
    display: grid;
    gap: 12px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
}

.feature-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
}

.feature-icon svg,
.input-wrap > svg,
.password-toggle svg,
.security-note svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.identity-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, .58);
    font-size: 11px;
}

.login-panel {
    position: relative;
    min-height: 100vh;
    padding: 72px clamp(32px, 6vw, 96px) 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 88% 10%, rgba(53, 43, 88, .09), transparent 27%),
        radial-gradient(circle at 15% 92%, rgba(0, 79, 148, .08), transparent 30%),
        var(--white);
}

.language-toggle {
    position: absolute;
    top: 26px;
    inset-inline-end: 30px;
    min-height: 42px;
    padding: 8px 14px;
    color: var(--brand-deep);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.language-toggle:hover { border-color: var(--brand-blue); background: var(--soft); }
.language-icon { font-size: 15px; }

.login-card { width: min(470px, 100%); }

.mobile-brand { display: none; }

.welcome-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.welcome-label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-yellow);
    box-shadow: 0 0 0 5px rgba(250, 212, 0, .15);
}

.login-card h2 {
    margin: 0 0 9px;
    font-size: clamp(29px, 3vw, 39px);
    line-height: 1.3;
    letter-spacing: -.7px;
}

.login-intro {
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.login-form { display: grid; gap: 19px; }
.form-error {
    margin-bottom: 18px;
    padding: 13px 15px;
    color: #9d1c2f;
    border: 1px solid #f0b7c0;
    border-radius: 14px;
    background: #fff2f4;
    display: grid;
    gap: 3px;
    font-size: 11px;
}
.form-error strong { font-size: 12px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--ink); font-size: 12px; font-weight: 800; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.field-heading a { color: var(--brand-blue); font-size: 11px; font-weight: 700; text-decoration: none; }
.field-heading a:hover { text-decoration: underline; }

.input-wrap { position: relative; }
.input-wrap > svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 16px;
    color: #8190a3;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 48px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdff;
    outline: 0;
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-wrap input::placeholder { color: #9aa7b6; }
.input-wrap input:hover { border-color: #b8c7d6; }
.input-wrap input:focus { border-color: var(--brand-blue); background: var(--white); box-shadow: 0 0 0 4px var(--focus); }

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #748398;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-toggle:hover { color: var(--brand-blue); background: var(--soft); }

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
}

.remember-option input { width: 17px; height: 17px; accent-color: var(--brand-blue); }

.primary-action,
.microsoft-action {
    width: 100%;
    min-height: 53px;
    padding: 12px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.primary-action {
    color: var(--white);
    border: 0;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-blue));
    box-shadow: 0 14px 28px rgba(0, 79, 148, .22);
}

.primary-action:hover { transform: translateY(-1px); box-shadow: 0 18px 32px rgba(0, 79, 148, .28); }

.divider {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #94a1b1;
    font-size: 11px;
}

.divider::before,
.divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.microsoft-action {
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.microsoft-action:hover { transform: translateY(-1px); border-color: #9fb1c4; box-shadow: 0 11px 24px rgba(0, 38, 71, .08); }

.microsoft-mark { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.security-note {
    margin-top: 26px;
    padding: 14px 15px;
    color: #586b7e;
    border: 1px solid #e3eaf0;
    border-radius: 14px;
    background: var(--soft);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.security-note svg { width: 19px; flex: 0 0 auto; color: var(--brand-blue); }
.security-note p { margin: 0; font-size: 10px; line-height: 1.7; }

.login-footer {
    position: absolute;
    inset-inline: clamp(32px, 6vw, 96px);
    bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: #7f8b9a;
    font-size: 10px;
}

.login-footer a { color: var(--brand-blue); text-decoration: none; font-weight: 700; }

html[dir="rtl"] .identity-content h1,
html[dir="rtl"] .login-card h2 { letter-spacing: 0; }

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: minmax(330px, .82fr) minmax(450px, 1fr); }
    .identity-panel { padding: 34px; }
    .identity-content h1 { font-size: clamp(36px, 5vw, 52px); }
    .feature-list { display: none; }
}

@media (max-width: 760px) {
    .auth-shell { display: block; min-height: 100vh; }
    .identity-panel { display: none; }
    .login-panel { min-height: 100vh; padding: 92px 22px 80px; }
    .login-card { width: min(480px, 100%); }
    .mobile-brand { display: block; margin-bottom: 25px; }
    .mobile-brand img { width: 72px; height: 72px; object-fit: contain; }
    .language-toggle { top: 20px; inset-inline-end: 20px; }
    .login-footer { inset-inline: 22px; bottom: 20px; }
}

@media (max-width: 420px) {
    .login-panel {
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
        padding-top: 84px;
    }
    .login-card { width: 100%; }
    .login-card h2 { font-size: 28px; }
    .login-footer { position: static; margin-top: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
