/* =====================================================================
   Forgot Password Page Specific Styles
   ===================================================================== */

/* Page Layout */
.forgot-password-page {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.forgot-password-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('{{ image_url("/images/forgot-password-hero.jpg") }}') center/cover;
    opacity: 0.05;
    z-index: 1;
}

.forgot-password-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    z-index: 2;
}

.forgot-password-container {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: var(--space-2xl) 0;
}

/* Main Card */
.forgot-password-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-smooth);
    position: relative;
}

.forgot-password-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    z-index: -1;
}

.forgot-password-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(212, 175, 55, 0.3);
}

/* Header Section */
.card-header {
    background: var(--gradient-gold);
    color: var(--primary-color);
    text-align: center;
    padding: var(--space-2xl);
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-icon {
    width: 80px;
    height: 80px;
    background: rgba(26, 26, 46, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: var(--text-4xl);
    color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.header-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: rgba(26, 26, 46, 0.1);
    border-radius: var(--radius-full);
    z-index: -1;
    animation: pulse 3s infinite;
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
}

.page-subtitle {
    font-size: var(--text-base);
    color: rgba(26, 26, 46, 0.7);
    margin: 0;
    font-weight: 500;
}

/* Card Body */
.card-body {
    padding: var(--space-2xl);
    position: relative;
}

/* Progress Steps */
.steps-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-2xl);
    gap: var(--space-lg);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all var(--transition-base);
}

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

.step-number {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    transition: all var(--transition-base);
}

.step.active .step-number {
    background: var(--gradient-gold);
    border-color: var(--gold-accent);
    color: var(--primary-color);
    transform: scale(1.1);
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    transition: background-color var(--transition-base);
}

.step-connector.active {
    background: var(--gold-accent);
}

/* Instructions */
.instructions {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--info-color);
}

.instructions-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.instructions-icon {
    color: var(--info-color);
    font-size: var(--text-xl);
    margin-top: 2px;
}

.instructions-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: var(--space-xl);
    position: relative;
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-label .label-icon {
    color: var(--gold-accent);
}

.input-group {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-right: none;
    color: var(--text-secondary);
    padding: var(--space-md) var(--space-lg);
    transition: all var(--transition-base);
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-left: none;
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    transition: all var(--transition-smooth);
}

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

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    color: var(--text-primary);
}

.form-control:focus + .input-group-text,
.input-group:focus-within .input-group-text {
    border-color: var(--gold-accent);
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-accent);
}

.form-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-sm);
}

/* Form Validation */
.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.invalid-feedback {
    color: var(--error-color);
    font-size: var(--text-sm);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.valid-feedback {
    color: var(--success-color);
    font-size: var(--text-sm);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* reCAPTCHA */
.captcha-container {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.g-recaptcha {
    display: inline-block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Submit Button */
.submit-btn {
    background: var(--gradient-gold);
    color: var(--primary-color);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--text-lg);
    font-weight: 700;
    width: 100%;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: var(--primary-color);
}

.submit-btn:disabled {
    background: var(--text-muted);
    transform: none;
    box-shadow: var(--shadow-sm);
    cursor: not-allowed;
}

.submit-btn:disabled::before {
    display: none;
}

/* Loading State */
.btn-loading {
    position: relative;
}

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

.btn-loading .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    font-weight: 500;
}

.back-link:hover {
    color: var(--text-primary);
    border-color: var(--gold-accent);
    background: rgba(212, 175, 55, 0.1);
    transform: translateX(-2px);
}

/* Security Tips */
.security-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

.security-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.security-icon {
    width: 48px;
    height: 48px;
    background: rgba(72, 187, 120, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-color);
    font-size: var(--text-xl);
}

.security-title {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
    font-size: var(--text-xl);
}

.security-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.security-tip:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.tip-icon {
    color: var(--success-color);
    margin-top: 2px;
    font-size: var(--text-sm);
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.alert-success::before {
    background: var(--success-color);
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
}

.alert-danger::before {
    background: var(--error-color);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info-color);
}

.alert-info::before {
    background: var(--info-color);
}

.alert-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.alert-icon {
    font-size: var(--text-xl);
}

.alert-text {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: currentColor;
    opacity: 0.7;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
    .forgot-password-page {
        padding: var(--space-lg) 0;
    }
    
    .forgot-password-card {
        margin: var(--space-lg);
        border-radius: var(--radius-lg);
    }
    
    .card-header {
        padding: var(--space-xl);
    }
    
    .page-title {
        font-size: var(--text-2xl);
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
        font-size: var(--text-2xl);
    }
    
    .card-body {
        padding: var(--space-xl);
    }
    
    .steps-indicator {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-connector {
        display: none;
    }
    
    .instructions {
        padding: var(--space-md);
    }
    
    .instructions-content {
        flex-direction: column;
        text-align: center;
    }
    
    .security-header {
        flex-direction: column;
        text-align: center;
    }
    
    .security-tip {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
}

@media (max-width: 575.98px) {
    .forgot-password-card {
        margin: var(--space-md);
    }
    
    .card-header,
    .card-body {
        padding: var(--space-lg);
    }
    
    .page-title {
        font-size: var(--text-xl);
    }
    
    .submit-btn {
        padding: var(--space-md) var(--space-lg);
        font-size: var(--text-base);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .forgot-password-card {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #ffffff;
    }
    
    .form-control,
    .input-group-text {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ffffff;
        color: #ffffff;
    }
    
    .submit-btn {
        background: #ffff00;
        color: #000000;
        border: 2px solid #ffffff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .forgot-password-card,
    .submit-btn,
    .back-link,
    .form-control,
    .step,
    .step-number {
        transition: none;
        animation: none;
    }
    
    .card-header::before {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .forgot-password-page {
        background: white;
        color: black;
    }
    
    .forgot-password-card {
        background: white;
        border: 1px solid black;
        box-shadow: none;
    }
    
    .card-header {
        background: #f0f0f0;
        color: black;
    }
    
    .submit-btn,
    .back-link,
    .captcha-container {
        display: none;
    }
}

/* Focus Styles for Accessibility */
.form-control:focus,
.submit-btn:focus,
.back-link:focus,
.alert-close:focus {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}