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

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #EEF2FF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --success: #10B981;
    --bg: #F9FAFB;
    --white: #FFFFFF;
    --shadow: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left Panel */
.login-left {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #9333EA 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-branding { max-width: 400px; position: relative; z-index: 1; }

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}
.logo svg { flex-shrink: 0; }
.logo span {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}

.brand-tagline { margin-bottom: 3rem; }
.brand-tagline h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.brand-tagline p {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    line-height: 1.6;
}

.features { display: flex; flex-direction: column; gap: 1.25rem; }
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
}
.feature-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.feature-item strong {
    display: block;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.feature-item span {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

/* Right Panel */
.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.login-card { width: 100%; max-width: 420px; }

.login-header {
    margin-bottom: 2.5rem;
}
.login-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

input.has-error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

input::placeholder { color: #9CA3AF; }

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: var(--transition);
}
.toggle-password:hover { color: var(--primary); background: var(--primary-light); }
.toggle-password svg { width: 18px; height: 18px; }

.field-error {
    font-size: 0.8rem;
    color: var(--error);
    min-height: 1rem;
    display: block;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}
.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-login {
    width: 100%;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.5rem;
    position: relative;
}
.btn-login:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-footer {
    margin-top: 2rem;
    text-align: center;
}
.login-footer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .login-wrapper { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .login-right { padding: 1.5rem; align-items: flex-start; padding-top: 3rem; }
}
