:root {
    --lp-brand:       #4f46e5;
    --lp-brand-h:     #4338ca;
    --lp-brand-2:     #7c3aed;
    --lp-brand-lt:    #eef2ff;
    --lp-ring:        rgba(79,70,229,.14);

    --lp-bg:          #f8fafc;
    --lp-surface:     #ffffff;
    --lp-muted:       #f8fafc;
    --lp-text:        #0f172a;
    --lp-text-2:      #475569;
    --lp-text-3:      #94a3b8;
    --lp-border:      #e2e8f0;
    --lp-border-h:    #cbd5e1;
    --lp-sh-lg:       0 24px 64px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
}

[data-theme="dark"] {
    --lp-bg:          #0b1120;
    --lp-surface:     #111827;
    --lp-muted:       #0f172a;
    --lp-brand-lt:    rgba(99,102,241,.16);
    --lp-ring:        rgba(129,140,248,.22);
    --lp-text:        #f1f5f9;
    --lp-text-2:      #cbd5e1;
    --lp-text-3:      #64748b;
    --lp-border:      #1f2a3d;
    --lp-border-h:    #334155;
    --lp-sh-lg:       0 24px 64px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--lp-bg);
    color: var(--lp-text);
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    background: #0f172a;
    color: #fff;
    min-height: 100vh;
}
.auth-showcase-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    animation: auth-zoom 18s ease-out forwards;
}
@keyframes auth-zoom { to { transform: scale(1); } }
.auth-showcase-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(15,23,42,.55) 0%, rgba(15,23,42,.15) 35%, rgba(15,23,42,.85) 100%),
        linear-gradient(135deg, rgba(79,70,229,.35) 0%, transparent 60%);
}
.auth-showcase-inner {
    position: relative; z-index: 1;
    height: 100%;
    display: flex; flex-direction: column;
    padding: 40px 48px;
}
.auth-showcase-brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff; text-decoration: none;
    font-size: 18px; font-weight: 800; letter-spacing: -.3px;
    align-self: flex-start;
}
.auth-showcase-logo { max-height: 44px; max-width: 180px; object-fit: contain; }
.auth-showcase-copy { margin-top: auto; max-width: 520px; }
.auth-showcase-title {
    font-size: clamp(26px, 1.4rem + 1.2vw, 38px);
    font-weight: 800; line-height: 1.15; letter-spacing: -.8px;
    margin: 0 0 14px;
}
.auth-showcase-text {
    font-size: 15px; line-height: 1.65;
    color: rgba(255,255,255,.78);
    margin: 0 0 28px;
}
.auth-showcase-features {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 10px;
}
.auth-showcase-features li {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.auth-showcase-features i { color: #c7d2fe; font-size: 14px; }
.auth-showcase-foot {
    margin: 40px 0 0;
    font-size: 12.5px; color: rgba(255,255,255,.55);
}

.auth-main {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 88px 24px 48px;
    background:
        radial-gradient(600px 400px at 100% 0%, rgba(99,102,241,.07), transparent 70%),
        radial-gradient(500px 360px at 0% 100%, rgba(168,85,247,.05), transparent 70%),
        var(--lp-bg);
}

.auth-card {
    width: 100%; max-width: 420px;
    animation: auth-rise .5s cubic-bezier(.16,1,.3,1) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(12px); } }
.auth-card--wide { max-width: 460px; }

.auth-brand {
    display: none; align-items: center; gap: 9px;
    font-size: 18px; font-weight: 800; color: var(--lp-text);
    text-decoration: none; margin-bottom: 32px; letter-spacing: -.3px;
}
.auth-brand-icon {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, var(--lp-brand), var(--lp-brand-2));
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(79,70,229,.35);
    flex-shrink: 0;
}
.auth-brand-icon i { color: #fff; font-size: 17px; }
.auth-brand-logo { max-height: 44px; max-width: 180px; object-fit: contain; }

.auth-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--lp-brand);
    background: var(--lp-brand-lt);
    padding: 5px 10px; border-radius: 999px;
    margin-bottom: 14px;
}
[data-theme="dark"] .auth-eyebrow { color: #a5b4fc; }

.auth-form-title {
    font-size: 30px; font-weight: 800; color: var(--lp-text);
    letter-spacing: -.8px; line-height: 1.15; margin: 0 0 8px;
}
.auth-form-sub {
    font-size: 14.5px; color: var(--lp-text-2); line-height: 1.6;
    margin: 0 0 30px;
}
.auth-form-sub a { color: var(--lp-brand); font-weight: 600; text-decoration: none; }
.auth-form-sub a:hover { text-decoration: underline; }

.auth-field { margin-bottom: 18px; }
.auth-field-label {
    font-size: 13px; font-weight: 600; color: var(--lp-text);
    margin-bottom: 7px; display: block;
}
.auth-field-input-wrap { position: relative; }
.auth-field-input-wrap > i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--lp-text-3); font-size: 16px; pointer-events: none;
    transition: color .18s;
}
.auth-field-input-wrap:focus-within > i:not(.auth-pw-toggle) { color: var(--lp-brand); }
.auth-input {
    width: 100%; height: 50px; padding: 0 16px 0 44px;
    border: 1.5px solid var(--lp-border); border-radius: 12px;
    font-size: 14.5px; color: var(--lp-text); background: var(--lp-surface); outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.auth-input::placeholder { color: var(--lp-text-3); }
.auth-input:hover { border-color: var(--lp-border-h); }
.auth-input:focus { border-color: var(--lp-brand); box-shadow: 0 0 0 4px var(--lp-ring); }
.auth-input--purple:focus { border-color: var(--lp-brand-2); box-shadow: 0 0 0 4px rgba(124,58,237,.12); }
.auth-input.is-invalid { border-color: #ef4444; }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.auth-input--has-toggle { padding-right: 46px; }
.invalid-feedback { font-size: 12.5px; color: #ef4444; margin-top: 6px; display: block; }

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--lp-text);
    -webkit-box-shadow: 0 0 0 1000px var(--lp-surface) inset;
    box-shadow: 0 0 0 1000px var(--lp-surface) inset;
    caret-color: var(--lp-text);
}

.auth-field-input-wrap .auth-pw-toggle {
    position: absolute; left: auto; right: 8px;
    top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--lp-text-3); font-size: 16px;
    pointer-events: auto; cursor: pointer;
    transition: background .18s, color .18s;
}
.auth-field-input-wrap .auth-pw-toggle:hover { color: var(--lp-brand); background: var(--lp-brand-lt); }

