/* =============================================
   PANEL LATERAL DE LOGIN - Estilos
   partial: panel-login.php
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Panel lateral */
#panelLateral {
    font-family: 'Poppins', sans-serif;
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 100000;
    top: 0;
    right: 0;
    background-color: white;
    overflow-x: hidden;
    overflow-y: auto;
    transition: 0.5s;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    pointer-events: none;
}

#panelLateral.panel-abierto {
    pointer-events: auto;
}

.panel-abierto {
    width: 350px !important;
}

.contenido-panel {
    padding: 40px 20px;
    box-sizing: border-box;
    min-height: 100%;
}

.contenido-panel h2 {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
    color: #333;
    font-size: 24px;
}

/* Inputs del panel */
#panelLateral input[type="text"],
#panelLateral input[type="email"],
#panelLateral input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    box-sizing: border-box;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background-color: #fff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#panelLateral input[type="text"]:focus,
#panelLateral input[type="email"]:focus,
#panelLateral input[type="password"]:focus {
    border-color: #ff9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
}

/* Opciones (Recordarme / Olvidé) */
.opciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 20px;
}

.recordarme {
    display: flex;
    align-items: center;
}

.opciones label {
    margin-left: 5px;
    color: #666;
}

.olvide-contrasena {
    color: #333;
    text-decoration: none;
}

.olvide-contrasena:hover {
    text-decoration: underline;
}

/* Botón principal del panel */
.boton-principal {
    width: 100%;
    background-color: #333;
    color: white;
    padding: 12px 20px;
    margin: 8px 0 20px 0;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.boton-principal:hover {
    background-color: #555;
}

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider:not(:empty)::before { margin-right: .75em; }
.divider:not(:empty)::after  { margin-left:  .75em; }

/* Botones social login */
.social-login {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.social-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
    background: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-decoration: none;
    color: inherit;
}

.social-btn:hover {
    background-color: #f9f9f9;
    color: inherit;
}

.social-btn svg {
    height: 20px;
    width: 20px;
    margin-right: 6px;
}

/* Toggle visibilidad contraseña */
.panel-login__pw-wrap {
    position: relative;
    margin: 8px 0;
}

.panel-login__pw-wrap input[type="password"],
.panel-login__pw-wrap input[type="text"] {
    width: 100%;
    margin: 0;
    padding-right: 44px;
}

#panelLateral .panel-login__pw-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    height: auto;
    background: none !important;
    background-color: transparent !important;
    border: none;
    box-shadow: none;
    cursor: pointer;
    padding: 4px;
    margin: 0;
    color: #999;
    font-size: 15px;
    line-height: 1;
    transition: color 0.2s;
    z-index: 2;
}

#panelLateral .panel-login__pw-toggle:hover {
    color: #ff9900;
}

#panelLateral .panel-login__pw-toggle:focus {
    outline: none;
    box-shadow: none;
}

/* Crear cuenta */
.crear-cuenta {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 40px;
}

.crear-cuenta a,
.switch-link {
    color: #ff9900;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

/* Botón cerrar */
.btn-cerrar {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    line-height: 1;
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    transition: color 0.3s;
}

.btn-cerrar:hover {
    color: #333;
}

/* Modal de sesiones (SweetAlert2) */
.swal-sesiones-modal .list-group-item {
    transition: all 0.3s ease;
}

.swal-sesiones-modal .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.swal2-html-container {
    overflow-y: auto;
    max-height: 400px;
}

.swal2-confirm {
    padding: 10px 20px !important;
    font-weight: 600 !important;
}

/* Utility */
.hidden  { display: none !important; }

/* =============================================
   Selector DUI / Teléfono (registro) — Bento style
   ============================================= */
.reg-id-selector {
    margin: 10px 0 8px;
}

.reg-id-label {
    font-size: 12px;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reg-id-label > i {
    color: #ff9900;
    font-size: 13px;
}

.reg-id-required {
    color: #ff9900;
    font-weight: 700;
}

.reg-id-hint {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
}

/* --- Tarjeta unificada DUI + Teléfono --- */
.reg-id-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.reg-id-card:focus-within {
    border-color: #ff9900;
    box-shadow:
        0 0 0 3px rgba(255, 153, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

.reg-id-card__divider {
    height: 1px;
    background: #f1f1f3;
    margin: 0 12px;
}

.reg-id-field {
    position: relative;
    display: flex;
    align-items: center;
}

.reg-id-field__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
    transition: color 0.18s ease;
}

.reg-id-field__check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    color: #22c55e;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.reg-id-field.is-valid .reg-id-field__icon {
    color: #ff9900;
}

.reg-id-field.is-valid .reg-id-field__check {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

#panelLateral .reg-id-field input,
#panelLateral .reg-id-field input:focus {
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 12px 36px 12px 36px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #1a1a1a;
    outline: none;
}

#panelLateral .reg-id-field input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.reg-id-error {
    color: #dc3545;
    font-size: 12.5px;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.35;
}

/* Overlay */
#overlayPanel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.5s;
}

#overlayPanel.overlay-visible {
    display: block;
    opacity: 1;
}

/* Panel full-screen en móvil */
@media (max-width: 767px) {
    .panel-abierto {
        width: 100% !important;
    }
}

/* =============================================
   SweetAlert siempre por encima del panel-login
   El panel usa z-index 100000 y el overlay 99999,
   por lo que SweetAlert (z-index por defecto 10000/1060)
   queda oculto. Forzamos su capa por encima.
   ============================================= */
.swal2-container {
    z-index: 2147483000 !important;
}

.swal2-backdrop-show,
.swal2-shown > .swal2-container {
    z-index: 2147483000 !important;
}

/* SweetAlert clásico (sweetalert v1), por si se usa */
.sweet-overlay,
.sweet-alert {
    z-index: 2147483001 !important;
}

/* En móviles, el panel ocupa 100% del ancho y tapa
   las alertas. Aseguramos que el contenedor de SweetAlert
   capture eventos y se vea sobre el panel. */
@media (max-width: 767px) {
    .swal2-container {
        position: fixed !important;
        inset: 0 !important;
    }
}
