/* ========================================
   1. RESET Y CONFIGURACIÓN GLOBAL
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 50%, #bd2130 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 20px;
    -webkit-text-size-adjust: 100%;
}

/* ========================================
   2. CONTENEDOR PRINCIPAL
======================================== */
.login-page-grid {
    background: rgba(255, 255, 255, 0.98);
    padding: clamp(20px, 4vw, 50px);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ========================================
   3. ESTRUCTURA BASE (MÓVIL)
======================================== */
.login-header {
    width: 100%;
    text-align: center;
}

.form-column {
    width: 100%;
}

.sucursal-column {
    width: 100%;
}

/* ========================================
   4. LOGO Y HEADER
======================================== */
.logo-container {
    text-align: center;
    margin-bottom: 15px;
}

.bull-icon {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    margin: 0 auto 15px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #f8f9fa;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.bull-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-header h1 {
    color: #dc3545;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.1;
}

.login-header p {
    color: #6c757d;
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 500;
}

/* ========================================
   5. TÍTULOS DE SECCIÓN
======================================== */
.column-title {
    color: #dc3545;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 5px;
    text-align: center;
}

.column-subtitle {
    color: #666;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    margin-bottom: 20px;
    text-align: center;
}

/* ========================================
   6. FORMULARIO Y INPUTS
======================================== */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #dc3545;
    font-weight: 600;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    background: #f8f9fa;
    color: #495057;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: #dc3545;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input:focus + .input-icon {
    color: #dc3545;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.toggle-password:hover {
    color: #dc3545;
}

.login-button {
    width: 100%;
    padding: clamp(14px, 3vw, 16px);
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.2);
    min-height: 48px;
}

.login-button:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(220, 53, 69, 0.3);
}

.login-button:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.forgot-password-link {
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    display: block;
    text-align: center;
    margin-top: 20px;
    transition: color 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: #a71d2a;
}

