/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
    min-height: 100vh;
    overflow: hidden;
}

/* Variables CSS */
:root {
    --background-light: #f8fafc;
    --white: #ffffff;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s ease;
}



@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.main-container{

    display: flex;
    justify-content: space-between;
    align-items: stretch;
    max-width: 1500px;
    min-height: 100vh;
    height: auto;
    margin: 0 auto;
    font-family: 'Nunito', sans-serif;
    position: relative;
}

.form-panel {

    width: 30%; 
    max-width: 100vh;
    max-height: 100vh;
    background: #ffffff;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 2rem;

    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-large);
    
    /* Scroll suave */
    scroll-behavior: smooth;
}
.form-panel::-webkit-scrollbar {
    width: 8px;
}

.form-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-panel::-webkit-scrollbar-thumb {
    background: #c3c3c3;
    border-radius: 10px;
}

.form-panel::-webkit-scrollbar-thumb:hover {
    background: #c3c3c3;
}

.form-container {
    width: auto;
    height: auto; /* Cambiado de 100% a auto */
    min-height: 100%; /* Para que ocupe al menos el alto disponible */
}

.form-header {
    font-family: 'Nunito', sans-serif;
    text-align: center;
    margin-bottom: 2rem;
}

.form-header img{
    width: 15rem;
    height: auto;
    margin-bottom: 1rem;
}

.form-header img:hover {
  transform: scale(1.05); /* Efecto hover sutil */
}

.form-header h2 {
    font-size: 1.7rem;
    color:#fec63d;;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Form Styles */
.register-form {
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input.valid {
    border-color: var(--success-color);
    background-color: rgba(72, 187, 120, 0.05);
}

.form-group input.invalid {
    border-color: var(--error-color);
    background-color: rgba(245, 101, 101, 0.05);
}

#role {
    color: #718096;
}

#role:valid {
    color: #2d3748;
}

/* Password Input Styles */
.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: #f7fafc;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.toggle-icon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}



@keyframes spin {
    to { transform: rotate(360deg); }
}



/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.form-footer p {
    color: var(--text-medium);
    font-size: 0.95rem;
}

/* Loading Overlay */


/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .info-panel {
        padding: 3rem 2rem;
        order: 2;
    }
    
    .form-panel {
        padding: 3rem 2rem;
        order: 1;
    }
    
    .info-content h1 {
        font-size: 2.5rem;
    }
}


/* Animations and Micro-interactions */
.form-group {
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    border-radius: var(--border-radius);
    transition: opacity 0.3s ease;
    z-index: -1;
    transform: scale(1.02);
}

.form-group:focus-within::before {
    opacity: 0.02;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.terms{
    padding-bottom: 2rem;
}

.register-btn{
    display: flex;
    align-items: center;
    justify-content: center;
}

.register{

    background: #fec63d;
    padding: 1rem 2rem;
    font-family: 'Nunito', sans-serif;
    font-size: 21px;
    font-weight: bold;
    color: #ffffff;
    border: none;
    border-radius: 30px;
}

.register:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(254, 198, 61, 50%);
}

