/* =====================================================================
 * EASRMS - Login Page (Style 4 — Minimal Clean / Notion-style)
 *
 * Performance principles:
 *  - NO animated gradient backgrounds (lx-bg-shift removed)
 *  - NO infinite blob animations (lx-blobs removed)
 *  - NO floating dot animations on mobile
 *  - GPU-friendly transforms only on hover
 *  - All transitions <= 0.25s
 *  - 60fps target on low-end devices
 *
 * Reuses the existing .lx-* markup in index.php (no HTML changes needed).
 * ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    --lx-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Surfaces */
    --lx-bg:        #FAFAFA;
    --lx-surface:   #FFFFFF;
    --lx-surface-2: #F9FAFB;

    /* Text */
    --lx-text:    #111827;
    --lx-text-2:  #4B5563;
    --lx-muted:   #6B7280;
    --lx-faint:   #9CA3AF;

    /* Borders */
    --lx-border:      #E5E7EB;
    --lx-border-2:    #F3F4F6;

    /* Brand (matches app theme) */
    --lx-primary:       #6366F1;
    --lx-primary-hover: #4F46E5;
    --lx-primary-light: #EEF2FF;
    --lx-charcoal:      #111827;

    /* Shadows — soft */
    --lx-shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 1px 3px rgba(17, 24, 39, .03);
    --lx-shadow-md: 0 4px 12px -4px rgba(17, 24, 39, .05);
    --lx-shadow-lg: 0 12px 28px -10px rgba(99, 102, 241, .18), 0 4px 12px -6px rgba(17, 24, 39, .06);
    --lx-shadow-xl: 0 20px 48px -12px rgba(99, 102, 241, .25), 0 8px 18px -8px rgba(17, 24, 39, .08);

    /* Focus ring */
    --lx-focus: 0 0 0 4px rgba(99, 102, 241, .14);

    /* Radii */
    --lx-r-sm: 8px;
    --lx-r-md: 10px;
    --lx-r-lg: 12px;
    --lx-r-xl: 16px;
    --lx-r-2xl: 20px;
    --lx-r-full: 999px;

    /* Transitions */
    --lx-t-fast: .15s ease;
    --lx-t:      .2s ease;
}

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

/* ---------- 3. Subtle stripe bg (desktop only, NO animation) ---------- */
@media (min-width: 1024px) {
    body.lx-page::before {
        content: '';
        position: fixed; inset: 0; z-index: 0;
        pointer-events: none;
        background:
            linear-gradient(45deg, transparent 49.6%, var(--lx-border) 49.6%, var(--lx-border) 50.4%, transparent 50.4%);
        background-size: 32px 32px;
        opacity: .12;
    }
}

/* ---------- 4. Hide ALL decorative dots / rings ---------- */
.lx-dots, .lx-d, .lx-ring { display: none !important; }

/* ---------- 5. Shell layout ---------- */
.lx-shell {
    position: relative; z-index: 1;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
}

/* ---------- 6. Form column ---------- */
.lx-form-col {
    flex: 1 1 50%;
    max-width: 560px;
    margin: 0 auto;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--lx-surface);
    border-right: 1px solid var(--lx-border);
}
@media (max-width: 1024px) {
    .lx-form-col {
        max-width: 480px;
        padding: 44px 32px;
        border-right: none;
    }
}
@media (max-width: 640px) {
    .lx-form-col {
        max-width: 100%;
        padding: 32px 20px;
        background: var(--lx-bg);
    }
}

/* Brand */
.lx-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px;
}
.lx-brand-mark {
    width: 44px; height: 44px;
    border-radius: var(--lx-r-lg);
    background: linear-gradient(135deg, var(--lx-charcoal), #4338CA);
    color: #fff;
    display: grid; place-items: center;
    font-size: 18px;
    box-shadow: 0 4px 12px -4px rgba(67, 56, 202, .35);
}
.lx-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.lx-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lx-text);
    letter-spacing: -.01em;
}
.lx-brand-sub {
    font-size: .72rem;
    font-weight: 500;
    color: var(--lx-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 2px;
}

/* Title */
.lx-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--lx-text);
    margin: 0 0 8px;
    letter-spacing: -.02em;
}
.lx-subtitle {
    font-size: .92rem;
    color: var(--lx-muted);
    margin: 0 0 24px;
    line-height: 1.55;
}

/* Alerts */
.lx-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--lx-r-lg);
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid;
}
.lx-alert i { flex-shrink: 0; margin-top: 2px; font-size: .92rem; }
.lx-alert.warn  { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.lx-alert.info  { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.lx-alert.error { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }

/* Form */
.lx-form { display: flex; flex-direction: column; gap: 16px; }
.lx-field { display: flex; flex-direction: column; }
.lx-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--lx-text);
    margin-bottom: 6px;
}