.error-msg {
    color: #dc3545;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* ========================================
   7. LISTA DE SUCURSALES
======================================== */
.search-group {
    margin-bottom: 15px;
}

.sucursal-list-container {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #dc3545 #f1f1f1;
}

.sucursal-list-container::-webkit-scrollbar {
    width: 6px;
}

.sucursal-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sucursal-list-container::-webkit-scrollbar-thumb {
    background-color: #dc3545;
    border-radius: 4px;
}

.sucursal-card {
    display: flex;
    align-items: center;
    padding: clamp(12px, 2vw, 15px);
    background: #fff;
    border: 2px solid #f1f3f5;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
    -webkit-appearance: none;
    min-height: 60px;
}

.sucursal-card:hover:not(.is-selected) {
    border-color: #dc3545;
    background: #fff5f5;
    transform: translateX(4px);
}

.sucursal-card.is-selected {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    box-shadow: 0 8px 15px rgba(220, 53, 69, 0.2);
}

.sucursal-icon {
    font-size: clamp(1.4rem, 3vw, 1.6rem);
    margin-right: clamp(12px, 2vw, 15px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(40px, 8vw, 45px);
    height: clamp(40px, 8vw, 45px);
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s;
}

.sucursal-card.is-selected .sucursal-icon {
    background: rgba(255, 255, 255, 0.2);
}

.sucursal-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sucursal-name {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.sucursal-location {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: #868e96;
}

.sucursal-card.is-selected .sucursal-location {
    color: rgba(255, 255, 255, 0.85);
}

.selection-indicator {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-left: 10px;
    display: none;
}

.sucursal-card.is-selected .selection-indicator {
    display: block;
}

.list-status {
    text-align: center;
    color: #adb5bd;
    padding: 20px;
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* ========================================
   8. MEDIA QUERIES - RESPONSIVE COMPLETO
======================================== */

/* TABLET VERTICAL (600px - 767px) */
@media screen and (min-width: 600px) and (max-width: 767px) {
    .login-page-grid {
        max-width: 550px;
        padding: 30px;
    }
    
    .sucursal-list-container {
        max-height: 300px;
    }
    
    .column-title,
    .column-subtitle {
        text-align: left;
    }
}

/* TABLET HORIZONTAL (768px - 1023px) */
@media screen and (min-width: 768px) {
    .login-page-grid {
        max-width: 750px;
        padding: 40px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "header header"
            "form sucursal";
        gap: 30px;
        align-items: start;
    }

    .login-header {
        grid-area: header;
        text-align: center;
    }

    .form-column {
        grid-area: form;
    }

    .sucursal-column {
        grid-area: sucursal;
        border-left: 1px solid #e9ecef;
        padding-left: 30px;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .column-title,
    .column-subtitle {
        text-align: left;
    }

    .sucursal-list-container {
        max-height: 350px;
        flex-grow: 1;
    }
}

/* TABLET GRANDE / DESKTOP PEQUEÑO (900px - 1023px) */
@media screen and (min-width: 900px) and (max-width: 1023px) {
    .login-page-grid {
        max-width: 850px;
        padding: 45px;
    }
    
    .sucursal-list-container {
        max-height: 400px;
    }
}

/* DESKTOP (1024px - 1199px) */
@media screen and (min-width: 1024px) {
    .login-page-grid {
        max-width: 950px;
        padding: 50px;
        grid-template-columns: 1fr 1.1fr;
        gap: 20px 50px;
    }

    .login-header {
        text-align: left;
    }

    .logo-container {
        text-align: left;
    }

    .bull-icon {
        margin: 0 0 15px 0;
    }

    .login-header h1,
    .login-header p {
        text-align: left;
    }

    .sucursal-column {
        padding-left: 40px;
    }

    .sucursal-list-container {
        max-height: 450px;
    }
}

/* DESKTOP GRANDE (1200px+) */
@media screen and (min-width: 1200px) {
    .login-page-grid {
        max-width: 1100px;
        padding: 60px;
        grid-template-columns: 1fr 1.2fr;
        gap: 20px 60px;
    }

    .sucursal-column {
        padding-left: 50px;
    }

    .sucursal-list-container {
        max-height: 500px;
    }
}

/* PANTALLAS MUY GRANDES (1400px+) */
@media screen and (min-width: 1400px) {
    .login-page-grid {
        max-width: 1200px;
    }
}

/* ========================================
   9. ESTILOS DE MODALES
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal[style*="display: flex"] {
    opacity: 1;
}

.modal-content {
    background: #fff;
    padding: clamp(25px, 4vw, 30px);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    color: #333;
}

.modal[style*="display: flex"] .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: clamp(2.5rem, 6vw, 3rem);
    margin-bottom: 15px;
    display: block;
}

.modal-title {
    color: #dc3545;
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-button {
    padding: clamp(10px, 2vw, 12px) clamp(20px, 3vw, 24px);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    min-height: 44px;
    flex: 1;
}

.btn-primary {
    background: #dc3545;
    color: #fff;
}

.btn-primary:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f1f3f5;
    color: #495057;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.success-modal .modal-title {
    color: #28a745;
}

.success-modal .btn-primary {
    background: #28a745;
}

.success-modal .btn-primary:hover {
    background: #218838;
}

/* Modales responsive para móviles */
@media screen and (max-width: 599px) {
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-button {
        width: 100%;
    }
}

/* ========================================
   10. ANIMACIONES
======================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   11. UTILIDADES
======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   12. ORIENTACIÓN ESPECÍFICA
======================================== */

/* Tablet en orientación vertical */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    .login-page-grid {
        max-width: 700px;
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "form"
            "sucursal";
        gap: 25px;
    }
    
    .sucursal-column {
        border-left: none;
        border-top: 1px solid #e9ecef;
        padding-left: 0;
        padding-top: 25px;
    }
    
    .column-title,
    .column-subtitle {
        text-align: center;
    }
    
    .sucursal-list-container {
        max-height: 300px;
    }
}

/* =========================================
   FORZAR DISEÑO DE 2 COLUMNAS SIEMPRE
   ========================================= */
.login-page-grid {
    display: grid;
    /* Forzamos 2 columnas: Izquierda (40%) - Derecha (60%) o 1fr 1fr según gusto */
    grid-template-columns: 1fr 1.2fr; 
    gap: 0;
    max-width: 900px; /* Ancho fijo para que parezca la captura */
    width: 95%;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 500px; /* Altura mínima para que no se vea aplastado */
}

/* En móviles sí permitimos que se ponga una debajo de otra */
@media (max-width: 768px) {
    .login-page-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   COLUMNA DERECHA (SUCURSALES)
   ========================================= */
.sucursal-column {
    background-color: #f8f9fa; /* Un gris muy sutil para diferenciar */
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* EFECTO DE APARICIÓN */
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 1;
    filter: blur(0);
}

/* ESTADO OCULTO (Pero ocupando espacio) */
.sucursal-column.hidden-content {
    opacity: 0;
    pointer-events: none; /* Evita clicks cuando no se ve */
    filter: blur(5px);
}

/* Ocultar IDs si quedaron residuos */
.sucursal-info small {
    display: none !important;
}
/* Tablet en orientación horizontal */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .login-page-grid {
        max-width: 800px;
    }
    
    .sucursal-list-container {
        max-height: 280px;
    }
}

 
  .secondary-button {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(220, 53, 69, 0.2);
}

.secondary-button:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

.secondary-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}  