/* =======================
   BASE (mantengo estilos de botones/inputs)
======================= */
* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #0b0b0b;
    color: #e8e8e8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Fondo cielo global (ocupa toda la pantalla) */
.background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, #4384E2, #ad39d4, #4384E2);
    background-size: 300% 300%;
    animation: moverCielo 18s ease-in-out infinite;
    filter: brightness(0.98);
}
@keyframes moverCielo {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* App container sobre el fondo */
.app-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

/* ----------------------------
   Paneles oscuros (mitades)
   ---------------------------- */
.dark-panel {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 50%;
    background: rgba(29,29,29,0.98);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    z-index: 20;
    overflow: hidden;
    transition: transform 0.78s cubic-bezier(.2,.9,.3,1), opacity 0.5s ease;
    display: flex;
    align-items: stretch; /* para que panel-inner pueda ocupar altura completa */
    justify-content: center;
}

/* derecha visible al inicio */
.right-panel { right: 0; transform: translateX(0%); }
.left-panel  { left: 0;  transform: translateX(-100%); /* fuera */ }

/* Estados de movimiento (clase en app-container) */
.app-container.register-mode .right-panel {
    transform: translateX(100%); /* sale a la derecha */
}
.app-container.register-mode .left-panel {
    transform: translateX(0%);   /* entra desde la izquierda */
}

/* Cuando volvemos a login (sin register-mode) */
.app-container.login-mode .left-panel {
    transform: translateX(-100%); /* off-left */
}
.app-container.login-mode .right-panel {
    transform: translateX(0%); /* on-right */
}

/* panel-inner estructura: logo arriba dentro del panel, content centrado, footer abajo */
.panel-inner {
    position: relative;
    width: 92%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* altura para centrar el contenido: full panel menos espacio para logo y footer */
    height: calc(100vh - 40px);
}

/* Logo dentro del panel (no interfiere; pequeño y centrado) */
.panel-logo {
    margin-top: 18px;
    width: 240px;
    max-width: 80%;
    pointer-events: auto;
    text-align: center;
}
.panel-logo img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.15s ease;
}
.panel-logo img:hover { transform: scale(1.04); }

/* Content: se centra verticalmente dentro de panel-inner */
.panel-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* CENTRADO verticalmente */
    gap: 12px;
    width: 100%;
    padding: 18px 0;
    text-align: center;
}

/* footer dentro del panel (pegado abajo) */
.panel-footer {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #cfcfcf;
    font-size: 13px;
    z-index: 30;
}

/* títulos */
.panel-content h2 { margin: 0 0 6px; font-size: 24px; color: #fff; }

/* inputs y botones (igual que antes) */
input {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 8px;
    border: none;
    background: #222;
    color: #fff;
    font-size: 15px;
}
.primary-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    border-radius: 10px;
    border: none;
    background: #4384E2;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.16s ease;
}
.primary-btn:hover { transform: scale(1.03); }

/* textos auxiliares */
.forgot { margin-top: 6px; color: #bdbdbd; font-size: 14px; }
.switch-text { margin-top: 6px; font-size: 14px; color: #cfcfcf; }
.switch-text span { color: #8ec1ff; cursor: pointer; text-decoration: underline; }

.go-home { margin-top: 8px; }
.go-home a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: #e6e6e6;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.18s ease, transform 0.12s;
}
.go-home a:hover { background: rgba(255,255,255,0.07); transform: translateY(-2px); }

.back-login { margin-top: 8px; color: #8ec1ff; cursor: pointer; }

/* Responsivo */
@media (max-width: 1000px) {
    .dark-panel { width: 100%; }
    .panel-inner { height: calc(100vh - 20px); }
    .panel-logo { width: 200px; margin-top: 12px; }
    .panel-footer { bottom: 12px; font-size: 12px; }
    /* móvil: animación vertical */
    .left-panel { transform: translateY(-100%); left: 0; top: 0; }
    .app-container.register-mode .left-panel { transform: translateY(0%); }
    .app-container.register-mode .right-panel { transform: translateY(100%); }
}

@media (max-width: 600px) {
    .panel-logo { width: 160px; }
    .panel-content h2 { font-size: 22px; }
    input { font-size: 14px; padding: 11px 12px; }
    .primary-btn { font-size: 16px; padding: 12px; }
}