/* Inputs */
.lx-input-wrap { position: relative; }
.lx-input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--lx-faint);
    font-size: .92rem;
    transition: color var(--lx-t-fast);
    pointer-events: none;
}
.lx-input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-r-lg);
    background: var(--lx-surface);
    color: var(--lx-text);
    font-family: inherit;
    font-size: .94rem;
    transition: border-color var(--lx-t-fast), box-shadow var(--lx-t-fast);
}
.lx-input::placeholder { color: var(--lx-faint); }
.lx-input:hover { border-color: #D1D5DB; }
.lx-input:focus {
    outline: none;
    border-color: var(--lx-primary);
    box-shadow: var(--lx-focus);
}
.lx-input:focus + .lx-input-icon,
.lx-input-wrap:focus-within .lx-input-icon { color: var(--lx-primary); }
.lx-input.has-toggle { padding-right: 44px; }
.lx-eye {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    color: var(--lx-muted);
    border-radius: var(--lx-r-sm);
    cursor: pointer;
    display: grid; place-items: center;
    transition: background var(--lx-t-fast), color var(--lx-t-fast);
}
.lx-eye:hover { background: var(--lx-surface-2); color: var(--lx-text); }

/* Row: remember + forgot */
.lx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.lx-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--lx-text-2);
    user-select: none;
}
.lx-check input { position: absolute; opacity: 0; pointer-events: none; }
.lx-check-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--lx-border);
    border-radius: 5px;
    background: #fff;
    display: grid; place-items: center;
    transition: all var(--lx-t-fast);
    position: relative;
}
.lx-check-box::after {
    content: '';
    width: 10px; height: 10px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23ffffff' d='M13.485 4.515a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L6.778 9.808l5.293-5.293a1 1 0 0 1 1.414 0z'/></svg>") no-repeat center / contain;
    opacity: 0;
    transition: opacity var(--lx-t-fast);
}
.lx-check input:checked + .lx-check-box {
    background: var(--lx-primary);
    border-color: var(--lx-primary);
}
.lx-check input:checked + .lx-check-box::after { opacity: 1; }
.lx-check:hover .lx-check-box { border-color: var(--lx-primary); }
.lx-forgot {
    font-size: .85rem;
    font-weight: 600;
    color: var(--lx-primary);
    transition: color var(--lx-t-fast);
}
.lx-forgot:hover { color: var(--lx-primary-hover); text-decoration: underline; }

/* Submit button — Style 4 charcoal -> indigo */
.lx-submit {
    margin-top: 8px;
    height: 48px;
    border: none;
    border-radius: var(--lx-r-md);
    background: var(--lx-charcoal);
    color: #fff;
    font-weight: 600;
    font-size: .94rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background var(--lx-t-fast), transform var(--lx-t-fast), box-shadow var(--lx-t-fast);
    position: relative;
}
.lx-submit i { transition: transform var(--lx-t-fast); }
.lx-submit:hover {
    background: var(--lx-primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .45);
}
.lx-submit:hover i { transform: translateX(3px); }
.lx-submit:active { transform: translateY(0); }
.lx-submit.loading { pointer-events: none; opacity: .85; }
.lx-submit.loading .lx-submit-text,
.lx-submit.loading > i:not(.lx-spinner) { opacity: .4; }
.lx-spinner {
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lx-spin .7s linear infinite;
    opacity: 0;
    transition: opacity var(--lx-t-fast);
}
.lx-submit.loading .lx-spinner { opacity: 1; }
@keyframes lx-spin { to { transform: rotate(360deg); } }

/* Switch link */
.lx-switch {
    margin-top: 22px;
    font-size: .88rem;
    color: var(--lx-muted);
    text-align: center;
}
.lx-switch a {
    color: var(--lx-primary);
    font-weight: 600;
    transition: color var(--lx-t-fast);
}
.lx-switch a:hover { color: var(--lx-primary-hover); text-decoration: underline; }

/* Footer */
.lx-foot {
    margin-top: 30px;
    font-size: .75rem;
    color: var(--lx-faint);
    text-align: center;
}

/* ---------- 7. Divider ---------- */
.lx-divider { display: none; }

/* ---------- 8. Side (features list) ---------- */
.lx-side {
    flex: 1 1 50%;
    padding: 56px 48px;
    background: var(--lx-bg);
    overflow-y: auto;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 1024px) {
    .lx-side { display: none; }
}

.lx-side-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: var(--lx-primary-light);
    color: var(--lx-primary);
    border-radius: var(--lx-r-full);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    width: fit-content;
    margin-bottom: 18px;
}
.lx-side-eyebrow i { font-size: .78rem; }

