/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --error-color: #ef4444;
    --error-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-700);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Main Card */
.forgot-password-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.forgot-password-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(40px, -40px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.icon-container:hover {
    transform: scale(1.05);
}

.lock-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.description {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

/* Form */
.form {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-field {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.2s ease;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field:focus + .input-icon,
.input-field:focus ~ .input-icon {
    color: var(--primary-color);
}

.input-field.error {
    border-color: var(--error-color);
    background: var(--error-light);
}

.input-field.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-field::placeholder {
    color: var(--gray-400);
}

/* Error Message */
.error-message {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--error-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-text {
    transition: opacity 0.2s ease;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    justify-content: center;
}

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

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

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--success-light);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--success-color);
}

.success-message h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.success-message p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.success-message span {
    font-weight: 600;
    color: var(--gray-900);
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

/* Back Link */
.back-link {
    text-align: center;
    margin-bottom: 1.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.back-btn:hover {
    color: var(--gray-900);
    background: var(--gray-50);
    transform: translateX(-2px);
}

.back-icon {
    width: 16px;
    height: 16px;
}

/* Help Text */
.help-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .forgot-password-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .title {
        font-size: 1.75rem;
    }

    .description {
        font-size: 0.875rem;
    }

    .icon-container {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
    }

    .lock-icon {
        width: 24px;
        height: 24px;
    }

    .input-field {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    }

    .submit-btn {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .forgot-password-card {
        padding: 1.5rem 1rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .icon-container {
        width: 56px;
        height: 56px;
    }

    .lock-icon {
        width: 20px;
        height: 20px;
    }
}

/* Animation for form transitions */
.form,
.success-message {
    transition: all 0.3s ease;
}

/* Focus visible for accessibility */
.submit-btn:focus-visible,
.secondary-btn:focus-visible,
.back-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.input-field:focus-visible {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .forgot-password-card {
        border: 2px solid var(--gray-900);
    }

    .input-field {
        border-width: 2px;
    }

    .submit-btn {
        border: 2px solid var(--primary-dark);
    }
}