/* ============================================================
   Xi — Sign in (v2-Pro, editorial minimal)
   Light-mode. Bilingual AR/EN. RTL-native.
   Inspired by Linear · Vercel · Stripe · Framer (2026).
   No raster assets. Proprietary SVG canvas.
   ============================================================ */

:root {
    --n-0:   #ffffff;
    --n-25:  #fdfcfa;
    --n-50:  #f7f5f0;
    --n-100: #eeece5;
    --n-200: #e2ded3;
    --n-300: #c8c3b5;
    --n-400: #8f8b7f;
    --n-500: #625f56;
    --n-600: #47443d;
    --n-700: #2e2c27;
    --n-800: #1b1a17;
    --n-900: #0f0e0c;

    --xi-50:  #fff7e8;
    --xi-100: #ffe9c1;
    --xi-500: #d97706;
    --xi-600: #b45309;
    --xi-700: #92400e;

    --success: #16a34a;

    --text-strong: var(--n-900);
    --text-body:   var(--n-600);
    --text-muted:  var(--n-500);
    --text-faint:  #8a8579;
    --text-label:  var(--n-500);

    --canvas:   #fbfaf7;
    --canvas-2: #f5f2ea;
    --line:     #e7e2d5;
    --line-soft: #ece7db;

    --focus: 0 0 0 3px rgba(217, 119, 6, 0.28);

    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);

    --pad-i: clamp(28px, 4.6vw, 84px);
    --pad-b: clamp(20px, 3.2vh, 32px);

    --font-ar: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-en: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: var(--canvas);
    color: var(--text-strong);
    font-family: var(--font-ar);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
html[lang="en"] body { font-family: var(--font-en); }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--xi-100); color: var(--xi-700); }

/* ============================================================
   Layout
   ============================================================ */
.shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    background: var(--canvas);
}

.pane {
    position: relative;
    padding: var(--pad-b) var(--pad-i);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.pane-form {
    background: var(--canvas);
    border-inline-start: 1px solid var(--line);
}

.pane-editorial {
    background:
        radial-gradient(1200px 700px at 100% 0%, rgba(217,119,6,0.06), transparent 60%),
        linear-gradient(180deg, var(--canvas) 0%, var(--canvas-2) 100%);
    overflow: hidden;
}

/* Ambient SVG canvas */
.bg-orbits {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.55;
}

/* ============================================================
   Top rows
   ============================================================ */
.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Status pill (left top) */
.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}
.status .pulse {
    position: relative;
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--success);
}
.status .pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.28);
    animation: pulse 2.2s var(--ease-smooth) infinite;
}
@keyframes pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    80%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}
.status .sep { color: var(--text-faint); }

/* Language pill */
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--n-0);
    border: 1px solid var(--line);
    color: var(--text-body);
    font-weight: 500;
    font-size: 13px;
    transition: background 160ms var(--ease-smooth),
                border-color 160ms var(--ease-smooth),
                color 160ms var(--ease-smooth);
}
.lang-pill:hover { background: var(--n-50); border-color: var(--n-300); color: var(--text-strong); }
.lang-pill:focus-visible { outline: none; box-shadow: var(--focus); }

/* Brand (right top of editorial pane) */
.brand-lock {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
}
.brand-lock .brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.brand-lock .brand-name {
    font-family: var(--font-en);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    line-height: 1;
}
.brand-lock .brand-eyebrow {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
}
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(160deg, #f8b13c 0%, #d97706 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px -8px rgba(217, 119, 6, 0.45),
                inset 0 1px 0 rgba(255,255,255,0.32);
}
.brand-mark-word {
    color: #fff;
    font-family: var(--font-en);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* ============================================================
   FORM PANE — center card
   ============================================================ */
.form-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--xi-700);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}
.kicker .bar {
    width: 22px; height: 1.5px;
    background: currentColor;
    display: inline-block;
}

.h-welcome {
    font-size: clamp(26px, 2.6vw, 30px);
    line-height: 1.25;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-strong);
}
.h-welcome .brand-word {
    color: var(--xi-600);
}
.h-sub {
    font-size: 14.5px;
    color: var(--text-body);
    margin: 0 0 26px;
    max-width: 42ch;
    line-height: 1.65;
}