.info-panel{

    width: 70%;
    height: auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.info-image {

    max-width: 100%;     /* Nunca más ancha que su contenedor */
    height: auto;
}

.info-image img{

    width: 100%;     /* Nunca más ancha que su contenedor */
    height: 100%;
}


/* ========== MEDIA QUERIES ========== */

/* ========== MÓVIL (≤767px) ========== */
@media (max-width: 767px) {
    .main-container {
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        max-width: 100vw;
        height: 100vh;
        margin: 0 auto;
        font-family: 'Nunito', sans-serif;
        position: relative;
        overflow: auto;
    }

    .form-panel {
        width: 100%; 
        height: 100%;
        background: #ffffff;
        z-index: 2;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 2rem 2rem;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .info-panel {
        display: none;
    }
}

@media (max-width: 767px) and (orientation: landscape) and (max-height: 380px) {
    .main-container {
        display: flex;
        flex-direction: row;
        justify-content: center; /* Centrar horizontalmente */
        align-items: center; /* Centrar verticalmente */
        width: 100vw;
        height: 100vh;
        max-height: 375px;
        margin: 0;
        padding: 0;
        font-family: 'Nunito', sans-serif;
        position: relative;
        overflow: auto;
        background: #ffffff;
    }

    /* ========== FORMULARIO - OCUPA TODO EL ANCHO ========== */
    .form-panel {
        width: 100%; /* 100% del ancho */
        height: 100vh;
        max-height: 375px;
        background: #ffffff;
        display: flex;
        flex-direction: column;
        justify-content: center; /* Centra verticalmente */
        align-items: center;
        padding: 1rem 1.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    /* Ocultar scrollbar */
    .form-panel::-webkit-scrollbar {
        display: none;
    }
    
    .form-panel {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Contenedor del Formulario */
    .form-container {
        width: 100%;
        max-width: 450px; /* Ancho máximo óptimo para landscape */
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0;
    }



    /* Prevenir zoom en iOS */
    @supports (-webkit-touch-callout: none) {
        .form-group input {
            font-size: 16px;
        }
    }

    .form-group input:focus {
        border-color: #38B44A;
        background: #ffffff;
        outline: none;
        box-shadow: 0 0 0 2px rgba(56, 180, 74, 0.1);
    }

    /* Contenedor de Contraseña */
    .password-input-container {
        position: relative;
        width: 100%;
    }

    .password-input-container input {
        padding-right: 40px;
    }

    .password-toggle {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0.3rem;
        font-size: 0.9rem;
        color: #666;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    /* Ocultar password strength indicator */
    .password-strength {
        display: none !important;
    }

    

    

    /* Eliminar hover effects inline */
    .buttonlogin button[onmouseover],
    .buttonlogin button[onmouseout] {
        onmouseover: none !important;
        onmouseout: none !important;
    }

    .buttonlogin button:hover,
    .buttonlogin button:active {
        background: #fec63d;
        transform: translateY(-1px);
    }

    /* Footer del Formulario */
    .form-footer {
        text-align: center;
        margin-top: 0.8rem;
        padding-top: 0.8rem;
        border-top: 1px solid #eee;
        font-size: 0.8rem;
        color: #666;
        width: 100%;
    }



    /* ========== IMAGEN - OCULTA ========== */
    .info-panel {
        display: none !important; /* Forzar ocultar la imagen */
        width: 0;
        height: 0;
        overflow: hidden;
    }

    /* ========== AJUSTES ESPECÍFICOS PARA ANCHO 667px ========== */
    @media (max-width: 667px) and (orientation: landscape) and (max-height: 380px) {
        .form-panel {
            padding: 0.8rem 1.2rem;
        }
        
        .form-container {
            max-width: 420px;
        }
        
        .form-header .logo-link img {
            height: 38px;
        }
        
        .form-header h2 {
            font-size: 1.3rem;
            margin-bottom: 0.9rem;
        }
        
        .form-group input {
            padding: 0.65rem 0.8rem;
            font-size: 0.85rem;
            height: 38px;
        }
        
        .buttonlogin button {
            padding: 0.75rem 1.8rem;
            font-size: 0.9rem;
            height: 42px;
            min-height: 42px;
            max-width: 260px;
        }
    }

    /* ========== CON TECLADO VISIBLE ========== */
    @media (orientation: landscape) and (max-height: 320px) {
        /* Cuando el teclado ocupa parte de la pantalla */
        .form-panel {
            justify-content: flex-start; /* Alinear al inicio */
            padding-top: 0.5rem;
        }
        
        .form-header .logo-link {
            display: none; /* Ocultar logo para ganar espacio */
        }
        
        .form-header h2 {
            font-size: 1.2rem;
            margin-bottom: 0.7rem;
        }
        
        .form-group {
            margin-bottom: 0.7rem;
        }
        
        .form-group input {
            height: 36px;
            padding: 0.6rem 0.7rem;
        }
        
        .buttonlogin {
            margin: 0.8rem 0 0.6rem;
        }
        
        .buttonlogin button {
            height: 40px;
            min-height: 40px;
            padding: 0.7rem 1.6rem;
        }
        
        .form-footer {
            display: none; /* Ocultar footer cuando hay teclado */
        }
    }

    /* ========== SAFE AREAS ========== */
    @supports (padding: max(0px)) {
        .form-panel {
            padding-left: max(1.2rem, env(safe-area-inset-left));
            padding-right: max(1.2rem, env(safe-area-inset-right));
            padding-top: max(1rem, env(safe-area-inset-top));
            padding-bottom: max(1rem, env(safe-area-inset-bottom));
        }
    }

    /* ========== MEJORAS DE ACCESIBILIDAD ========== */
    input, button, a, .password-toggle {
        -webkit-tap-highlight-color: rgba(56, 180, 74, 0.1);
        tap-highlight-color: rgba(56, 180, 74, 0.1);
        touch-action: manipulation;
    }

    .form-group input::placeholder {
        color: #aaa;
        font-size: 0.85rem;
    }

    /* Focus visible para navegación con teclado */
    .form-group input:focus-visible {
        outline: 2px solid #38B44A;
        outline-offset: 2px;
    }

    /* Prevenir selección accidental */
    .form-header h2,
    .form-group label,
    .form-footer p {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Permitir selección en inputs */
    .form-group input {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}



/* ========== TABLETAS PEQUEÑAS (576px - 768px) ========== */
@media (min-width: 576px) and (max-width: 768px) {
    .main-container {
        flex-direction: column;
        max-width: 100%;
        padding: 0;
        min-height: 100vh;
        gap: 0;
    }
    
    /* Imagen - Superior */
    .info-panel {
        width: 100%;
        height: 35vh;
        min-height: 280px;
        order: -1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .info-image {
        width: 100%;
        height: 100%;
    }
    
    .info-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    /* Formulario - Inferior */
    .form-panel {
        width: 100%;
        height: 65vh;
        padding: 1.8rem 1.5rem 2.5rem;
        margin: -25px 0 0 0;
        border-radius: 25px 25px 0 0;
        background: #ffffff;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .form-container {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .form-header .logo-link img {
        height: 50px;
        width: auto;
    }
    
    .form-header h2 {
        font-size: 1.7rem;
    }
    
    .form-group input {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    
}

/* ========== TABLET PORTRAIT (768px - 1024px) ========== */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 0;
        font-family: 'Nunito', sans-serif;
        overflow: hidden;
        background: #ffffff;
    }
    
    /* Formulario - Izquierda (45%) */
    .form-panel {
        width: 45%;
        height: 100vh;
        background: #ffffff;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 2rem 1.8rem;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
    }
    
    .form-container {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .form-header {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .form-header .logo-link img {
        height: 55px;
        width: auto;
        margin-bottom: 1.5rem;
    }
    
    
    .form-group {
        margin-bottom: 1.4rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
        font-weight: 600;
        color: #444;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-group input {
        width: 100%;
        padding: 0.9rem 1.1rem;
        font-size: 1rem;
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        background: #f8f9fa;
        transition: all 0.3s ease;
        min-height: 50px;
    }
    
    .form-group input:focus {
        border-color: #38B44A;
        background: #ffffff;
        outline: none;
    }
    

   
    .form-footer {
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px solid #eee;
        font-size: 0.9rem;
        color: #666;
        text-align: center;
    }
    
    .form-footer p {
        margin-bottom: 0.8rem;
        line-height: 1.5;
    }
    
    .form-footer .link {
        color: #38B44A;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }
    
    .form-footer .link:hover {
        color: #2a8b3a;
        text-decoration: underline;
    }
    
    /* Imagen - Derecha (55%) - ALTURA COMPLETA */
    .info-panel {
        width: 55%;
        height: 100vh; /* ALTURA COMPLETA DE PANTALLA */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .info-image {
        width: 100%;
        height: 100%; /* 100% DEL ALTO */
    }
    
    .info-image img {
        width: 100%;
        height: 100%; /* IMAGEN A ALTO COMPLETO */
        object-fit: cover;
        object-position: center;
    }
    
    /* Scrollbar del formulario */
    .form-panel::-webkit-scrollbar {
        width: 6px;
    }
    
    .form-panel::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .form-panel::-webkit-scrollbar-thumb {
        background: #c3c3c3;
        border-radius: 10px;
    }
    
    .form-panel::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
  
}

/* ========== DESKTOP Y TABLETAS GRANDES (≥1025px) ========== */
@media (min-width: 1025px) {
    .main-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        max-width: 1500px;
        min-height: 100vh;
        height: auto;
        margin: 0 auto;
        font-family: 'Nunito', sans-serif;
        position: relative;
    }
    
    /* Formulario - Izquierda */
    .form-panel {
        width: 30%;
        height: 100vh;
        background: #ffffff;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 2rem 2rem;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Imagen - Derecha - ALTURA COMPLETA */
    .info-panel {
        width: 70%;
        height: 100vh; /* ALTURA COMPLETA */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .info-image {
        width: 100%;
        height: 100%; /* 100% DEL ALTO */
    }
    
    .info-image img {
        width: 100%;
        height: 100%; /* IMAGEN A ALTO COMPLETO */
        object-fit: cover;
        object-position: center;
    }
    
    /* Contenedor del Formulario */
    .form-container {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Logo */
    .form-header .logo-link img {
        height: 60px;
        width: auto;
        margin-bottom: 1rem;
    }
    
    /* Títulos */
    .form-header h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    /* Campos del Formulario */
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }
    
    /* Botón de Iniciar Sesión */
    .buttonlogin button {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
        width: 100%;
        max-width: 350px;
        margin: 2rem auto;
        display: block;
    }
    
    /* Footer del Formulario */
    .form-footer {
        margin-top: 2rem;
        font-size: 0.95rem;
    }
    
    .form-footer p {
        margin-bottom: 1rem;
    }
}

/* ========== ESTILOS COMUNES PARA TODOS LOS DISPOSITIVOS ========== */
/* Asegurar que la imagen siempre ocupe el alto completo */
.info-panel {
    background: #f8f9fa;
}

.info-image img {
    display: block;
}

/* Reset de box shadows en todos los elementos */
.main-container,
.form-panel,
.info-panel,
.buttonlogin button,
.form-group input:focus {
    box-shadow: none !important;
}

/* Prevenir scroll horizontal en toda la página */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Ajustar para orientación landscape en tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .form-panel {
        width: 40%;
    }
    
    .info-panel {
        width: 60%;
    }
    
    .info-image img {
        object-position: center center;
    }
}

/* Ajustes específicos para pantallas muy altas */
@media (min-height: 1200px) {
    .info-image img {
        object-fit: cover;
        object-position: center top;
    }
}

/* Desktop (≥992px) */
@media (min-width: 992px) {

}

/* Desktop Grandes (≥1200px) */
@media (min-width: 1200px) {

}

/* Móviles Pequeños (≤480px) */
@media (max-width: 480px) {

}

