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

:root {
    --auth-ink: #0b1020;
    --auth-muted: #5c6478;
    --auth-line: #e8ecf4;
    --auth-surface: #fafbfd;
    --auth-accent: #5b4dff;
    --auth-accent-2: #00c2d4;
    --auth-accent-hover: #4a3ee8;
    --auth-hero-bg: #0a0f1e;
    --auth-radius: 14px;
    --auth-radius-lg: 22px;
    --auth-panel-w: 460px;
    --auth-banner: url('../images/login-banner-9c72ac70.png');
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    overflow: hidden;
}

body.auth-page {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: var(--auth-ink);
    line-height: 1.55;
    background: var(--auth-ink);
}

/* ─── Shell ─── */
.auth-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ─── Hero (left): full-bleed banner + blurred bottom layer ─── */
.auth-hero {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    background: var(--auth-hero-bg);
    overflow: hidden;
    isolation: isolate;
}

.auth-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Sharp banner — covers left hero, slightly scaled down & shifted up */
.auth-hero-cover {
    position: absolute;
    inset: 0;
    background-image: var(--auth-banner);
    background-repeat: no-repeat;
    background-size: 82% auto;
    background-position: left 90%;
}

/* Transparent blurred layer — bottom portion of the same image */
.auth-hero-blur {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58%;
    background-image: var(--auth-banner);
    background-repeat: no-repeat;
    background-size: 92% auto;
    background-position: left 36%;
    filter: blur(36px) saturate(1.15) brightness(1.05);
    opacity: 0.42;
    transform: scale(1.02);
    transform-origin: left bottom;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
}

.auth-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            to top,
            rgba(8, 12, 26, 0.88) 0%,
            rgba(8, 12, 26, 0.45) 38%,
            rgba(8, 12, 26, 0.12) 68%,
            rgba(8, 12, 26, 0.08) 100%
        ),
        linear-gradient(
            to right,
            transparent 0%,
            transparent 72%,
            rgba(10, 15, 30, 0.55) 88%,
            var(--auth-surface) 100%
        );
}

.auth-hero-copy {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: min(560px, 92%);
    padding: clamp(28px, 4vw, 44px);
    padding-bottom: clamp(32px, 5vh, 52px);
    padding-right: clamp(24px, 4vw, 48px);
}

.auth-hero-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.auth-hero-top img {
    height: clamp(40px, 4.2vw, 52px);
    width: auto;
    filter: brightness(0) invert(1);
}

.auth-badge {
    font-family: 'Outfit', sans-serif;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #c4b5fd;
    background: rgba(91,77,255,.2);
    border: 1px solid rgba(167,139,250,.35);
    padding: 5px 12px;
    border-radius: 999px;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: .72rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 22px;
}
.auth-pill i { color: #67e8f9; }

/* Text block — glass over blurred bottom */
.auth-statement {
    width: 100%;
    background: rgba(8, 12, 26, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--auth-radius-lg);
    padding: 26px 28px 28px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.65rem, 2.8vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.035em;
    line-height: 1.12;
    margin-bottom: 14px;
    text-shadow: 0 2px 24px rgba(0,0,0,.25);
}

.auth-lead {
    font-size: .9rem;
    color: #b8c5d9;
    line-height: 1.7;
}

.auth-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.auth-stat {
    font-size: .68rem;
    font-weight: 600;
    color: #f1f5f9;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    padding: 7px 12px;
    border-radius: 8px;
}

.auth-features {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .8rem;
    font-weight: 500;
    color: #dce4f0;
}
.auth-feature i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91,77,255,.35), rgba(0,194,212,.25));
    color: #a5f3fc;
    font-size: .95rem;
    flex-shrink: 0;
}

/* ─── Right panel ─── */
.auth-panel {
    width: var(--auth-panel-w);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--auth-surface);
    overflow: hidden;
    position: relative;
    z-index: 10;
    border-left: 1px solid var(--auth-line);
    box-shadow: -12px 0 40px rgba(10, 15, 30, 0.12);
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, #d1d9e6 1px, transparent 0);
    background-size: 20px 20px;
    opacity: .35;
    pointer-events: none;
}

.auth-panel-head,
.auth-panel-body,
.auth-footer {
    position: relative;
    z-index: 1;
}

.auth-panel-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 12px;
    gap: 12px;
}

.auth-panel-logo {
    display: none;
    align-items: center;
    gap: 10px;
}
.auth-panel-logo img { height: 32px; width: auto; }

.auth-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.auth-lang label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--auth-muted);
}
.auth-lang select {
    height: 34px;
    padding: 0 28px 0 10px;
    font-size: .78rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%235c6478' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    cursor: pointer;
    color: var(--auth-ink);
}

.auth-panel-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 8px 28px 0;
}

