/* =====================================================================
 * EASRMS - Login Page (v3 - 2026)
 *
 * Goals:
 *  - Mobile-first, FULLY responsive (looks great 320 -> 4K)
 *  - Light, multi-color pastels - not heavy
 *  - NOT boxy: rounded, soft, single connected layout
 *  - Desktop: form on the LEFT, features list on the RIGHT, separated by a
 *    thin vertical line (no second card / no second box)
 *  - Mobile: ONLY the form. Decorations and feature list are hidden so the
 *    user does NOT need to scroll to log in.
 *  - Smooth, calm animations (no spinning rings, no busy clutter)
 *
 * Class prefix: lx-  ("login experience")
 * ===================================================================== */

/* ---------- 1. Tokens ----------------------------------------------- */
:root {
    --lx-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lx-text:        #0F172A;
    --lx-muted:       #64748B;
    --lx-faint:       #94A3B8;
    --lx-border:      #E5E7EB;
    --lx-border-soft: rgba(15, 23, 42, .08);
    --lx-card:        #FFFFFF;
    --lx-ring:        rgba(139, 92, 246, .22);

    --lx-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --lx-shadow-md: 0 12px 28px -14px rgba(15, 23, 42, .18),
                    0 2px 6px -2px rgba(15, 23, 42, .06);

    /* Multi-color brand gradient (used sparingly) */
    --lx-grad: linear-gradient(135deg, #8B5CF6 0%, #6366F1 35%, #EC4899 70%, #F59E0B 100%);
}

/* ---------- 2. Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.lx-page {
    font-family: var(--lx-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--lx-text);
    background: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--lx-ring);
    border-radius: 12px;
}

/* ---------- 3. Soft pastel background (calm, not noisy) ------------ */
/* On mobile we use a very subtle gradient so it's not heavy.            */
/* On desktop we add a few pastel blobs for visual interest.             */
body.lx-page::before {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 600px at 95% -5%,  rgba(196, 181, 253, .35), transparent 60%),
        radial-gradient(800px 600px at -5% 105%, rgba(110, 231, 183, .28), transparent 60%),
        radial-gradient(700px 500px at 50% 50%,  rgba(253, 164, 175, .14), transparent 65%),
        #FFFFFF;
}

