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

/* -- Keyframes -- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideRight {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeSlideLeft {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--bg-main);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* ── Back button ── */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.15);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,.25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .2s;
}
.back-btn:hover { background: rgba(255,255,255,.25); color: white; }

/* ── Layout ── */
.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

/* ── Left panel ── */
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 56px;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,.25), transparent 70%);
    top: -150px; right: -150px;
    border-radius: 50%;
    pointer-events: none;
}
.auth-left::after {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(118,75,162,.2), transparent 70%);
    bottom: -100px; left: -80px;
    border-radius: 50%;
    pointer-events: none;
}
.auth-left-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 56px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeSlideRight .5s ease forwards;
    animation-delay: .1s;
}
.auth-left-logo img { height: 52px; filter: brightness(0) invert(1); }
.auth-left-logo span {
    font-size: 20px;
    font-weight: 700;
    color: white;
}
.auth-left-heading {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 900;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeSlideUp .55s ease forwards;
    animation-delay: .25s;
}
.auth-left-heading span {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-left-sub {
    font-size: 15px;
    color: rgba(255,255,255,.7);
    line-height: 1.7;
    max-width: 360px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeSlideUp .55s ease forwards;
    animation-delay: .4s;
}
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}
.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    opacity: 0;
    animation: fadeSlideUp .5s ease forwards;
}
.auth-feature:nth-child(1) { animation-delay: .55s; }
.auth-feature:nth-child(2) { animation-delay: .68s; }
.auth-feature:nth-child(3) { animation-delay: .81s; }
.auth-feature:nth-child(4) { animation-delay: .94s; }

/* -- Exit animation -- */
.auth-wrapper.exit .auth-right {
    animation: none;
    transition: opacity .25s ease, transform .25s ease;
    opacity: 0 !important;
    transform: translateX(20px);
}
.auth-wrapper.exit .auth-left {
    transition: opacity .3s ease;
    opacity: 0;
}
.auth-feature-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Right panel ── */
.auth-right {
    width: 480px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    background: var(--bg-card);
    overflow-y: auto;
    opacity: 0;
    animation: fadeSlideLeft .55s ease forwards;
    animation-delay: .2s;
}
.auth-card {
    width: 100%;
    max-width: 380px;
}
.auth-card h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.auth-card .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ── Form ── */
.form-field {
    margin-bottom: 18px;
}
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.input-wrap {
    position: relative;
}
.input-wrap input {
    width: 100%;
    padding: 11px 40px 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.input-wrap input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.input-wrap input::placeholder { color: var(--text-muted); }
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    -webkit-user-select: none;
    user-select: none;
    line-height: 1;
}
.password-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Submit button ── */
.btn-auth {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(102,126,234,.4);
    margin-top: 8px;
}
.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102,126,234,.5);
}

/* ── Links ── */
.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.auth-links a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}
.auth-links a:hover { text-decoration: underline; }

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Alert ── */
.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.auth-alert.error {
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.25);
    color: #ef4444;
}
.auth-alert.success {
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.25);
    color: #10b981;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .auth-left { display: none; }
    .auth-right { width: 100%; padding: 40px 24px; }
    .back-btn {
        background: rgba(99,102,241,.12);
        color: #6366f1;
        border-color: rgba(99,102,241,.25);
    }
    .back-btn:hover { background: rgba(99,102,241,.2); color: #6366f1; }
}
