/* =============================================================
   Qayema — Login page styles
   Uses the same design tokens as welcome.css
   ============================================================= */

:root {
    --ink:          #141109;
    --ink-2:        #18181B;
    --paper:        #FBFAF6;
    --paper-2:      #F6F4EE;
    --sand:         #E8DCCB;
    --sand-2:       #D9CAB3;
    --accent:       #F8D38D;
    --accent-deep:  #B08A2C;
    --accent-soft:  #FCE7BC;
    --line:         rgba(20,17,9,.10);
    --line-dark:    rgba(255,255,255,.10);
    --muted:        rgba(20,17,9,.58);
    --muted-dark:   rgba(246,241,232,.62);
    /* El Messiri is included so Arabic glyphs (absent from Geist / Instrument
       Serif) resolve to it — matching the welcome page. */
    --font-sans:    'Geist', 'El Messiri', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-display: 'Instrument Serif', 'El Messiri', 'Times New Roman', serif;
    --font-ar:      'El Messiri', 'Geist', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
    min-height: 100vh;
}

.form-col[dir="rtl"] { font-family: var(--font-ar); }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input  { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }

/* ── Layout ───────────────────────────────────────────────── */
.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
}

/* ── Left / form column ──────────────────────────────────── */
.form-col {
    display: flex;
    flex-direction: column;
    padding: 28px 56px 32px;
    background:
        radial-gradient(80% 60% at -10% -10%, rgba(248,211,141,.18), transparent 60%),
        var(--paper);
}

.form-col[dir="rtl"] {
    background:
        radial-gradient(80% 60% at 110% -10%, rgba(248,211,141,.18), transparent 60%),
        var(--paper);
}

.form-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand img { height: 80px; width: auto; }

/* ── Language picker dropdown ─────────────────────────────── */
.lang-picker {
    position: relative;
}
.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    appearance: none;
    background: rgba(20,17,9,.04);
    border: .5px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px 6px 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
    white-space: nowrap;
}
.lang-trigger:hover {
    background: rgba(20,17,9,.07);
    border-color: rgba(20,17,9,.18);
}
.lang-chevron {
    color: var(--muted);
    transition: transform .2s ease;
    flex-shrink: 0;
}
.lang-chevron.open { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface);
    border: .5px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px -8px rgba(20,17,9,.14), 0 2px 8px -2px rgba(20,17,9,.06);
    padding: 5px;
    z-index: 100;
    overscroll-behavior: contain;
}
.form-col[dir="rtl"] .lang-dropdown { right: auto; left: 0; }

.lang-dropdown::-webkit-scrollbar { width: 4px; }
.lang-dropdown::-webkit-scrollbar-track { background: transparent; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--sand-2); border-radius: 4px; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background .14s ease;
}
.lang-option:hover { background: var(--paper-2); }
.lang-option.active {
    background: rgba(248,211,141,.12);
    color: var(--accent-deep);
    font-weight: 500;
}

/* Alpine transition helpers */
.lang-drop-enter          { transition: opacity .15s ease, transform .15s ease; }
.lang-drop-enter-start    { opacity: 0; transform: translateY(-6px) scale(.97); }
.lang-drop-enter-end      { opacity: 1; transform: translateY(0) scale(1); }

/* ── Form body ────────────────────────────────────────────── */
.form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 56px 0;
}

.eyebrow {
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}
.form-col[dir="rtl"] .eyebrow { flex-direction: row-reverse; }
.eyebrow .dash { width: 28px; height: 1px; background: var(--ink); }
.eyebrow .dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

h1.title {
    margin: 0;
    font-size: clamp(40px, 4.4vw, 60px);
    line-height: 1.0;
    letter-spacing: -0.03em;
    font-weight: 400;
    color: var(--ink);
}
h1.title .it {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--gold-on);
    letter-spacing: -0.012em;
}
.form-col[dir="rtl"] h1.title .it { font-family: var(--font-ar); font-style: normal; }

