*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0f172a;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #1d4ed8;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --gradient-start: #0f172a;
    --gradient-end: #1e3a5f;
    --green: #10b981;
    --red: #ef4444;
    --red-light: #fef2f2;
}

html { height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--surface-alt);
    height: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Left Brand Panel ─── */
.auth-brand {
    display: none;
    width: 480px;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59,130,246,0.15) 0%, transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(59,130,246,0.1) 0%, transparent 50%);
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2.5rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    margin-bottom: 3rem;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(59,130,246,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.auth-logo-icon svg { width: 100%; height: 100%; }

.auth-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand-content h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.auth-brand-content > p {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.auth-brand-feature:hover { background: rgba(255,255,255,0.1); }
.auth-brand-feature svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-light); }

.auth-brand-footer {
    padding-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ─── Right Form Panel ─── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

.auth-form-inner {
    width: 100%;
    max-width: 440px;
}

/* ─── Mobile Logo (shown when brand panel hidden) ─── */
.auth-mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 2rem;
    justify-content: center;
}

.auth-mobile-logo .auth-logo-icon {
    background: var(--accent);
    color: #fff;
}

.auth-mobile-logo .auth-logo-text {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ─── Form Card ─── */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Form Fields ─── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder { color: #94a3b8; }
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-input.is-invalid { border-color: var(--red); }

.form-error {
    font-size: 0.8rem;
    color: var(--red);
    margin-top: 0.3rem;
}

/* ─── Password Toggle ─── */
.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-input { padding-right: 2.8rem; }

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}

.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 18px; height: 18px; }

/* ─── Checkbox / Remember ─── */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-check span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.form-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ─── Buttons ─── */
.btn-auth {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-auth:active { transform: scale(0.98); }

.btn-auth svg { width: 18px; height: 18px; }

/* ─── Divider ─── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Footer Link ─── */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* ─── Alert Messages ─── */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-error {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}

.auth-alert-success {
    background: #f0fdf4;
    color: var(--green);
    border: 1px solid rgba(16,185,129,0.2);
}

/* ─── Responsive ─── */
@media (min-width: 1024px) {
    .auth-brand { display: flex; }
    .auth-mobile-logo { display: none; }
}

@media (max-width: 480px) {
    .auth-card { padding: 1.75rem; border-radius: 12px; }
    .auth-header h2 { font-size: 1.3rem; }
    .auth-form-panel { padding: 1.25rem; }
}
