/* ================================
   ESTILOS DE AUTENTICACIÓN
   Paleta de colores BeMotors:
   - Negro: #000000
   - Gris Medio: #8B8B8B
   - Blanco Puro: #FFFFFF
   - Gris Claro: #F5F5F5
   - Negro Acento: #565656
   - Gris Oscuro: #2C2C2C
================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f3f3f3 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 27, 46, 0.3);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #8B8B8B 50%, #000000 50%);
}

/* ================================
   LOGO Y BRANDING
================================ */

.logo-container {
    margin-bottom: 20px;
}

.logo {
    width: auto;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* ================================
   FORMULARIO
================================ */

.login-form {
    text-align: left;
}

.form-title {
    color: #000000;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #2C2C2C;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: #565656;
    width: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #F5F5F5;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #FFFFFF;
    color: #2C2C2C;
}

.form-input:focus {
    outline: none;
    border-color: #565656;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input::placeholder {
    color: #8B8B8B;
}

/* ================================
   CAMPO DE CONTRASEÑA CON TOGGLE
================================ */

.password-input-container {
    position: relative;
}

.password-input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8B8B8B;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #565656;
}

/* Ajustar posición del toggle cuando hay error de campo */
.password-input-container:has(.field-error) .password-toggle,
.password-input-container.has-error .password-toggle {
    transform: translateY(-90%);
}

/* ================================
   BOTONES
================================ */

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #2d2d2d 0%, rgb(101 101 101 / 80%) 100%);
    color: #FFFFFF;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 27, 46, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ================================
   ENLACES Y FOOTER
================================ */

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.forgot-password-link {
    color: #565656;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #000000;
    text-decoration: underline;
}

.forgot-password-link i {
    margin-right: 6px;
}

/* ================================
   ALERTAS
================================ */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.alert-info {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* ================================
   INFORMACIÓN DE DESARROLLO
================================ */

.dev-info {
    margin-top: 30px;
    padding: 20px;
    background: #F5F5F5;
    border-radius: 8px;
    text-align: left;
    border: 1px dashed #8B8B8B;
}

.dev-info h3 {
    color: #000000;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
}

.dev-accounts {
    display: grid;
    gap: 12px;
}

.dev-account {
    background: #FFFFFF;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    border-left: 3px solid #565656;
}

.dev-account strong {
    color: #000000;
}

/* ================================
   LOADER
================================ */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 27, 46, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #FFFFFF;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader p {
    font-size: 16px;
    font-weight: 500;
}

/* ================================
   RESPONSIVE DESIGN
================================ */

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .logo {
        width: auto;
        height: 50px;
    }
    
    .form-title {
        font-size: 20px;
    }
    
    .dev-info {
        padding: 15px;
    }
    
    .dev-accounts {
        gap: 8px;
    }
    
    .dev-account {
        padding: 10px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
}

/* ================================
   ESTADOS DE HOVER PARA MOBILE
================================ */

@media (hover: none) {
    .btn-login:hover {
        transform: none;
        box-shadow: none;
    }
    
    .forgot-password-link:hover {
        text-decoration: none;
    }
}

/* ================================
   ESTILOS ESPECÍFICOS PARA RESET PASSWORD
   Diseño moderno con validación en tiempo real
================================ */

