:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-input: #f8fafc;
    
    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-focus: #4f46e5;
    --ring-color: rgba(79, 70, 229, 0.2);
    
    /* Spacing & Sizing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.auth-container {
    display: flex;
    height: 100%;
    width: 100%;
}

.auth-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: var(--bg-surface);
    overflow-y: auto;
    max-width: 540px;
    width: 100%;
    border-right: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    gap: 2rem; /* Ensure minimum spacing between content and footer */
}

.auth-visual {
    flex: 1.5;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
    overflow: hidden;
}

/* Patterns/Overlay for Visual Side */
.auth-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 20%);
    pointer-events: none;
}

/* New Visual Content Styles */
.visual-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: 0 auto;
}

.visual-inner {
    margin-top: 3rem;
}

.visual-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.visual-desc {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Glass Card Illustration */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.glass-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-avatar {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}

.card-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.card-info p {
    font-size: 0.75rem;
    opacity: 0.8;
}

.card-body {
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Auth Content */
.auth-wrapper {
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
}

.brand svg {
    width: 32px;
    height: 32px;
}

.heading {
    margin-bottom: 0.5rem;
}

.heading h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

.subheading {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-social:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.input-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--ring-color);
}

.form-input.error {
    border-color: var(--danger);
    background-color: #fef2f2;
}

.form-input.success {
    border-color: var(--success);
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

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

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition-fast);
    height: 0;
    overflow: hidden;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-top: 0.5rem;
}

/* Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    user-select: none;
}

.link-forgot {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link-forgot:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-submit.loading .spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-terms {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.form-terms a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-terms a:hover {
    text-decoration: underline;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Global Alert */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

/* Global Footer Base Styles */
.auth-global-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Push to bottom */
    width: calc(100% + 4rem); /* Full width including sidebar padding compensation */
    margin-left: -2rem;
    margin-right: -2rem;
    /* margin-bottom removed to lift up from bottom edge */
    background: var(--bg-surface);
}

.auth-global-footer span {
    margin: 0 0.5rem;
}

.auth-global-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-global-footer a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-visual {
        display: none;
    }
    
    .auth-sidebar {
        max-width: 100%;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }
    
    .auth-wrapper {
        max-width: 400px;
    }

    /* Fix footer width/margins to match new sidebar padding */
    .auth-global-footer {
        width: calc(100% + 3rem);
        margin-left: -1.5rem;
        margin-right: -1.5rem;
    }
}

@media (max-width: 640px) {
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .auth-global-footer {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem;
    }
    
    .auth-global-footer span {
        display: none;
    }
}
