* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #010101;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.contenedor {
    flex: 1;
    display: flex;
    min-height: 100vh;
    overflow: visible;
    flex-direction: row;
}

/* ========== BOTÓN VOLVER ========== */
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(47, 47, 47, 0.85);
    border: 1px solid #c6a87d;
    color: #c6a87d;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    z-index: 100;
}

.back-home:hover {
    background: #c6a87d;
    color: #1a1a1a;
    transform: translateY(-2px);
}

/* ========== LADO IZQUIERDO (FORMULARIO) ========== */
.login-section {
    width: 50%;
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 3;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
}

.card {
    background: rgba(47, 47, 47, 0.7);
    backdrop-filter: blur(18px);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    margin: 40px auto 20px 20px;
    border: 1px solid #c6a87d;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: fadeInForm 0.5s ease-out;
}

/* Scroll personalizado */
.card::-webkit-scrollbar {
    width: 6px;
}

.card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.card::-webkit-scrollbar-thumb {
    background: #c6a87d;
    border-radius: 10px;
}

.card::-webkit-scrollbar-thumb:hover {
    background: #d4b38c;
}

.card h3 {
    color: #c6a87d;
    margin-bottom: 30px;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
}

/* ========== INPUTS ========== */
.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #f1f1f1;
    font-size: clamp(13px, 3vw, 14px);
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    box-shadow: 0 0 0 2px #c6a87d;
}

.password {
    position: relative;
}

.password .eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 5px;
}

.password .eye img {
    width: 20px;
    height: auto;
    display: block;
}

/* ========== BOTONES ========== */
.btn-login {
    width: 100%;
    padding: 12px;
    font-size: clamp(14px, 3.5vw, 16px);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: 0.3s ease;
    background: linear-gradient(135deg, #d0802b, rgb(217, 149, 13));
}

.btn-login:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #b08968, #f77f00);
    box-shadow: 0 8px 20px rgba(234, 235, 236, 0.4);
}

.btn-login:active {
    transform: scale(0.98);
}

.register {
    margin-top: 20px;
    font-size: clamp(12px, 3vw, 13px);
    text-align: center;
}

.register a {
    color: #f77f00;
    text-decoration: none;
}

/* ========== LADO DERECHO (IMAGEN) ========== */
.image-section {
    width: 50%;
    position: relative;
    overflow: visible !important;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: transparent;
}

.jaguar {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
}

/* ========== ERRORES ========== */
.login-error {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.12);
    border: 1px solid rgba(255, 77, 79, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(2px);
}

.mostrar-error {
    display: flex !important;
}

#errorJS {
    display: none;
}

#strengthMessage {
    font-size: clamp(12px, 3vw, 14px);
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* ========== SECCIÓN CÓDIGO VERIFICACIÓN ========== */
#seccionCodigo {
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease;
}

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

.reenviar-codigo {
    text-align: center;
    margin-top: 10px;
    font-size: 0.85rem;
}

.reenviar-codigo a {
    color: #a8d5b5;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.reenviar-codigo a:hover {
    color: #4a7c5c;
    text-decoration: underline;
}

.reenviar-mensaje {
    font-size: 0.8rem;
    color: #a8d5b5;
    margin-top: 5px;
    text-align: center;
}

.timer {
    color: #f39c12;
    font-weight: bold;
}