.lx-side-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--lx-text);
    line-height: 1.2;
    letter-spacing: -.022em;
    margin: 0 0 14px;
    max-width: 560px;
}
.lx-side-title em {
    font-style: normal;
    color: var(--lx-primary);
    background: linear-gradient(135deg, var(--lx-primary), #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lx-side-lead {
    font-size: .94rem;
    color: var(--lx-muted);
    margin: 0 0 28px;
    line-height: 1.6;
    max-width: 560px;
}

/* Feature list — Style 4 cards */
.lx-feat-list {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 560px;
}
@media (max-width: 1280px) {
    .lx-feat-list { grid-template-columns: 1fr; }
}
.lx-feat {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-r-lg);
    transition: border-color var(--lx-t), box-shadow var(--lx-t), transform var(--lx-t);
    will-change: transform;
}
.lx-feat:hover {
    border-color: var(--lx-primary);
    box-shadow: var(--lx-shadow-lg);
    transform: translateY(-2px);
}
.lx-feat-ico {
    width: 38px; height: 38px;
    border-radius: var(--lx-r-md);
    display: grid; place-items: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background var(--lx-t), color var(--lx-t);
}
.lx-feat-ico.violet { background: #EDE9FE; color: #7C3AED; }
.lx-feat-ico.pink   { background: #FCE7F3; color: #DB2777; }
.lx-feat-ico.teal   { background: #CCFBF1; color: #0D9488; }
.lx-feat-ico.amber  { background: #FEF3C7; color: #D97706; }
.lx-feat-ico.sky    { background: #E0F2FE; color: #0284C7; }
.lx-feat-ico.rose   { background: #FFE4E6; color: #E11D48; }

/* On hover: invert each color */
.lx-feat:hover .lx-feat-ico.violet { background: #7C3AED; color: #fff; }
.lx-feat:hover .lx-feat-ico.pink   { background: #DB2777; color: #fff; }
.lx-feat:hover .lx-feat-ico.teal   { background: #0D9488; color: #fff; }
.lx-feat:hover .lx-feat-ico.amber  { background: #D97706; color: #fff; }
.lx-feat:hover .lx-feat-ico.sky    { background: #0284C7; color: #fff; }
.lx-feat:hover .lx-feat-ico.rose   { background: #E11D48; color: #fff; }

.lx-feat-text { min-width: 0; }
.lx-feat-text h4 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--lx-text);
    margin: 0 0 2px;
    letter-spacing: -.005em;
}
.lx-feat-text p {
    font-size: .8rem;
    color: var(--lx-muted);
    margin: 0;
    line-height: 1.45;
}

/* Side pills */
.lx-side-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 560px;
}
.lx-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--lx-r-full);
    font-size: .76rem;
    font-weight: 600;
    background: var(--lx-surface);
    color: var(--lx-text-2);
    border: 1px solid var(--lx-border);
    transition: border-color var(--lx-t-fast), color var(--lx-t-fast);
}
.lx-pill i { font-size: .78rem; color: var(--lx-primary); }
.lx-pill:hover {
    border-color: var(--lx-primary);
    color: var(--lx-text);
}

/* ---------- 9. Mobile (<= 640px) — only form ---------- */
@media (max-width: 640px) {
    .lx-shell { display: block; }
    .lx-form-col {
        min-height: 100dvh;
        min-height: 100vh;
    }
    .lx-title { font-size: 1.55rem; }
    .lx-input { height: 44px; font-size: .92rem; }
    .lx-submit { height: 46px; }
    .lx-brand { margin-bottom: 22px; }
    .lx-brand-mark { width: 40px; height: 40px; font-size: 16px; }
}

/* Tiny phones */
@media (max-width: 380px) {
    .lx-form-col { padding: 28px 16px; }
    .lx-title { font-size: 1.4rem; }
    .lx-subtitle { font-size: .86rem; }
    .lx-row { gap: 8px; }
    .lx-forgot { font-size: .8rem; }
}

/* Landscape phones */
@media (max-height: 480px) and (orientation: landscape) and (max-width: 900px) {
    .lx-form-col {
        padding: 24px 32px;
        justify-content: flex-start;
    }
    .lx-brand { margin-bottom: 12px; }
    .lx-title { font-size: 1.3rem; margin-bottom: 4px; }
    .lx-subtitle { margin-bottom: 14px; }
    .lx-form { gap: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    body.lx-page::before { display: none; }
}

/* ---------- 10. Performance ---------- */
.lx-feat, .lx-submit, .lx-input, .lx-pill { transform: translateZ(0); }
.lx-side { contain: layout style; }