/* Descripción del formulario */
.form-description {
    color: #8B8B8B;
    font-size: 14px;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* ================================
   INDICADOR DE FORTALEZA DE CONTRASEÑA
================================ */

.password-strength {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.password-strength.show {
    opacity: 1;
    transform: translateY(0);
}

.password-strength .very-weak {
    color: #e53e3e;
}

.password-strength .weak {
    color: #dd6b20;
}

.password-strength .fair {
    color: #d69e2e;
}

.password-strength .good {
    color: #38a169;
}

.password-strength .excellent {
    color: #00b894;
    text-shadow: 0 0 10px rgba(0, 184, 148, 0.3);
}

/* ================================
   INDICADOR DE COINCIDENCIA DE CONTRASEÑAS
================================ */

.password-match {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.password-match.valid {
    color: #38a169;
    opacity: 1;
    transform: translateY(0);
}

.password-match.invalid {
    color: #e53e3e;
    opacity: 1;
    transform: translateY(0);
}

.password-match i {
    margin-right: 6px;
}

/* ================================
   REQUISITOS DE CONTRASEÑA
================================ */

.password-requirements {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.password-requirements::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #363636 0%, #7a7a7a 100%);
}

.password-requirements h4 {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-requirements h4::before {
    content: '🔒';
    font-size: 16px;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
    border-radius: 6px;
    padding-left: 8px;
    margin: 2px 0;
}

.password-requirements li i {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.3s ease;
    background: #e2e8f0;
    color: #a0aec0;
}

.password-requirements li.valid {
    color: #38a169;
    background: rgba(56, 161, 105, 0.1);
    transform: translateX(5px);
}

.password-requirements li.valid i {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.3);
    animation: checkmark-bounce 0.5s ease;
}

.password-requirements li.invalid {
    color: #e53e3e;
}

.password-requirements li.invalid i {
    background: #fed7d7;
    color: #e53e3e;
}

@keyframes checkmark-bounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ================================
   CONSEJOS DE SEGURIDAD
================================ */

.security-info {
    background: linear-gradient(135deg, #363636 0%, #7a7a7a 100%);
    border-radius: 16px;
    padding: 25px;
    margin-top: 30px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.security-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: security-glow 3s ease-in-out infinite alternate;
}

@keyframes security-glow {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

.security-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.security-info h3 i {
    font-size: 18px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.security-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.security-tips li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.security-tips li:hover {
    opacity: 1;
    transform: translateX(5px);
}

.security-tips li i {
    color: #48bb78;
    font-size: 14px;
    width: 16px;
    text-align: center;
    text-shadow: 0 0 8px rgba(72, 187, 120, 0.5);
}

/* ================================
   VALIDACIÓN DE CAMPOS
================================ */

.form-input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
    animation: shake 0.5s ease-in-out;
}

/* Estados de validación mejorados */
.form-input.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 40px center;
    background-size: 20px;
}

.form-input.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 40px center;
    background-size: 20px;
    animation: shake 0.5s ease-in-out;
}

/* Mensajes de error de campo */
.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeInError 0.3s ease-in-out;
}

.field-error i {
    font-size: 11px;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Ajustar padding para campos con iconos de validación */
.password-input-container .form-input.is-valid,
.password-input-container .form-input.is-invalid {
    padding-right: calc(2.5em + 0.75rem); /* Espacio para toggle + icono de validación */
}

/* ================================
   ANIMACIONES DE ENTRADA
================================ */

.auth-card {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeInLeft 0.5s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.password-requirements {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.security-info {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   RESPONSIVE PARA RESET PASSWORD
================================ */

@media (max-width: 480px) {
    .password-requirements {
        padding: 15px;
        margin: 15px 0;
    }
    
    .password-requirements h4 {
        font-size: 13px;
    }
    
    .password-requirements li {
        font-size: 12px;
        padding: 6px 0;
    }
    
    .security-info {
        padding: 20px;
        margin-top: 20px;
    }
    
    .security-info h3 {
        font-size: 14px;
    }
    
    .security-tips li {
        font-size: 12px;
    }
    
    .form-description {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .password-requirements {
        padding: 12px;
    }
    
    .security-info {
        padding: 15px;
    }
    
    .password-requirements li {
        font-size: 11px;
    }
    
    .security-tips li {
        font-size: 11px;
    }
}

/* ================================
   ENLACES LEGALES (META Requirements)
================================ */

.legal-links {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(139, 139, 139, 0.2);
    backdrop-filter: blur(10px);
}

.legal-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.legal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #565656;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.legal-link:hover {
    color: #000000;
    background: rgba(139, 139, 139, 0.1);
    transform: translateY(-1px);
}

.legal-link i {
    font-size: 12px;
}

.separator {
    color: #8B8B8B;
    font-weight: 300;
    margin: 0 4px;
}

.legal-notice {
    font-size: 11px;
    color: #8B8B8B;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

/* Responsive para enlaces legales */
@media (max-width: 600px) {
    .legal-links-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .separator {
        display: none;
    }
    
    .legal-link {
        justify-content: center;
        width: 100%;
        max-width: 200px;
    }
    
    .legal-notice {
        font-size: 10px;
        margin-top: 12px;
    }
}