/* Authentication Pages Styles */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px;
    position: relative;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    z-index: 2;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0;
}

.auth-header h2 {
    color: var(--primary-light);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Form styles */
.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.input-with-icon i {
    position: absolute;
    left: 12px;
    color: #777;
    z-index: 1;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.9);
}

.input-with-icon input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
    background: white;
}

.input-with-icon input.error {
    border-color: var(--danger-color);
}

.error-text {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

/* CAPTCHA styles */
.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.8rem;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.captcha-code {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    color: var(--primary-color);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.captcha-code::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0,0,0,0.05) 50%, transparent 70%);
    pointer-events: none;
}

.btn-refresh {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: var(--primary-light);
    transform: rotate(90deg);
}

/* Buttons */
.btn-auth {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

/* Auth links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

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

.auth-links p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* Alert messages */
.auth-alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.auth-alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* System info */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    color: #666;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 2rem 1.5rem;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

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

/* Two-factor authentication */
.two-factor-section {
    text-align: center;
    padding: 20px;
}

.qr-code {
    margin: 20px auto;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    display: inline-block;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-family: monospace;
    font-size: 1.1rem;
}

.backup-code-item {
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    text-align: center;
    border-radius: 3px;
}