.auth-pw-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.auth-pw-row a { font-size: 13px; color: var(--lp-brand); text-decoration: none; font-weight: 600; }
.auth-pw-row a:hover { text-decoration: underline; }

.auth-remember { display: flex; align-items: center; gap: 9px; margin: 6px 0 24px; }
.auth-remember input { width: 17px; height: 17px; accent-color: var(--lp-brand); cursor: pointer; margin: 0; }
.auth-remember label { font-size: 13.5px; color: var(--lp-text-2); cursor: pointer; user-select: none; }

.auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.auth-submit {
    width: 100%; height: 50px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, var(--lp-brand) 0%, var(--lp-brand-2) 100%);
    color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .1px;
    box-shadow: 0 8px 20px -6px rgba(79,70,229,.55), inset 0 1px 0 rgba(255,255,255,.15);
    transition: transform .2s, box-shadow .2s, filter .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(79,70,229,.6), inset 0 1px 0 rgba(255,255,255,.15); filter: brightness(1.06); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--lp-ring); }
.auth-submit:disabled { opacity: .8; cursor: not-allowed; transform: none; filter: none; }

.auth-submit-loading { display: flex; align-items: center; gap: 8px; }
.auth-spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: auth-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-secure {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 28px 0 0; padding-top: 22px;
    border-top: 1px solid var(--lp-border);
    font-size: 12.5px; color: var(--lp-text-3);
}
.auth-secure i { color: #10b981; font-size: 14px; }

.auth-terms {
    font-size: 12px; color: var(--lp-text-3); text-align: center;
    margin-top: 14px; line-height: 1.6;
}
.auth-terms a { color: var(--lp-brand); text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

.auth-alert {
    border-radius: 12px; padding: 12px 14px;
    font-size: 13.5px; margin-bottom: 22px;
    display: flex; align-items: flex-start; gap: 9px; line-height: 1.5;
}
.auth-alert i { margin-top: 1px; }
.auth-alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.auth-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.auth-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
[data-theme="dark"] .auth-alert-error   { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.3);  color: #fca5a5; }
[data-theme="dark"] .auth-alert-info    { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.3); color: #93c5fd; }
[data-theme="dark"] .auth-alert-success { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.3);  color: #86efac; }

.auth-toolbar {
    position: absolute; top: 24px; inset-inline-end: 24px; z-index: 2;
}
.auth-toolbar-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: var(--lp-surface); color: var(--lp-text-2);
    border: 1px solid var(--lp-border); cursor: pointer;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: color .18s, border-color .18s;
}
.auth-toolbar-btn:hover { color: var(--lp-brand); border-color: var(--lp-brand); }
.auth-toolbar .dropdown-menu { font-size: 13px; border-radius: 12px; padding: 6px; border-color: var(--lp-border); box-shadow: var(--lp-sh-lg); }
.auth-toolbar .dropdown-item { border-radius: 8px; padding: 7px 10px; }
.auth-toolbar .dropdown-item.active { background: var(--lp-brand); }

.auth-back { display: block; text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--lp-brand); text-decoration: none; font-weight: 600; }
.auth-back:hover { text-decoration: underline; }

[dir="rtl"] .auth-eyebrow { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .auth-field-input-wrap > i { left: auto; right: 15px; }
[dir="rtl"] .auth-input { padding: 0 44px 0 16px; }
[dir="rtl"] .auth-input--has-toggle { padding-left: 46px; }
[dir="rtl"] .auth-field-input-wrap .auth-pw-toggle { right: auto; left: 8px; }
[dir="rtl"] .auth-showcase-overlay { background:
        linear-gradient(180deg, rgba(15,23,42,.55) 0%, rgba(15,23,42,.15) 35%, rgba(15,23,42,.85) 100%),
        linear-gradient(225deg, rgba(79,70,229,.35) 0%, transparent 60%); }

@media (max-width: 991.98px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .auth-main { min-height: 100vh; }
    .auth-brand { display: flex; }
    .auth-card {
        background: var(--lp-surface);
        border: 1px solid var(--lp-border);
        border-radius: 20px;
        box-shadow: var(--lp-sh-lg);
        padding: 40px 36px;
        max-width: 460px;
    }
}

@media (max-width: 480px) {
    .auth-main { padding: 76px 16px 32px; }
    .auth-card { padding: 30px 22px; border-radius: 18px; }
    .auth-form-title { font-size: 26px; }
    .auth-field-row { grid-template-columns: 1fr; gap: 0; }
    .auth-toolbar { top: 18px; inset-inline-end: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-showcase-img, .auth-card { animation: none; transform: none; }
}
