/* forgot_password.css - Complete styling */

:root {
    --forgot-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --forgot-gradient-dark: linear-gradient(135deg, #434190 0%, #553c9a 100%);
    --captcha-bg: #f8fafc;
    --captcha-border: #e2e8f0;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --error-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    transform: rotate(12deg);
    z-index: 0;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
    background: var(--bg-light);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: slideInUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Card */
.auth-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.auth-logo i {
    font-size: 2rem;
    background: var(--forgot-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

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

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-2px); }
    40%, 60% { transform: translateX(2px); }
}

/* Captcha Styling */
.frontend-captcha {
    background: var(--captcha-bg);
    border: 2px solid var(--captcha-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.frontend-captcha:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.captcha-header label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.captcha-header label i {
    color: var(--primary);
    font-size: 1.125rem;
}

.captcha-refresh {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-refresh:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: rotate(180deg);
}

.captcha-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

.captcha-display {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
}

.captcha-refreshing {
    animation: pulseandspin 0.5s ease;
}

@keyframes pulseandspin {
    0% { opacity: 0.5; transform: scale(0.95) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.02); }
    80% { opacity: 1; transform: rotate(360deg) ; }
    100% { opacity: 1; transform: scale(1) ; }
}

.captcha-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.captcha-question p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.scrambled-word {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.25rem;
    font-family: 'Space Mono', monospace;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid var(--primary);
}

.math-problem {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.captcha-instruction {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.captcha-input-wrapper {
    position: relative;
}

.captcha-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    transition: all 0.3s ease;
}

.captcha-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.captcha-input.error {
    border-color: var(--error);
    animation: shake 0.5s;
}

.captcha-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    justify-content: center;
}

.captcha-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-align: center;
    display: none;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--error);
}

/* Submit Button */
.auth-submit {
    position: relative;
    overflow: hidden;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 16px;
    margin-top: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--forgot-gradient);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(-1px);
}

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

.auth-submit i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Loading Animation */
.auth-submit.loading {
    padding-right: 4rem;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    right: 2rem;
    top: 50%;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Auth Footer */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

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

.text-muted {
    color: var(--text-tertiary) !important;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.text-muted i {
    font-size: 1rem;
}

/* Auth Hero */
.auth-hero {
    background: var(--forgot-gradient);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
    color: var(--primary)
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.15);
}

.feature i {
    font-size: 1.5rem;
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #10b981;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    margin: 2rem 0;
    animation: slideInDown 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-content h3 {
    font-size: 2rem;
    color: #047857;
    margin-bottom: 1rem;
    font-weight: 700;
}

.success-content p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.success-note {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border-left: 4px solid #10b981;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.success-note i {
    color: #10b981;
    font-size: 1.25rem;
}

.success-message .btn {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 350px;
}

.toast {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: right top;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast.toast-out {
    animation: toastSlideOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

.toast i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.toast-message {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    padding: 0.25rem;
    border-radius: 6px;
}

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

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: white;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auth-page {
        background: var(--bg-dark);
    }
    
    .auth-container {
        background: var(--bg-dark);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    
    .form-input {
        background: var(--bg-dark);
        border-color: var(--border-color-dark);
        color: var(--text-dark);
    }
    
    .frontend-captcha {
        background: var(--card-dark);
        border-color: var(--border-color-dark);
    }
    
    .captcha-display {
        background: var(--bg-dark);
        border-color: var(--border-color-dark);
    }
    
    .scrambled-word, .math-problem {
        background: var(--bg-dark);
        border-color: var(--border-color-dark);
    }
    
    .captcha-input {
        background: var(--bg-dark);
        border-color: var(--border-color-dark);
        color: var(--text-dark);
    }
    
    .success-message {
        background: var(--card-dark);
        border-color: #047857;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 1rem;
    }
    
    .auth-hero {
        display: none;
    }
    
    .auth-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .auth-page {
        padding: 1rem;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .scrambled-word {
        font-size: 1.5rem;
        padding: 0.75rem 1.5rem;
    }
    
    .math-problem {
        font-size: 2rem;
        padding: 0.75rem 1.5rem;
    }
    
    .toast-container {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        top: 80px;
    }
    
    .toast {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .feature {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .feature:hover {
        transform: translateY(-5px);
    }
}
/* Global Toast Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

.toast {
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.toast-out {
    animation: toastSlideOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}