/* Authentication Pages Styling - Consistent across login, registration, 2FA */

/* Authentication container */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(22, 190, 207, 0.05), rgba(0, 120, 131, 0.08));
}

/* Main auth card */
.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 0;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 120, 131, 0.1);
}

.auth-card-wide {
    max-width: 700px;
}

/* Auth header */
.auth-header {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.2) 0%, 
        rgba(255,255,255,0.4) 50%, 
        rgba(255,255,255,0.2) 100%);
}

.auth-header h2 {
    margin: 0 0 10px 0;
    font-family: 'Coolvetica', sans-serif;
    font-size: 1.8rem;
    font-weight: normal;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.4;
}

/* Security badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.security-badge i {
    margin-right: 8px;
    font-size: 16px;
}

/* Auth body */
.auth-body {
    padding: 40px;
}

/* Form styling */
.auth-form .form-group {
    margin-bottom: 25px;
}

.auth-form .form-row {
    margin-bottom: 20px;
}

.auth-form .form-row .form-group {
    margin-bottom: 0;
}

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

.auth-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #333;
    line-height: 1.4;
}

.auth-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 120, 131, 0.15);
    outline: none;
}

.auth-form .form-control::placeholder {
    color: #adb5bd;
    opacity: 1;
}

/* Button styling */
.auth-form .btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 120, 131, 0.3);
    filter: brightness(1.05);
}

.auth-form .btn-primary:active {
    transform: translateY(0);
}

.auth-form .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.auth-form .btn-outline-warning {
    border: 2px solid #ffc107;
    color: #ffc107;
    background: transparent;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-form .btn-outline-warning:hover {
    background-color: #ffc107;
    color: #212529;
    transform: translateY(-1px);
}

/* Error handling */
.error-alert {
    background-color: #fff5f5;
    border: 1px solid #fc8181;
    color: #e53e3e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.error-alert ul {
    margin: 0;
    padding-left: 20px;
}

.error-alert p {
    margin: 0;
}

.field-error {
    color: #e53e3e;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Success states */
.success-alert {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Auth divider */
.auth-divider {
    margin: 30px 0;
    position: relative;
    text-align: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef 20%, #e9ecef 80%, transparent);
}

.auth-divider span {
    background: white;
    padding: 0 20px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* Auth footer */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f1f3f4;
}

.auth-footer p {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 14px;
}

.auth-footer .btn-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.auth-footer .btn-link:hover {
    color: #005f66;
    text-decoration: underline;
}

/* QR Code container */
.qr-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.qr-container img {
    max-width: 200px;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Secret code display */
.secret-code {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    color: var(--dark);
}

/* Backup codes display */
.backup-codes-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.backup-code {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

/* Step indicators */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 10px;
    color: #6c757d;
}

.step.active {
    color: var(--primary);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 8px;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

/* Help text and instructions */
.help-text {
    background: #e8f5f5;
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.help-text h6 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.help-text p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.help-text ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.help-text li {
    color: #495057;
    font-size: 14px;
    margin-bottom: 5px;
}

/* Password requirements */
.password-requirements {
    font-size: 13px;
    color: #6c757d;
    margin-top: 8px;
}

.password-requirements ul {
    margin: 5px 0 0 0;
    padding-left: 15px;
}

.password-requirements li {
    margin-bottom: 2px;
}

/* Two-column layout for registration */
.auth-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px 15px;
        min-height: calc(100vh - 150px);
    }
    
    .auth-card {
        margin: 0 10px;
    }
    
    .auth-header {
        padding: 25px 20px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-body {
        padding: 30px 25px;
    }
    
    .auth-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .backup-codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qr-container img {
        max-width: 180px;
    }
    
    .step-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        margin: 0 5px;
        border-radius: 8px;
    }
    
    .auth-header {
        padding: 20px 15px;
    }
    
    .auth-body {
        padding: 25px 20px;
    }
    
    .backup-codes-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-form .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Loading states for auth forms */
.auth-form .btn-primary.loading {
    position: relative;
    color: transparent;
}

.auth-form .btn-primary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Focus management for accessibility */
.auth-form .form-control:focus,
.auth-form .btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--dark);
    }
    
    .auth-form .form-control {
        border-width: 3px;
    }
    
    .auth-form .form-control:focus {
        border-color: var(--dark);
    }
}