/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff1212 0%, #e2dede 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal */
.recuperar-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    max-width: 1000px;
    width: 100%;
    min-height: 600px;
    position: relative;
}

/* Panel izquierdo - Branding */
.branding-panel {
    flex: 1;
    background: 
        url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
}

/* Overlay oscuro para mejor legibilidad */
.branding-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

/* Overlay con contenido */
.branding-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.branding-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.branding-content .subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: 500;
}

.branding-content .description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.branding-content .signin-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 12px 24px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(255, 18, 18, 0.2);
    backdrop-filter: blur(5px);
}

.branding-content .signin-link:hover {
    background: rgba(255, 18, 18, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Panel derecho - Formulario */
.form-panel {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    position: relative;
}

.form-panel h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Indicador de progreso */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}

.progress-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e1e5e9;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #ff1212;
    color: white;
    transform: scale(1.1);
}

.progress-step.completed {
    background: #22c55e;
    color: white;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 30px;
    height: 2px;
    background: #e1e5e9;
    transform: translateY(-50%);
    z-index: -1;
}

.progress-step.completed:not(:last-child)::after {
    background: #22c55e;
}

/* Formularios por pasos */
.form-step {
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateX(20px);
    position: absolute;
    width: 100%;
    padding: 0 20px;
    pointer-events: none;
}

.form-step.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: all;
}

.form-step h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.form-step p {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: #ff1212;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 18, 18, 0.1);
}

.form-group input::placeholder {
    color: #a0a0a0;
}

/* Botón principal */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff1212 0%, #e2dede 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 18, 18, 0.3);
}

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Botón secundario */
.secondary-btn {
    background: transparent;
    color: #ff1212;
    border: 2px solid #ff1212;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
}

.secondary-btn:hover {
    background: #ff1212;
    color: white;
    transform: translateY(-1px);
}

/* Enlaces */
.links {
    text-align: center;
    margin-top: 30px;
}

.links a {
    color: #ff1212;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.links a:hover {
    color: #cc0e0e;
    text-decoration: underline;
}

/* Mensajes */
.message-container {
    margin-top: 20px;
    min-height: 50px;
}

.message {
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid;
}

.message-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.message-error {
    background: #fef2f2;
    color: #dc2626;
    border-left-color: #ef4444;
}

.message-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #3b82f6;
}

/* Logo */
.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
}

.logo img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Efectos adicionales */
.form-panel {
    position: relative;
}

.form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff1212, #e2dede, #ff1212);
}

/* Mejoras de accesibilidad */
input:focus,
button:focus {
    outline: 2px solid #ff1212;
    outline-offset: 2px;
}

/* Transiciones suaves */
* {
    transition: all 0.3s ease;
}

/* Efecto de carga en botón */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .recuperar-container {
        flex-direction: column;
        max-width: 500px;
        margin: 20px;
    }
    
    .branding-panel {
        min-height: 200px;
        padding: 30px 20px;
    }
    
    .branding-content h1 {
        font-size: 2rem;
    }
    
    .form-panel {
        padding: 40px 30px;
    }
    
    .progress-indicator {
        margin-bottom: 30px;
    }
    
    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .logo {
        position: static;
        text-align: center;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .recuperar-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .form-panel {
        padding: 30px 20px;
    }
    
    .branding-content h1 {
        font-size: 1.8rem;
    }
    
    .branding-content .subtitle {
        font-size: 1rem;
    }
    
    .branding-content .description {
        font-size: 0.9rem;
    }
    
    .progress-step {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    .progress-step:not(:last-child)::after {
        width: 20px;
    }
}

/* Animación de entrada */
.recuperar-container {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de cambio de paso */
.form-step.leaving {
    opacity: 0;
    transform: translateX(-20px);
}

.form-step.entering {
    opacity: 1;
    transform: translateX(0);
}

/* Estilos para el código de verificación */
.code-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.code-digit {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.code-digit:focus {
    outline: none;
    border-color: #ff1212;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 18, 18, 0.1);
}

.code-digit.filled {
    border-color: #ff1212;
    background: #fff5f5;
}

/* Contador de tiempo */
.timer {
    text-align: center;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #666;
}

.timer.warning {
    color: #ff1212;
    font-weight: 600;
}

/* Botón de reenvío */
.resend-btn {
    background: transparent;
    color: #ff1212;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.resend-btn:hover {
    color: #cc0e0e;
}

.resend-btn:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}