/* Decorative dots ONLY on tablet/desktop where they don't crowd the form. */
.lx-dots { display: none; }
@media (min-width: 768px) {
    .lx-dots {
        display: block;
        position: fixed; inset: 0; z-index: 0;
        pointer-events: none;
    }
    .lx-dots span {
        position: absolute;
        border-radius: 50%;
        animation: lx-bob 9s ease-in-out infinite;
        will-change: transform, opacity;
    }
    .lx-dots span:nth-child(1) { width: 10px; height: 10px; top: 14%; left: 12%; background: #8B5CF6; opacity: .7; }
    .lx-dots span:nth-child(2) { width: 7px;  height: 7px;  top: 30%; left: 6%;  background: #EC4899; opacity: .7; animation-delay: -2s; }
    .lx-dots span:nth-child(3) { width: 12px; height: 12px; top: 70%; left: 8%;  background: #06B6D4; opacity: .65; animation-delay: -4s; }
    .lx-dots span:nth-child(4) { width: 8px;  height: 8px;  top: 84%; left: 18%; background: #10B981; opacity: .6;  animation-delay: -6s; }
    .lx-dots span:nth-child(5) { width: 9px;  height: 9px;  top: 22%; right: 14%;background: #F59E0B; opacity: .7;  animation-delay: -1s; }
    .lx-dots span:nth-child(6) { width: 11px; height: 11px; top: 58%; right: 6%; background: #6366F1; opacity: .65; animation-delay: -5s; }
    .lx-dots span:nth-child(7) { width: 7px;  height: 7px;  top: 86%; right: 16%;background: #EC4899; opacity: .55; animation-delay: -3s; }
}
@keyframes lx-bob {
    0%, 100% { transform: translateY(0)     scale(1);    opacity: .65; }
    50%      { transform: translateY(-22px) scale(1.12); opacity: 1;    }
}
@media (prefers-reduced-motion: reduce) {
    .lx-dots span { animation: none !important; }
}

/* ---------- 4. Layout ---------------------------------------------- */
/* Default (mobile) = single column with just the form. No side, no extras. */
.lx-shell {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    padding: 20px 16px;
}

/* Tablet+ : keep single column but bigger paddings, still no side panel */
@media (min-width: 768px) {
    .lx-shell { padding: 32px; }
}

/* Desktop : two columns, separated by a single hairline divider */
@media (min-width: 1024px) {
    .lx-shell {
        grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
        gap: 0 56px;
        align-items: stretch;
        justify-items: stretch;
        padding: 0;
    }
}

/* ---------- 5. The thin divider line (desktop only) ---------------- */
.lx-divider {
    display: none;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(15, 23, 42, .10) 18%,
        rgba(15, 23, 42, .10) 82%,
        transparent 100%);
    width: 1px;
}
@media (min-width: 1024px) {
    .lx-divider {
        display: block;
        margin: 6vh 0;
    }
}

/* ---------- 6. Form column ----------------------------------------- */
.lx-form-col {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: lx-rise .55s cubic-bezier(.2,.7,.2,1) both;
}
@media (min-width: 1024px) {
    .lx-form-col {
        max-width: 440px;
        padding: 60px 0 60px 8vw;
        justify-self: end;
        margin: 0;
    }
}
@media (min-width: 1280px) {
    .lx-form-col { padding-left: 6vw; }
}
@keyframes lx-rise {
    0%   { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0);    }
}

/* Brand row */
.lx-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px;
}
.lx-brand-mark {
    width: 42px; height: 42px;
    border-radius: 13px;
    background: var(--lx-grad);
    display: grid; place-items: center;
    color: #fff; font-size: 16px;
    box-shadow: 0 10px 24px -8px rgba(139, 92, 246, .55);
    position: relative;
    overflow: hidden;
}
.lx-brand-mark::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 55%);
}
.lx-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.lx-brand-name {
    font-size: 1rem; font-weight: 700;
    color: var(--lx-text);
    letter-spacing: -.01em;
}
.lx-brand-sub {
    font-size: .7rem;
    color: var(--lx-muted);
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* Heading */
.lx-title {
    font-size: clamp(1.45rem, 4.5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    background: var(--lx-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.lx-subtitle {
    font-size: .9rem;
    color: var(--lx-muted);
    margin: 0 0 22px;
    line-height: 1.55;
}

/* Alerts */
.lx-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: .82rem;
    margin-bottom: 16px;
    line-height: 1.45;
}
.lx-alert.warn { background: #FFF7ED; color: #9A3412; border: 1px solid #FED7AA; }
.lx-alert.info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.lx-alert i    { margin-top: 2px; }

/* Fields */
.lx-field { margin-bottom: 14px; }
.lx-label {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    letter-spacing: .01em;
}

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

.lx-input-wrap::before {
    content: '';
    position: absolute; inset: -1.5px;
    border-radius: 15px;
    background: var(--lx-grad);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 0;
    pointer-events: none;
}
.lx-input-wrap:focus-within::before { opacity: 1; }

.lx-input {
    position: relative; z-index: 1;
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font: inherit;
    font-size: .92rem;
    color: var(--lx-text);
    background: #FFFFFF;
    border: 1.5px solid var(--lx-border);
    border-radius: 13px;
    outline: none;
    transition: border-color .15s ease;
}
.lx-input::placeholder { color: #B6BFCC; }
.lx-input:hover:not(:focus) { border-color: #CBD5E1; }
.lx-input:focus { border-color: transparent; }

.lx-input-icon {
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #94A3B8;
    font-size: 14px;
    pointer-events: none;
    transition: color .2s ease;
}
.lx-input-wrap:focus-within .lx-input-icon { color: #8B5CF6; }

.lx-input.has-toggle { padding-right: 46px; }
.lx-eye {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 38px; height: 38px;
    border: none; background: transparent;
    color: #94A3B8; cursor: pointer;
    border-radius: 10px;
    display: grid; place-items: center;
    transition: color .15s ease, background .15s ease;
}
.lx-eye:hover { color: #475569; background: rgba(148, 163, 184, .12); }

/* Row: remember + forgot */
.lx-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 20px;
    gap: 10px;
    flex-wrap: wrap;
}
.lx-check {
    display: inline-flex; align-items: center;
    gap: 8px; cursor: pointer;
    font-size: .82rem; color: var(--lx-muted);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.lx-check input { position: absolute; opacity: 0; pointer-events: none; }
.lx-check-box {
    width: 18px; height: 18px;
    border-radius: 6px;
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    display: grid; place-items: center;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
    flex: 0 0 18px;
}
.lx-check-box::after {
    content: '';
    width: 9px; height: 5px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg) scale(0);
    transition: transform .15s cubic-bezier(.2,.7,.2,1);
    margin-top: -2px;
}
.lx-check input:checked + .lx-check-box {
    background: var(--lx-grad);
    border-color: transparent;
    transform: scale(1.05);
}
.lx-check input:checked + .lx-check-box::after { transform: rotate(-45deg) scale(1); }

.lx-forgot {
    font-size: .82rem;
    font-weight: 600;
    color: #6366F1;
    transition: color .15s ease;
}
.lx-forgot:hover { color: #4F46E5; }

/* Submit button */
.lx-submit {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: var(--lx-grad);
    background-size: 180% 180%;
    background-position: 0% 0%;
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    letter-spacing: .01em;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    box-shadow: 0 14px 28px -12px rgba(139, 92, 246, .50),
                0 4px 10px -3px rgba(236, 72, 153, .35);
    transition: transform .15s ease, box-shadow .25s ease, background-position .6s ease;
    position: relative; overflow: hidden;
}
.lx-submit::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 55%);
    pointer-events: none;
}
.lx-submit:hover {
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow: 0 18px 32px -10px rgba(139, 92, 246, .60),
                0 6px 14px -4px rgba(236, 72, 153, .45);
}
.lx-submit:active { transform: translateY(0); }
.lx-submit > i { transition: transform .2s ease; }
.lx-submit:hover > i { transform: translateX(3px); }

.lx-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lx-spin .6s linear infinite;
}
.lx-submit.loading > i           { display: none; }
.lx-submit.loading .lx-spinner   { display: inline-block; }
.lx-submit.loading               { cursor: progress; }
@keyframes lx-spin { to { transform: rotate(360deg); } }

/* Switch & footer */
.lx-switch {
    text-align: center;
    margin-top: 22px;
    font-size: .85rem;
    color: var(--lx-muted);
}
.lx-switch a {
    font-weight: 700;
    background: var(--lx-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    margin-left: 4px;
}
.lx-foot {
    margin-top: 22px;
    text-align: center;
    font-size: .7rem;
    color: var(--lx-faint);
    letter-spacing: .04em;
}

/* ---------- 7. Right column: features list (no boxes) ------------- */
.lx-side {
    display: none;
}
@media (min-width: 1024px) {
    .lx-side {
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 460px;
        padding: 60px 8vw 60px 0;
        animation: lx-rise .55s cubic-bezier(.2,.7,.2,1) .1s both;
    }
}
@media (min-width: 1280px) {
    .lx-side { padding-right: 6vw; }
}

.lx-side-eyebrow {
    display: inline-flex; align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .10);
    color: #6D28D9;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.lx-side-eyebrow i { font-size: .7rem; }

.lx-side-title {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 0 0 12px;
    color: var(--lx-text);
}
.lx-side-title em {
    font-style: normal;
    background: var(--lx-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lx-side-lead {
    font-size: .95rem;
    color: var(--lx-muted);
    margin: 0 0 26px;
    max-width: 38ch;
    line-height: 1.6;
}

/* Feature list - vertical, NO boxes, just icon + text */
.lx-feat-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    gap: 18px;
}
.lx-feat {
    display: flex; align-items: flex-start;
    gap: 14px;
}
.lx-feat-ico {
    flex: 0 0 38px;
    width: 38px; height: 38px;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(15, 23, 42, .25);
}
.lx-feat-ico.violet { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.lx-feat-ico.pink   { background: linear-gradient(135deg, #F472B6, #DB2777); }
.lx-feat-ico.teal   { background: linear-gradient(135deg, #5EEAD4, #0D9488); }
.lx-feat-ico.amber  { background: linear-gradient(135deg, #FCD34D, #D97706); }
.lx-feat-ico.sky    { background: linear-gradient(135deg, #7DD3FC, #0284C7); }
.lx-feat-ico.rose   { background: linear-gradient(135deg, #FDA4AF, #E11D48); }

.lx-feat-text { flex: 1; min-width: 0; }
.lx-feat-text h4 {
    margin: 0 0 2px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--lx-text);
    letter-spacing: -.01em;
}
.lx-feat-text p {
    margin: 0;
    font-size: .82rem;
    color: var(--lx-muted);
    line-height: 1.5;
}

/* Tiny footer pills under the feature list */
.lx-side-pills {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 26px;
}
.lx-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    background: rgba(15, 23, 42, .04);
    color: #475569;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}
.lx-pill i { font-size: .68rem; }
.lx-pill.v i { color: #8B5CF6; }
.lx-pill.p i { color: #EC4899; }
.lx-pill.t i { color: #14B8A6; }
.lx-pill.a i { color: #F59E0B; }

/* ---------- 8. Toasts (re-used by script.js) ---------------------- */
.toast {
    position: fixed; top: 16px; right: 16px;
    padding: 11px 15px;
    border-radius: 13px;
    font-size: .85rem;
    font-weight: 500;
    z-index: 9999;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .25);
    animation: lx-toast-in .25s cubic-bezier(.2,.7,.2,1), lx-toast-out .25s ease 2.4s forwards;
    max-width: calc(100vw - 32px);
    background: #FFFFFF;
    border: 1px solid var(--lx-border);
}
.toast-success { background: linear-gradient(135deg, #DCFCE7, #ECFDF5); color: #065F46; border-color: #BBF7D0; }
.toast-error   { background: linear-gradient(135deg, #FEE2E2, #FEF2F2); color: #991B1B; border-color: #FECACA; }
@keyframes lx-toast-in  { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lx-toast-out { to   { opacity: 0; transform: translateY(-10px); } }

/* ---------- 9. Tighter mobile (small phones) ---------------------- */
@media (max-width: 380px) {
    .lx-form-col { max-width: 100%; }
    .lx-title    { font-size: 1.35rem; }
    .lx-subtitle { font-size: .85rem; margin-bottom: 18px; }
    .lx-brand    { margin-bottom: 22px; }
    .lx-input    { height: 46px; font-size: .9rem; padding-left: 40px; }
    .lx-input-icon { left: 12px; font-size: 13px; }
    .lx-submit   { height: 48px; font-size: .9rem; }
    .lx-foot     { margin-top: 18px; }
}

/* ---------- 10. Safe-area on notched phones ----------------------- */
@supports (padding: max(0px)) {
    .lx-shell {
        padding-left:   max(16px, env(safe-area-inset-left));
        padding-right:  max(16px, env(safe-area-inset-right));
        padding-top:    max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* ---------- 11. Landscape phones (short height) ------------------- */
@media (max-height: 620px) and (max-width: 1023px) {
    .lx-brand    { margin-bottom: 18px; }
    .lx-subtitle { margin-bottom: 16px; }
    .lx-field    { margin-bottom: 12px; }
    .lx-row      { margin-bottom: 16px; }
    .lx-foot     { display: none; }
}
