:root {
    /* === Auth-Specific Tokens (Isolated from Dashboard) === */
    --auth-bg-panel: #f8fafc;       /* Slate 50 */
    --auth-bg-form: #ffffff;        /* White */
    --auth-text-main: #0f172a;      /* Slate 900 */
    --auth-text-muted: #64748b;     /* Slate 500 */
    --auth-border: #e2e8f0;         /* Slate 200 */
    --auth-border-focus: #4f46e5;   /* Indigo 600 */
    --auth-primary: #4f46e5;        /* Indigo 600 */
    --auth-primary-hover: #4338ca;  /* Indigo 700 */
    --auth-danger: #ef4444;         /* Red 500 */
    
    --font-brand: 'Montserrat', sans-serif;
    --font-ui: 'Inter', sans-serif;
    
    /* Animation Tokens */
    --t-fast: 0.2s ease;
    --shadow-input: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-focus: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* === 1. The "Zero-Padding" Split Layout === */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    overflow-x: hidden;
    background-color: var(--auth-bg-form);
}

.auth-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100vw;
}

/* === 2. Brand Panel (Left) === */
.brand-panel {
    background-color: var(--auth-bg-panel);
    border-right: 1px solid var(--auth-border);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 6vw, 8rem);
    overflow: hidden;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.4;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
}

.brand-quote {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: clamp(2rem, 3vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--auth-text-main);
    margin-bottom: 1.5rem;
}

.feature-list {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--auth-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

/* === 3. Form Panel (Right) === */
.form-panel {
    background-color: var(--auth-bg-form);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.form-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === 4. "Gold Standard" Inputs === */
.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-main);
    margin-bottom: 0.5rem;
    display: block;
}

.input-group {
    position: relative;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 42px;
    font-size: 1rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-bg-form);
    color: var(--auth-text-main);
    transition: all var(--t-fast);
    box-shadow: var(--shadow-input);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    box-shadow: var(--shadow-focus);
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color var(--t-fast);
}

.form-control:focus + .field-icon,
.form-control:focus ~ .field-icon {
    color: var(--auth-primary);
}

/* Validation Styles (Added) */
.was-validated .form-control:invalid {
    border-color: var(--auth-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linecap='round' d='M6 3.5v3M6 8.5h0'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.was-validated .form-control:invalid + .field-icon,
.was-validated .form-control:invalid ~ .field-icon {
    color: var(--auth-danger);
}

.was-validated .form-control:valid {
    border-color: #10b981;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 0;
    z-index: 5;
}
/* Move toggle left if validation icon appears */
.was-validated .form-control:invalid ~ .password-toggle {
    right: 2.5rem; 
}

.password-toggle:hover { color: var(--auth-text-main); }

/* === 5. Buttons === */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--auth-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background-color: var(--auth-primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid var(--auth-border);
    color: var(--auth-text-main);
}

.btn-outline:hover {
    background: var(--auth-bg-panel);
    border-color: #cbd5e1;
}

/* === 6. Responsive Logic (Mobile Stack) === */
@media (max-width: 1024px) {
    .auth-split-layout {
        grid-template-columns: 1fr;
    }
    .brand-panel { display: none; }
    .mobile-header {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }
}

/* === 7. Utilities === */
.text-link { color: var(--auth-primary); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    color: var(--auth-text-muted);
    font-size: 0.85rem;
    margin: 2rem 0;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--auth-border);
}
.auth-divider span { padding: 0 1rem; }

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.alert-error { background: #fef2f2; border: 1px solid #fee2e2; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #dcfce7; color: #166534; }
.alert-info { background: #eff6ff; border: 1px solid #dbeafe; color: #1e40af; }