.auth-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 4px;
    background: #eef1f7;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 9px;
    font-family: 'Outfit', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transition: all .2s ease;
}
.auth-tab.is-active {
    background: #fff;
    color: var(--auth-accent);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.auth-alerts {
    flex-shrink: 0;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: .78rem;
    margin-bottom: 14px;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert i { font-size: 1rem; flex-shrink: 0; }

/* Panes — fill remaining height */
.auth-panes {
    flex: 1;
    min-height: 0;
    position: relative;
}

.auth-pane {
    display: none;
    height: 100%;
    flex-direction: column;
    min-height: 0;
}
.auth-pane.is-active { display: flex; }

/* Login: compact, vertically centered */
#pane-login.is-active {
    justify-content: center;
    padding-bottom: 16px;
}

.auth-pane-intro {
    flex-shrink: 0;
}
.auth-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--auth-ink);
}
.auth-sub {
    font-size: .82rem;
    color: var(--auth-muted);
    margin-top: 4px;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Register: scroll ONLY this block */
.auth-pane-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    margin-right: -4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c5cdd9 transparent;
}
.auth-pane-scroll::-webkit-scrollbar { width: 5px; }
.auth-pane-scroll::-webkit-scrollbar-track { background: transparent; }
.auth-pane-scroll::-webkit-scrollbar-thumb {
    background: #c5cdd9;
    border-radius: 10px;
}
.auth-pane-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.auth-pane-actions {
    flex-shrink: 0;
    padding-top: 14px;
    padding-bottom: 4px;
    background: linear-gradient(180deg, rgba(250,251,253,0) 0%, var(--auth-surface) 28%);
}

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #3d4556;
}
.form-hint { font-size: .68rem; color: #94a3b8; margin-top: 3px; }

.form-input,
.form-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: .84rem;
    font-family: inherit;
    border: 1.5px solid var(--auth-line);
    border-radius: 11px;
    background: #fff;
    color: var(--auth-ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus,
.form-select:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(91, 77, 255, 0.12);
}
.form-input.has-icon { padding-left: 38px; }
.form-input.has-toggle { padding-right: 40px; }

.input-wrap { position: relative; }
.input-wrap > i.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .9rem;
    pointer-events: none;
}
.toggle-pass {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #94a3b8;
    padding: 8px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-section {
    font-family: 'Outfit', sans-serif;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--auth-accent);
    margin: 16px 0 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--auth-line);
}
.form-section:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.auth-extras { margin-bottom: 16px; }
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: var(--auth-muted);
    cursor: pointer;
}
.remember input { accent-color: var(--auth-accent); }

.btn-primary {
    width: 100%;
    height: 44px;
    font-family: 'Outfit', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-accent) 0%, #7c3aed 50%, var(--auth-accent-2) 100%);
    background-size: 200% 100%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .15s, box-shadow .2s, background-position .3s;
    box-shadow: 0 4px 20px rgba(91, 77, 255, 0.35);
}
.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(91, 77, 255, 0.4);
}
.btn-primary.loading { pointer-events: none; opacity: .9; }
.btn-primary.loading .btn-label { visibility: hidden; }
.btn-spinner {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .65s linear infinite;
}
.btn-primary.loading .btn-spinner { display: block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-switch {
    margin-top: 14px;
    text-align: center;
    font-size: .78rem;
    color: var(--auth-muted);
}
.auth-switch a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-footer {
    flex-shrink: 0;
    padding: 14px 28px 20px;
    text-align: center;
    font-size: .7rem;
    color: #94a3b8;
    border-top: 1px solid var(--auth-line);
    background: var(--auth-surface);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    .auth-hero-copy { max-width: 94%; }
}

@media (max-width: 900px) {
    .auth-hero { display: none; }
    .auth-panel {
        width: 100%;
        border-left: none;
    }
    .auth-panel-logo { display: flex; }
    html, body.auth-page { overflow: auto; height: auto; }
    .auth-shell { height: auto; min-height: 100dvh; }
    .auth-panel { height: auto; min-height: 100dvh; max-height: none; }
    .auth-panel-body { overflow: visible; min-height: 400px; }
    .auth-panes { min-height: 360px; }
    #pane-register .auth-pane-scroll { max-height: 55vh; }
}

@media (max-width: 520px) {
    .auth-panel-head,
    .auth-panel-body { padding-left: 20px; padding-right: 20px; }
    .form-row { grid-template-columns: 1fr; }
}

html[dir="rtl"] .auth-lang { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .form-input.has-icon { padding-left: 12px; padding-right: 38px; }
html[dir="rtl"] .input-wrap > i.field-icon { left: auto; right: 12px; }
html[dir="rtl"] .auth-pane-scroll { padding-right: 0; padding-left: 6px; }