/* ========== ANIMACIONES ========== */
@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================== */
/* ========== MEDIA QUERIES - RESPONSIVE ========== */
/* ===================================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .card {
        max-width: 380px;
        padding: 30px;
        margin: 30px auto 20px 20px;
    }
    
    .card h3 {
        margin-bottom: 25px;
    }
    
    .jaguar {
        width: 90%;
        right: -10px;
    }
}

/* Móviles y tablets pequeñas (hasta 900px) */
@media (max-width: 900px) {
    .contenedor {
        flex-direction: column;
    }

    .login-section {
        width: 100%;
        padding: 15px;
        min-height: auto;
        order: 2;
    }

    .image-section {
        width: 100%;
        height: 280px;
        min-height: 220px;
        max-height: 35vh;
        overflow: visible !important;
        order: 1;
        position: relative;
    }

    .jaguar {
        position: relative;
        width: auto;
        height: 100%;
        max-height: 100%;
        margin: 0 auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        object-fit: contain;
    }

    .card {
        max-width: 100%;
        margin: 15px auto;
        max-height: none;
        padding: 25px 20px;
    }
    
    .back-home {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
        z-index: 20;
        background: rgba(47, 47, 47, 0.95);
    }
    
    .card h3 {
        margin-bottom: 20px;
    }
    
    .input-group input {
        padding: 10px 12px;
    }
    
    .btn-login {
        padding: 10px;
        margin-bottom: 15px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .login-section {
        padding: 10px;
    }
    
    .card {
        padding: 20px 15px;
        margin: 10px auto;
        border-radius: 15px;
    }
    
    .card h3 {
        margin-bottom: 15px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .input-group input {
        padding: 10px;
    }
    
    .btn-login {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .register {
        margin-top: 15px;
    }
    
    .back-home {
        padding: 5px 10px;
        font-size: 11px;
        top: 8px;
        left: 8px;
    }
    
    .image-section {
        height: 220px;
    }
    
    .login-error {
        padding: 10px 12px;
        margin-bottom: 15px;
    }
    
    #strengthMessage {
        margin-top: 3px;
        padding: 6px 10px;
    }
    
    .password .eye img {
        width: 18px;
    }
    
    .password .eye {
        right: 8px;
    }
}

/* Altura pequeña en desktop */
@media (max-height: 700px) and (min-width: 901px) {
    .card {
        margin-top: 15px;
        margin-bottom: 15px;
        padding: 20px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .card h3 {
        margin-bottom: 12px;
    }

    .input-group {
        margin-bottom: 10px;
    }

    .btn-login {
        margin-bottom: 10px;
        padding: 8px;
    }
    
    .back-home {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .login-section {
        padding: 20px;
    }
    
    .jaguar {
        max-height: 90vh;
    }
}

/* Pantallas muy grandes (4K) */
@media (min-width: 1920px) {
    .card {
        max-width: 550px;
        padding: 55px;
        margin: 60px auto 30px 40px;
    }
    
    .card h3 {
        margin-bottom: 45px;
    }
    
    .input-group input {
        padding: 16px;
        font-size: 16px;
    }
    
    .btn-login {
        padding: 16px;
        font-size: 18px;
    }
    
    .jaguar {
        width: 85%;
        right: 30px;
    }
    
    .back-home {
        top: 30px;
        left: 30px;
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .register {
        font-size: 15px;
    }
}

/* Orientación horizontal en móvil */
@media (max-width: 900px) and (orientation: landscape) {
    .contenedor {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .login-section {
        width: 55%;
        padding: 10px;
        min-height: auto;
        order: 1;
    }
    
    .image-section {
        width: 45%;
        height: 100vh;
        position: sticky;
        top: 0;
        order: 2;
        min-height: auto;
    }
    
    .jaguar {
        width: auto;
        height: 85%;
        max-height: 90vh;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .card {
        margin: 10px 0;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .card h3 {
        margin-bottom: 10px;
        font-size: 1.2rem;
    }
    
    .input-group {
        margin-bottom: 8px;
    }
    
    .input-group input {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-login {
        padding: 8px;
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .register {
        margin-top: 10px;
        font-size: 11px;
    }
    
    .back-home {
        top: 5px;
        left: 5px;
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .login-error {
        padding: 6px 10px;
        margin-bottom: 10px;
        font-size: 11px;
    }
}

/* Mejoras de accesibilidad touch en móvil */
@media (max-width: 768px) {
    button, 
    .btn-login,
    .back-home,
    .register a,
    .reenviar-codigo a,
    .password .eye {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    button:active,
    .btn-login:active,
    .back-home:active {
        transform: scale(0.97);
    }
    
    input {
        font-size: 16px !important; /* Previene zoom automático en iOS */
    }
    
    .password .eye {
        padding: 8px 5px;
    }
}

/* Ajustes para pantallas entre 900px y 1024px */
@media (min-width: 901px) and (max-width: 1024px) {
    .card {
        max-width: 360px;
        padding: 25px;
    }
    
    .jaguar {
        width: 100%;
        right: -20px;
    }
}