/**
 * Alice Dashboard Authentication Styles
 * Design System: Dark theme with Indigo accent
 * Designer: MUSE | Frontend Engineer: PIXEL
 */

/* ========================================
   CSS Variables (Design Tokens)
   ======================================== */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-accent: #818cf8;
    
    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Spacing */
    --section-padding: 100px;
    --container-max-width: 1200px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Shadows */
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
    --shadow-focus: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ========================================
   Auth Page Layout
   ======================================== */
.auth-page {
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent);
    pointer-events: none;
    z-index: 0;
}

.auth-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    background: transparent;
}

.auth-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
}

/* ========================================
   Auth Card
   ======================================== */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }
}

/* ========================================
   Auth Header
   ======================================== */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.auth-header p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================
   Form Elements
   ======================================== */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

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

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.auth-form input.error,
.auth-form select.error {
    border-color: var(--error);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password.visible {
    color: var(--primary);
}

/* Error Messages */
.error-message {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--error);
    min-height: 18px;
}

/* ========================================
   Form Options
   ======================================== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    user-select: none;
}

/* Forgot Link */
.forgot-link {
    font-size: 14px;
    color: var(--primary-light);
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

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

.btn-block {
    width: 100%;
}

/* Button Loading State */
.btn .btn-text {
    transition: opacity var(--transition-fast);
}

.btn .btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    opacity: 1;
}

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

/* ========================================
   Password Strength Indicator
   ======================================== */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0;
    background: var(--error);
    transition: all var(--transition-normal);
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Password Requirements */
.password-requirements {
    list-style: none;
    margin-top: 12px;
    padding: 0;
}

.password-requirements li {
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
    transition: color var(--transition-fast);
}

.password-requirements li::before {
    content: '○';
    position: absolute;
    left: 0;
    font-size: 10px;
}

.password-requirements li.met {
    color: var(--success);
}

.password-requirements li.met::before {
    content: '✓';
}

/* ========================================
   Auth Footer
   ======================================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* ========================================
   Success/Error Panels
   ======================================== */
.success-panel,
.error-panel {
    text-align: center;
    padding: 24px 0;
}

.success-icon,
.error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.success-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.error-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.success-panel h3,
.error-panel h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-panel p,
.error-panel p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.success-panel .note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

.dev-note {
    margin-top: 20px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
}

.dev-note p {
    margin-bottom: 8px;
}

.dev-note a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ========================================
   Toast Notifications
   ======================================== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-normal);
    min-width: 280px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast.warning {
    background: var(--warning);
}

.toast.info {
    background: var(--info);
}

@media (max-width: 480px) {
    #toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
    }
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 640px) {
    .auth-container {
        padding: 80px 16px 24px;
    }
    
    .auth-card {
        padding: 28px 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}
