:root {
    --auth-deep: #322a53;
    --auth-deep-2: #423a73;
    --auth-primary: #6d5dd0;
    --auth-accent: #ab78c9;
    --auth-success: #3f9b7a;
    --auth-bg: #f4f3f7;
    --auth-surface: #ffffff;
    --auth-border: #e8e5ef;
    --auth-text: #3a3647;
    --auth-muted: #827d94;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--auth-text);
    background: var(--auth-bg);
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

.auth-splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    color: #fff;
    background: var(--auth-deep);
    transition: opacity .35s ease, visibility .35s ease;
}

.auth-splash.is-hidden,
.auth-splash.skip { opacity: 0; visibility: hidden; pointer-events: none; }

.auth-splash.skip { transition: none; }

.splash-mark { position: relative; width: 92px; height: 92px; display: grid; place-items: center; }
.splash-mark img { width: 68px; height: 68px; object-fit: cover; border-radius: 18px; position: relative; z-index: 2; }
.splash-ring { position: absolute; inset: 0; border: 2px solid rgba(255,255,255,.22); border-top-color: var(--auth-accent); border-radius: 50%; animation: splash-spin .9s linear infinite; }
.splash-word { font-size: 1.35rem; font-weight: 800; letter-spacing: 0; }
.splash-word span { color: #d7a7e7; }
.splash-track { width: 160px; height: 3px; background: rgba(255,255,255,.14); overflow: hidden; border-radius: 3px; }
.splash-track span { display: block; height: 100%; width: 42%; background: #fff; animation: splash-track 1s ease-in-out infinite; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 5vw, 72px);
    color: #fff;
    background-color: var(--auth-deep);
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 48px 48px;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent), var(--auth-success));
}

.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; width: fit-content; }
.auth-brand img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.auth-brand strong { display: block; font-size: 1.08rem; line-height: 1.15; }
.auth-brand strong span, .auth-mobile-brand strong span { color: #d7a7e7; }
.auth-brand small { display: block; color: #c9c1df; font-size: .68rem; }

.auth-brand-copy { position: relative; z-index: 1; max-width: 620px; margin-block: auto; padding-block: 52px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); color: #d8d1e9; font-size: .75rem; font-weight: 700; }
.auth-brand-copy h1 { margin: 18px 0 8px; font-size: 3.8rem; line-height: 1; font-weight: 800; letter-spacing: 0; }
.auth-brand-copy p { max-width: 520px; margin: 0; color: #d4cde5; font-size: 1rem; line-height: 1.8; }

.auth-signal-board { position: relative; z-index: 1; width: min(100%, 580px); border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.055); backdrop-filter: blur(8px); }
.signal-head, .signal-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.signal-head { font-size: .65rem; color: #bfb6d8; font-weight: 800; }
.signal-head strong { color: #9ee0c7; }
.signal-row { font-size: .75rem; color: #ddd7eb; }
.signal-row span { display: inline-flex; align-items: center; gap: 9px; }
.signal-row i { width: 18px; color: #d7a7e7; text-align: center; }
.signal-row b { color: #9ee0c7; font-size: .7rem; }
.signal-bars { height: 42px; display: flex; align-items: end; gap: 5px; padding: 9px 14px; }
.signal-bars i { flex: 1; min-height: 5px; background: rgba(171,120,201,.62); animation: signal-pulse 1.7s ease-in-out infinite alternate; }
.signal-bars i:nth-child(2) { height: 45%; animation-delay: .1s; }
.signal-bars i:nth-child(3) { height: 80%; animation-delay: .2s; }
.signal-bars i:nth-child(4) { height: 35%; animation-delay: .3s; }
.signal-bars i:nth-child(5) { height: 65%; animation-delay: .4s; }
.signal-bars i:nth-child(6) { height: 48%; animation-delay: .5s; }
.signal-bars i:nth-child(7) { height: 90%; animation-delay: .6s; }
.signal-bars i:nth-child(8) { height: 55%; animation-delay: .7s; }

.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: var(--auth-surface); }
.auth-form-wrap { width: min(100%, 430px); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-mobile-brand img { width: 42px; height: 42px; object-fit: cover; border-radius: 11px; }
.auth-mobile-brand strong { font-size: 1.08rem; color: var(--auth-deep); }

.auth-form-head { margin-bottom: 30px; }
.auth-form-icon { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--auth-primary); background: #eeeafd; border-radius: 12px; }
.auth-form-head h2 { margin: 14px 0 4px; color: var(--auth-deep); font-size: 1.65rem; font-weight: 800; letter-spacing: 0; }
.auth-form-head p { margin: 0; color: var(--auth-muted); font-size: .86rem; }

.validation-summary { display: none; margin-bottom: 18px; padding: 11px 13px; color: #a53f59; background: #fae8ec; border: 1px solid #f2cbd4; border-radius: 10px; font-size: .78rem; }
.validation-summary.validation-summary-errors { display: block; }
.validation-summary ul { margin: 0; padding-left: 18px; }

.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 700; color: var(--auth-text); }
.auth-input-wrap { position: relative; }
.auth-input-wrap > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #9891aa; font-size: .88rem; pointer-events: none; }
.auth-input-wrap input { width: 100%; height: 48px; padding: 0 42px 0 46px; border: 1px solid var(--auth-border); border-radius: 11px; outline: none; color: var(--auth-text); background: #fcfbfe; font-family: inherit; font-size: .86rem; transition: border-color .18s, box-shadow .18s, background .18s; }
.auth-input-wrap input:focus { border-color: var(--auth-primary); background: #fff; box-shadow: 0 0 0 3px rgba(109,93,208,.13); }
.password-toggle { position: absolute; inset-inline-end: 7px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: #8c859e; border-radius: 8px; }
.password-toggle:hover { color: var(--auth-primary); background: #f0edfb; }
.field-validation { display: block; min-height: 18px; margin-top: 4px; color: #b04a62; font-size: .7rem; }

.auth-remember { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; cursor: pointer; color: var(--auth-muted); font-size: .77rem; }
.auth-remember input { width: 17px; height: 17px; accent-color: var(--auth-primary); }
.auth-submit { width: 100%; height: 49px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 11px; color: #fff; background: var(--auth-primary); font-family: inherit; font-size: .88rem; font-weight: 800; transition: background .18s, transform .18s; }
.auth-submit:hover { background: var(--auth-deep-2); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--auth-border); color: var(--auth-muted); font-size: .68rem; text-align: center; }
.auth-foot i { margin-inline-end: 5px; color: var(--auth-success); }

@keyframes splash-spin { to { transform: rotate(360deg); } }
@keyframes splash-track { from { transform: translateX(-110%); } to { transform: translateX(350%); } }
@keyframes signal-pulse { from { opacity: .45; transform: scaleY(.72); transform-origin: bottom; } to { opacity: 1; transform: scaleY(1); transform-origin: bottom; } }

@media (max-width: 920px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 30px 20px; }
    .auth-mobile-brand { display: flex; }
}

@media (max-width: 420px) {
    .auth-form-panel { place-items: start center; padding-top: 24px; }
    .auth-form-head { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
