body { 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    overflow-x: hidden;
}

/* Fondo principal */
body::before{
    content:"";
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background-image: var(--bg);
    background-size:cover;
    background-position:center;
    z-index:-2;
}

.fondo-drop{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background-size:cover;
    background-position:center;
    z-index:-1;
    transform: translateY(-120vh) rotate(-8deg);
    animation: caerBarco 3s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes caerBarco{
    15%{ transform: translateY(-120vh) rotate(-8deg); }
    35%{ transform: translateY(0) rotate(7deg); }
    48%{ transform: translateY(-90px) rotate(-6deg); }
    60%{ transform: translateY(0) rotate(5deg); }
    70%{ transform: translateY(-45px) rotate(-3.5deg); }
    80%{ transform: translateY(0) rotate(2.5deg); }
    88%{ transform: translateY(-18px) rotate(-1.5deg); }
    94%{ transform: translateY(0) rotate(0.8deg); }
    97%{ transform: translateY(-6px) rotate(-0.3deg); }
    100%{ transform: translateY(0) rotate(0deg); }
}

/* Menú superior */
nav { 
    background: rgba(255,255,255,0.2);
    padding: 15px 30px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-sizing: border-box;
}

.logo {    
    width: 100px;    
    padding: 0;
    margin: 0;    
}

.logo img{
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links a { 
    text-decoration: none; 
    color: #333; 
    font-size: 14px; 
    font-weight: 500;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
}

/* Contenedor principal - Ajustado para ser responsivo */
.main-wrapper { 
    flex: 1; 
    display: flex; 
    justify-content: flex-end; /* Alinea el formulario a la derecha */
    align-items: center; 
    padding: 100px 80px 40px 40px; /* Mantén el padding original para el espacio lateral */
    box-sizing: border-box;
    width: 100%;
}

/* Caja login - Ajustada */
.login-container { 
    display: flex; 
    width: 100%; 
    max-width: 800px; /* Cambiado a max-width para que sea flexible */
    height: auto;     /* Cambiado a auto para que se adapte al contenido */
    background: rgba(255,255,255,0.95);
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}

.input-icon{
    position: relative;
}

.input-icon i{
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.input-icon input{
    width: 100%;
    padding: 10px 10px 10px 35px;
    box-sizing: border-box;
}

.right-panel h2{
    text-align: center;
    padding-bottom: 1rem;
}

.left-panel { 
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white; 
    width: 40%; 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    text-align: center;
}

.left-panel h1{
    font-size: 2rem;
    margin: 1rem 0;
}

.right-panel { 
    width: 60%; 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

input { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    box-sizing: border-box; 
}

button { 
    width: 100%; 
    padding: 12px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: bold; 
    margin-top: 10px; 
}

.btn-main:hover {
    box-shadow: 0 7px 20px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

/* Footer */
footer { 
    background: rgba(0,0,0,0.2); 
    color: #fff; 
    padding: 15px 20px; 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    font-size: 1rem; 
    backdrop-filter: blur(5px); 
}
footer p { line-height: 1.5;font-size: 0.9rem; }
footer a { color:#fff; text-decoration:none; font-size:0.9rem; }
footer a:hover { color:#ddd; }
footer h4, footer h3 { color:white; margin-bottom:1px; font-size:0.9rem; }

.loading .container {
  filter: blur(5px);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/*loading*/
.loading .loader-overlay {
  visibility: visible;
  opacity: 1;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
  z-index: 1000;
}

/* CONTENEDOR */
.loader {
  position: relative;
  width: 100px;
  height: 100px;
}

/* PUNTOS */
.loader span {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #1e3a8a;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform-origin: -40px;
  animation: pulse 1.2s linear infinite;
}

/* ANIMACIÓN */
@keyframes pulse {
  0%,100% {
    transform: rotate(var(--i)) translateX(40px) scale(0.6);
    opacity: .4;
  }
  50% {
    transform: rotate(var(--i)) translateX(40px) scale(1.4);
    opacity: 1;
  }
}

@media(max-width: 1024px) {
    .main-wrapper { justify-content: center; padding-right: 20px; padding-left: 20px; }
    .login-container { width: 100%; height: auto; flex-direction: column; }
    .left-panel, .right-panel { width: 100%; box-sizing: border-box; }
}

@media(max-width: 768px) {
    footer { grid-template-columns: 1fr; } /* Footer apilado en móvil */
    
    .main-wrapper {
        justify-content: center;
        padding: 80px 20px 20px 20px;
    }

    .login-container {
        width: 100%;
        flex-direction: column;
        height: auto;
    }

    .left-panel {
        width: 100%;
        text-align: center;
        padding: 30px 20px;
    }

    .right-panel {
        width: 100%;
        padding: 20px;
    }

    /* Menú hamburguesa */
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        background: #fff;
        height: calc(100% - 60px);
        width: 250px;
        flex-direction: column;
        align-items: start;
        padding: 20px;
        gap: 20px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 99;
    }

    .nav-links.show { right: 0; }
    .nav-links a { color: #333; font-weight: 500; }
    .hamburger { display: flex; }
}