@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #fbbf24;
    --primary-dark: #f59e0b;
    --primary-light: #fcd34d;
    --secondary-color: #ef4444;
    --secondary-dark: #dc2626;
    --accent-color: #14b8a6;
    
    /* Colores de texto */
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563;
    --text-light: #6b7280;
    --text-white: #ffffff;
    
    /* Colores de fondo */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    
    /* Bordes */
    --border-color: #e5e7eb;
    --border-focus: var(--primary-color);
    --border-error: var(--secondary-color);
    --border-success: #22c55e;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Body y Layout */
body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

.forgot-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(165deg, #fafafa 0%, #f5f5f5 30%, #e8f5f3 70%, #d1f5ef 100%);
    position: relative;
    overflow-x: hidden;
}

/* Efectos de fondo animados */
.forgot-body::before,
.forgot-body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.forgot-body::before {
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
    animation: floatBubble 15s ease-in-out infinite;
}

.forgot-body::after {
    bottom: -15%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.06) 0%, transparent 70%);
    animation: floatBubble 20s ease-in-out infinite reverse;
}

@keyframes floatBubble {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.6;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
        opacity: 0.9;
    }
}

.navbar {
    height: 85px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 26, 26, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 10px 0.2rem 10px 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-smooth);
    will-change: transform;
}

.logo img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.navbar .logo img {
    width: 240%;
    height: 240%;
    object-fit: contain;
    filter: invert(1) drop-shadow(0 4px 12px rgba(20, 184, 166, 0.4));
}

.navbar .logo:hover {
    transform: scale(1.08) rotate(8deg);
    filter: drop-shadow(0 6px 20px rgba(20, 184, 166, 0.6));
    will-change: transform, filter;
}

.brand-name {
    font-family: 'Great Vibes', cursive;
    font-size: 2.8rem;
    font-weight: 400;
    background: linear-gradient(90deg, #a7f3d0 0%, #fef08a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    padding-left: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.back-btn:hover {
    background: linear-gradient(135deg, var(--secondary-dark), #b91c1c);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.45);
}

.back-btn:active {
    transform: translateY(-1px);
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    position: relative;
    z-index: 10;
}

/* Forgot Container */
.forgot-container {
    width: 100%;
    max-width: 700px;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    padding: var(--spacing-2xl);
    animation: floatIn 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.forgot-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border-radius: 50%;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.icon-wrapper svg {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.forgot-title {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
}

.forgot-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.6;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideDown 0.5s ease-out;
}

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

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.alert svg {
    flex-shrink: 0;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-left: 5px solid var(--border-error);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #14532d;
    border-left: 5px solid var(--border-success);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.2);
}

/* Form */
.forgot-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.required {
    color: var(--secondary-color);
}

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

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition-base);
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all var(--transition-smooth);
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-input:hover {
    border-color: #d1d5db;
    background: var(--bg-white);
}

.form-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1), 0 8px 20px rgba(251, 191, 36, 0.15);
    transform: translateY(-2px);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.form-hint.match {
    color: var(--border-success);
    font-weight: 600;
}

.form-hint.no-match {
    color: var(--border-error);
    font-weight: 600;
}

.toggle-password {
    position: absolute;
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-base);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

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

/* Password Strength */
.password-strength {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    height: 4px;
}

.strength-bar {
    background: var(--border-color);
    border-radius: 2px;
    transition: background var(--transition-base);
}

.strength-bar.weak {
    background: var(--secondary-color);
}

.strength-bar.medium {
    background: #f59e0b;
}

.strength-bar.strong {
    background: var(--border-success);
}

.strength-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.strength-text.weak {
    color: var(--secondary-color);
}

.strength-text.medium {
    color: #f59e0b;
}

.strength-text.strong {
    color: var(--border-success);
}

/* Password Requirements */
.form-requirements {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.requirements-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.requirements-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-light);
    transition: color var(--transition-base);
}

.requirement svg {
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.requirement.met {
    color: var(--border-success);
}

.requirement.met svg circle {
    fill: var(--border-success);
    stroke: var(--border-success);
}

/* Submit Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: 18px 52px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.35);
    margin-top: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s, top 0.6s, left 0.6s;
    transform: translate(-50%, -50%);
}

.btn-submit:hover::before {
    width: 400px;
    height: 400px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-dark), #d97706);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(251, 191, 36, 0.45);
}

.btn-submit:active {
    transform: translateY(-2px);
}

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

/* Spinner animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Form Footer */
.form-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.divider {
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.link-back {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all var(--transition-base);
    position: relative;
}

.link-back::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--secondary-dark));
    transition: width var(--transition-base);
}

.link-back:hover {
    color: var(--secondary-dark);
    transform: translateX(-4px);
}

.link-back:hover::after {
    width: 100%;
}

/* Help Section */
.help-section {
    margin-top: var(--spacing-xl);
}

.help-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(251, 191, 36, 0.02));
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
}

.help-card svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.help-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.help-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .forgot-container {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .forgot-title {
        font-size: 1.5rem;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .back-btn span {
        display: none;
    }

    .icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .icon-wrapper svg {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .forgot-container {
        padding: var(--spacing-lg);
    }

    .forgot-title {
        font-size: 1.35rem;
    }

    .forgot-subtitle {
        font-size: 0.9rem;
    }

    .form-input {
        font-size: 0.95rem;
        padding: 14px 18px 14px 44px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}