.btn-microsoft {
    width: 100%;
    height: 54px;
    border-radius: 12px;
    background: var(--n-900);
    border: 1px solid var(--n-900);
    color: var(--n-0);
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 24px -12px rgba(15, 14, 12, 0.55),
                inset 0 1px 0 rgba(255,255,255,0.06);
    transition: transform 280ms var(--ease-spring),
                background 200ms var(--ease-smooth),
                box-shadow 200ms var(--ease-smooth);
}
.btn-microsoft:hover {
    transform: translateY(-1px);
    background: #1a1815;
    box-shadow: 0 16px 32px -14px rgba(15, 14, 12, 0.6),
                inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-microsoft:active { transform: translateY(0); }
.btn-microsoft:focus-visible { outline: none; box-shadow: var(--focus), 0 10px 24px -12px rgba(15,14,12,0.55); }

.trust-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.55;
}
.trust-line svg { flex: none; color: var(--success); }
.trust-line .sep { color: var(--text-faint); margin: 0 2px; }

.help-line {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    color: var(--text-muted);
    width: 100%;
}
.help-line a {
    color: var(--xi-700);
    font-weight: 600;
    transition: color 160ms var(--ease-smooth);
}
.help-line a:hover { color: var(--xi-600); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   EDITORIAL PANE
   ============================================================ */
.editorial-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.cx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.cx-eyebrow .bar {
    width: 26px; height: 1.5px;
    background: var(--xi-500);
    display: inline-block;
}

.cx-title {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.18;
    letter-spacing: -0.022em;
    font-weight: 700;
    margin: 0;
    color: var(--text-strong);
}
html[lang="ar"] .cx-title {
    line-height: 1.32;
    letter-spacing: 0;
}
.cx-title .accent {
    color: var(--xi-600);
}
.cx-title .row-2 {
    display: block;
    margin-top: 6px;
}
.cx-title .row-1 {
    display: flex;
    flex-wrap: wrap;
    column-gap: 26px;
    row-gap: 2px;
}
.cx-title .row-1 .word {
    position: relative;
    display: inline-block;
}
.cx-title .row-1 .word + .word::before {
    content: "";
    position: absolute;
    inset-inline-start: -14px;
    top: 50%;
    transform: translateY(-50%);
    inline-size: 1px;
    block-size: 0.58em;
    background: var(--n-300);
    opacity: 0.85;
}
html[lang="en"] .cx-title .row-1 .word:nth-child(3) {
    flex-basis: 100%;
}
html[lang="en"] .cx-title .row-1 .word:nth-child(3)::before {
    display: none;
}

.cx-lede {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-body);
    margin: 0;
    max-width: 52ch;
}

/* Info rows */
.info-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.info-row {
    display: grid;
    grid-template-columns: 104px 1fr;
    align-items: baseline;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}
.info-row:last-child { border-bottom: 0; }
.info-row:first-child { border-top: 1px solid var(--line-soft); }

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-label);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    justify-self: end;
    padding-top: 3px;
}
html[lang="ar"] .info-label { text-transform: none; letter-spacing: 0.01em; }
html[lang="en"] .info-row { grid-template-columns: 128px 1fr; }
html[lang="en"] .info-label { justify-self: start; }

.info-value {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-strong);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
}
.info-value .item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 160ms var(--ease-smooth);
}
.info-value .item:hover { color: var(--xi-700); }
.info-value .dot {
    width: 3px; height: 3px; border-radius: 999px;
    background: var(--text-faint);
    display: inline-block;
}
.info-value .item svg {
    color: var(--text-muted);
}

/* ============================================================
   Footers
   ============================================================ */
.foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    font-size: 12px;
    color: var(--text-muted);
}
.foot-links {
    display: inline-flex;
    gap: 18px;
    flex-wrap: wrap;
}
.foot-links a {
    transition: color 160ms var(--ease-smooth);
}
.foot-links a:hover { color: var(--text-strong); }

.foot-editorial {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 18px;
}
.foot-editorial .region {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
}
.foot-editorial .region svg { color: var(--text-faint); }

/* Powered-by strip */
.powered-by {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 6px;
}
.powered-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-label);
    letter-spacing: 0.02em;
}
.powered-names {
    font-family: var(--font-en);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .shell { grid-template-columns: 1fr; }
    .pane { min-height: auto; padding: 32px 28px; }
    .pane-form { border-inline-start: 0; }
    .pane-editorial { border-bottom: 1px solid var(--line); }
    .editorial-center { max-width: none; gap: 28px; }
    .cx-title { font-size: clamp(28px, 6vw, 38px); }
    .form-center { max-width: none; padding: 24px 0; }
}
@media (max-width: 640px) {
    .info-row { grid-template-columns: 1fr; gap: 6px; }
    html[lang="en"] .info-row { grid-template-columns: 1fr; }
    .info-label { justify-self: start; }
    .foot { flex-direction: column; align-items: flex-start; gap: 10px; }
    .cx-title .row-1 {
        display: grid;
        gap: 0;
    }
    .cx-title .row-1 .word::before {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
