* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2691e7;
    --primary-hover: #1f7ac4;
    --primary-light: #e8f2fc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --red-500: #ef4444;
    --green-500: #22c55e;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --radius: 16px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #fafdff 0%, #e6edf7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin: 0;
}

.reset-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 440px;
    width: 100%;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.2s;
}

.reset-card:hover {
    transform: translateY(-2px);
}

.reset-header {
    text-align: center;
    margin-bottom: 2rem;
}

.reset-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

.reset-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--gray-900);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 145, 231, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--gray-300);
}

.captcha-row {
    display: flex;
    gap: 0.75rem;
}

.captcha-row .input-wrapper {
    flex: 1;
}

.captcha-row .input-wrapper input {
    padding-right: 1rem;
}

.captcha-btn {
    flex-shrink: 0;
    padding: 0 1rem;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
    white-space: nowrap;
}

.captcha-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.captcha-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--gray-500);
}

.password-strength {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    gap: 2px;
}

.strength-bar .segment {
    flex: 1;
    height: 100%;
    background: var(--gray-200);
    transition: background 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    min-width: 44px;
    text-align: right;
    font-weight: 500;
}

.error-message {
    color: var(--red-500);
    font-size: 0.8rem;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-message svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.submit-btn {
    margin-top: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.15s, box-shadow var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(38, 145, 231, 0.3);
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(38, 145, 231, 0.35);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.submit-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.submit-btn.loading .spinner {
    display: block;
}

.submit-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.reset-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.reset-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.reset-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.success-state {
    display: none;
    text-align: center;
    padding: 1.5rem 0;
}

.success-state .checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #d1fae5;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.success-state .checkmark svg {
    width: 32px;
    height: 32px;
    stroke: var(--green-500);
    stroke-width: 2.5;
    fill: none;
}

.success-state h2 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 600;
}

.success-state p {
    color: var(--gray-500);
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

.success-state .back-login {
    margin-top: 1.5rem;
    display: inline-block;
    background: var(--gray-100);
    padding: 0.6rem 1.8rem;
    border-radius: 40px;
    color: var(--gray-700);
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.success-state .back-login:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

@media (max-width: 480px) {
    .reset-card {
        padding: 1.75rem 1.25rem;
    }
    .reset-header h1 {
        font-size: 1.5rem;
    }
    .captcha-row {
        flex-direction: column;
    }
    .captcha-row .input-wrapper {
        width: 100%;
    }
    .captcha-btn {
        width: 100%;
    }
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition);
}

.toggle-password:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.toggle-password img {
    width: 20px;
    height: 20px;
    display: block;
}