.subtitle {
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 38ch;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    margin-top: 24px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
}
.alert-error  { background: rgba(220,38,38,.07); border: .5px solid rgba(220,38,38,.18); color: #b91c1c; }
.alert-status { background: rgba(248,211,141,.10); border: .5px solid rgba(248,211,141,.25); color: var(--accent-deep); }

/* ── Fields ───────────────────────────────────────────────── */
.fields {display: flex; flex-direction: column; gap: 16px; }

/* ── Remember row ────────────────────────────────────────── */
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* ── Submit button ───────────────────────────────────────── */
.submit {
    margin-top: 6px;
    height: 50px;
    border: .5px solid var(--gold);
    border-radius: 999px;
    background: var(--gold);
    color: #141109;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .2s ease, transform .12s ease;
}
.submit:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.submit:active { transform: translateY(1px); }
.submit .arr { transition: transform .25s ease; }
.submit:hover .arr { transform: translateX(3px); }
.form-col[dir="rtl"] .submit .arr { transform: rotate(180deg); }
.form-col[dir="rtl"] .submit:hover .arr { transform: rotate(180deg) translateX(3px); }

/* ── Footer ──────────────────────────────────────────────── */
.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted);
}
.form-foot .dot-sep { opacity: .4; margin: 0 8px; }

/* ── Right / image panel ─────────────────────────────────── */
.brand-col {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(70% 50% at 80% 10%, rgba(248, 211, 141, .18), transparent 60%),
        #141109;
}
.brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── ui.css component overrides: remap olive → gold ─────── */
/*    All x-ui.* components inside .form-col use the page's  */
/*    gold accent instead of the olive-green from ui.css.    */
.form-col {
    --olive:      var(--accent);
    --olive-deep: var(--accent-deep);
    --olive-soft: var(--accent-soft);
}
.form-col .ui-input-wrap {
    background: var(--surface);
}
.form-col .ui-input-wrap:focus-within {
    box-shadow: 0 0 0 3px rgba(248,211,141,.14);
}
.form-col .ui-input-wrap.error {
    box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.form-col .ui-check.olive input:checked + .box {
    background: var(--accent);
    border-color: var(--accent);
}
/* Inherit form column font for RTL languages */
.form-col[dir="rtl"] .ui-input,
.form-col[dir="rtl"] .ui-label { font-family: var(--font-ar); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .form-col  { padding: 24px 36px; }
}
@media (max-width: 820px) {
    .login     { grid-template-columns: 1fr; }
    .brand-col { display: none; }
    .form-body { padding: 32px 0; }
}
/* ── Google OAuth button ─────────────────────────────────── */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: var(--surface);
    border: 1px solid var(--sand-2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
    margin-bottom: 6px;
    margin-top: 20px;
}
.google-btn:hover {
    background: var(--paper);
    border-color: rgba(20,17,9,.25);
    box-shadow: 0 1px 6px rgba(20,17,9,.07);
}

/* ── Divider ─────────────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 4px;
    color: var(--muted);
    font-size: 12px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

@media (max-width: 520px) {
    .form-col { padding: 20px 22px; }
    h1.title  { font-size: 38px; }
}


/* ── Theme toggle (bare pages reuse the portal navbar toggle) ── */
.top-actions { display: flex; align-items: center; gap: 12px; }
.theme-tog {
    width: 58px; height: 32px; border-radius: 100px; border: 1px solid var(--line);
    background: var(--surface); position: relative; flex-shrink: 0; cursor: pointer;
}
.theme-tog .knob {
    position: absolute; top: 50%; transform: translateY(-50%);
    inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--gold, #F8D38D); display: grid; place-items: center; color: #1A1408;
    transition: inset-inline-start .4s ease;
}
html[data-theme="dark"] .theme-tog .knob { inset-inline-start: 29px; }
.theme-tog svg { width: 13px; height: 13px; }
.theme-tog .moon { display: none; } .theme-tog .sun { display: block; }
html[data-theme="dark"] .theme-tog .moon { display: block; }
html[data-theme="dark"] .theme-tog .sun { display: none; }