/* =========================================================================
   RESETEO GLOBAL ANTI-CUADROS AZULES
   ========================================================================= */
   *, a, button, input, select, .card-google, .tarjeta-sintoma {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

a:focus, button:focus, a:active, button:active {
    outline: none !important;
}
/* =========================================================================
   1. VARIABLES "CLEAN MEDICAL" UX/UI
   ========================================================================= */
   :root {
    /* Tipografía */
    --fuente-principal: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Paleta Principal Adaptada al Fondo Oscuro */
    --color-principal: #0ea5e9; /* Celeste brillante para botones y selecciones */
    --color-principal-hover: #0284c7;
    --color-exito: #10b981; 
    
    /* Superficies y Fondos */
    --color-fondo: #041825; /* Un tono apenas más oscuro para el margen exterior */
    --color-tarjeta-bg: #08304B; /* TU COLOR: Fondo principal del turnero */
    
    /* Textos (Invertidos a claros) */
    --color-texto-fuerte: #ffffff;
    --color-texto-base: #f1f5f9;
    --color-texto-mutado: #94a3b8;
    
    /* Bordes y Sombras */
    --color-borde: #164e7a; /* Borde azulado claro para que se vea */
    --sombra-suave: 0 4px 12px rgba(0, 0, 0, 0.15);
    --sombra-flotante: 0 16px 40px rgba(0, 0, 0, 0.25);
    --radio-borde-tarjeta: 16px;
    --radio-borde-input: 10px;
}

.oculto { display: none !important; }

/* =========================================================================
   2. ESTILOS BASE Y CONTENEDOR PRINCIPAL
   ========================================================================= */
body {
    font-family: var(--fuente-principal);
    background-color: var(--color-fondo);
    color: var(--color-texto-base);
    margin: 0;
    padding: 40px 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
    /* Bloquea la selección de texto en toda la aplicación */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#app-turnos {
    background-color: var(--color-tarjeta-bg);
    width: 100%;
    max-width: 850px;
    border-radius: var(--radio-borde-tarjeta);
    box-shadow: var(--sombra-flotante);
    border: 1.5px solid var(--color-borde);
    padding: 45px 50px 80px 50px; /* Padding inferior amplio para alojar el select */
    box-sizing: border-box;
    position: relative;
    overflow: visible !important; /* Permite que el select desplegable flote correctamente */
}

/* =========================================================================
   3. ENCABEZADO Y LOGO
   ========================================================================= */
.app-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-container {
    width: 100% !important;
    max-width: 180px !important;
    margin: 0 auto 15px auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.logo-container img,
.logo-claro {
    max-width: 100% !important;
    width: 40% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.app-header p {
    color: var(--color-texto-mutado);
    font-size: 0.98rem;
    margin: 0;
    font-weight: 500;
}

/* =========================================================================
   4. BARRA DE PASOS (STEPPER)
   ========================================================================= */
.progreso-pasos {
    display: flex;
    justify-content: space-between;
    margin-bottom: 35px;
    border-bottom: 2px solid var(--color-borde);
}

.paso {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-texto-mutado);
    padding-bottom: 12px;
    transition: all 0.3s ease;
}

.paso.activo {
    color: var(--color-principal);
    border-bottom: 3px solid var(--color-principal);
    font-weight: 700;
    margin-bottom: -2px; 
}

/* =========================================================================
   5. ESTRUCTURA Y TITULOS
   ========================================================================= */
.seccion-paso {
    animation: fadeSlideUp 0.35s ease forwards;
}

.seccion-paso h2 {
    color: var(--color-principal);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 6px;
    text-align: center;
}

.instruccion {
    color: var(--color-texto-mutado);
    font-size: 0.95rem;
    margin-bottom: 28px;
    text-align: center;
}

/* =========================================================================
   6. TARJETAS DE SÍNTOMAS (DISEÑO CENTRADO CON IMÁGENES SVG)
   ========================================================================= */
   .grilla-sintomas {
    display: grid;
    /* Cambiamos el 260px por 350px. Esto hace que las tarjetas sean mucho más anchas */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 25px; /* Un poco más de aire entre tarjeta y tarjeta */
    margin-bottom: 30px;
}

.tarjeta-sintoma {
    background-color: var(--color-tarjeta-bg);
    border: 2px solid var(--color-borde);
    border-radius: var(--radio-borde-tarjeta);
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    box-sizing: border-box;
}

.tarjeta-icono {
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    height: auto;
    background-color: transparent;
    margin-bottom: 12px;
    transition: all 0.25s ease;
}
.tarjeta-icono img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0px 0px 3px rgba(255, 255, 255, 0.5));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarjeta-sintoma:hover {
    border-color: #38bdf8;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tarjeta-sintoma.seleccionada {
    border-color: var(--color-principal);
    background-color: rgba(14, 165, 233, 0.08); /* Fondo apenas teñido de azul */
    
    /* Magia Neón: Sombra exterior fuerte + sombra interior suave */
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3), inset 0 0 12px rgba(14, 165, 233, 0.15);
    
    transform: translateY(-4px);
}

.tarjeta-sintoma.seleccionada .tarjeta-icono img {
    /* Mantenemos el centro blanco, pero le aplicamos dos capas de luz azul */
    filter: brightness(0) invert(1) drop-shadow(0px 0px 6px rgba(14, 165, 233, 0.8)) drop-shadow(0px 0px 16px rgba(14, 165, 233, 1));
    transform: scale(1.12); /* Crece un poquito más para dar sensación de encendido */
}

.tarjeta-sintoma.seleccionada h3 {
    color: var(--color-principal);
}

.tarjeta-sintoma.seleccionada p, 
.tarjeta-sintoma.seleccionada ul {
    color: var(--color-texto-base); 
}


.tarjeta-sintoma h3 {
    margin: 0 0 12px 0;
    font-size: 1.3rem; /* Lo subimos de 1.1rem a 1.3rem para que destaque más */
    font-weight: 700;
    color: var(--color-texto-fuerte);
    transition: color 0.25s ease;
}

.tarjeta-sintoma p,
.tarjeta-sintoma ul {
    text-align: left;
    width: 100%;
    align-self: flex-start;
    margin: 0;
    font-size: 0.95rem; /* Lo subimos de 0.85rem a 0.95rem para que se lea mejor */
    color: var(--color-texto-mutado);
    line-height: 1.6; /* Un poco más de espacio entre renglones */
    transition: color 0.25s ease;
}

.tarjeta-sintoma ul {
    padding-left: 20px;
    flex-grow: 1;
}

.tarjeta-sintoma li {
    margin-bottom: 6px;
}

/* =========================================================================
   7. FORMULARIOS, INPUTS Y CUSTOM SELECT ESTILIZADO
   ========================================================================= */
.campo-grupo {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    text-align: left;
}

.campo-grupo label {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-texto-mutado);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-estilizado {
    padding: 12px 16px;
    border: 1.5px solid var(--color-borde);
    border-radius: var(--radio-borde-input);
    font-size: 0.95rem;
    font-family: var(--fuente-principal);
    background-color: rgba(255, 255, 255, 0.05); /* Fondo apenas gris transparente */
    color: var(--color-texto-fuerte);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.input-estilizado:focus {
    border-color: var(--color-principal) !important;
    box-shadow: 0 0 0 3px rgba(0, 42, 77, 0.1);
}

.fila-campos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* =========================================================================
   CUSTOM SELECT ESTILIZADO PARA OBRA SOCIAL
   ========================================================================= */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-borde);
    border-radius: var(--radio-borde-input);
    font-size: 0.95rem;
    font-family: var(--fuente-principal);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-texto-fuerte);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: left;
}
.custom-select-trigger:focus,
.custom-select-wrapper.activo .custom-select-trigger {
    border-color: var(--color-principal) !important;
    box-shadow: 0 0 0 3px rgba(0, 42, 77, 0.1);
    outline: none;
}

.custom-select-trigger svg {
    color: var(--color-principal);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-select-wrapper.activo .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-options-container {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #08304B; /* Fondo oscuro para la lista */
    border: 1.5px solid var(--color-borde);
    border-radius: var(--radio-borde-input);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
    max-height: 150px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    padding: 6px;
    box-sizing: border-box;
}

.custom-select-wrapper.activo .custom-options-container {
    display: block;
    animation: fadeSlideUp 0.2s ease forwards;
}

.custom-option {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--fuente-principal);
    color: var(--color-texto-fuerte);
    background: transparent;
    border: none;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: block;
    box-sizing: border-box;
}

.custom-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-principal);
    font-weight: 600;
}

.custom-option.seleccionado {
    background-color: var(--color-principal);
    color: #ffffff;
    font-weight: 700;
}

.custom-options-container::-webkit-scrollbar {
    width: 6px;
}
.custom-options-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.custom-options-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.custom-options-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================================
   8. BOTONES
   ========================================================================= */
.acciones-paso {
    margin-top: 35px;
    display: flex;
    justify-content: flex-end;
}

.d-flex-between {
    justify-content: space-between;
}

.btn {
    font-family: var(--fuente-principal);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border: none;
}

.btn-primario {
    background-color: var(--color-principal);
    color: #ffffff;
}

.btn-primario:hover:not(:disabled) {
    background-color: var(--color-principal-hover);
    transform: translateY(-1px);
    box-shadow: var(--sombra-suave);
}

.btn-primario:disabled {
    background-color: rgba(255, 255, 255, 0.08) !important; /* Cristal oscuro */
    color: rgba(255, 255, 255, 0.3) !important; /* Texto atenuado */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.btn-secundario {
    background-color: transparent; /* Fondo transparente para que se vea el azul oscuro */
    color: var(--color-texto-mutado); /* Texto en un gris/celeste clarito apagado */
    border: 1.5px solid var(--color-borde); /* Borde azul oscuro sutil */
}

.btn-secundario:hover {
    background-color: rgba(255, 255, 255, 0.08); /* Se ilumina apenitas al pasar el mouse */
    color: #ffffff; /* El texto se vuelve blanco brillante */
    border-color: var(--color-principal); /* El borde se pinta del celeste neón */
}
/* =========================================================================
   9. HORARIOS DISPONIBLES
   ========================================================================= */
.seccion-horarios {
    margin-top: 30px;
    border-top: 1.5px solid var(--color-borde);
    padding-top: 25px;
    animation: fadeSlideUp 0.35s ease forwards;
}

.seccion-horarios h3 {
    font-size: 1.05rem;
    color: var(--color-principal);
    margin-bottom: 16px;
    font-weight: 700;
}

.grilla-horas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.hora-opcion {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--color-borde);
    color: var(--color-texto-fuerte);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--fuente-principal);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.hora-opcion:hover:not(:disabled) {
    border-color: var(--color-principal);
    color: #ffffff;
    background-color: var(--color-principal);
}

.hora-opcion.seleccionada {
    background-color: var(--color-principal);
    color: #ffffff;
    border-color: var(--color-principal);
}

.hora-opcion:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   10. ESTILO PERSONALIZADO DE FLATPICKR (#002A4D)
   ========================================================================= */
   .flatpickr-calendar {
    width: 320px !important;
    box-sizing: border-box !important;
    padding: 12px !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
    border: 1.5px solid var(--color-borde) !important;
    font-family: var(--fuente-principal) !important;
    background: #08304B !important; /* Fondo oscuro al calendario */
}

.flatpickr-months {
    background-color: var(--color-principal) !important;
    border-radius: 10px !important;
    padding: 8px 0 !important;
    margin-bottom: 10px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: #ffffff !important;
    fill: #ffffff !important;
    height: 34px !important;
}

.flatpickr-current-month {
    color: #ffffff !important;
    font-weight: 600 !important;
    padding-top: 2px !important;
}

/* Selector del mes con fondo azul corporativo y texto blanco */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background-color: var(--color-principal) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
}

.flatpickr-current-month input.cur-year {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Opciones del desplegable del mes */
.flatpickr-monthDropdown-month {
    background-color: #08304B !important;
    color: #ffffff !important;
}

.flatpickr-monthDropdown-month:hover {
    background-color: #164e7a !important;
    color: var(--color-principal) !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #ffffff !important;
    fill: #ffffff !important;
    padding: 10px !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

.flatpickr-days, 
.dayContainer,
.flatpickr-weekdays {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

span.flatpickr-weekday {
    color: var(--color-texto-mutado) !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
}

.flatpickr-day {
    max-width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 1px 0 !important;
    color: var(--color-texto-fuerte) !important;
    font-weight: 600 !important;
}

.flatpickr-day.selected, 
.flatpickr-day.selected:hover {
    background: var(--color-principal) !important;
    border-color: var(--color-principal) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
}

.flatpickr-day:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
}

/* =========================================================================
   11. ANIMACIONES Y RESPONSIVE
   ========================================================================= */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 650px) {
    #app-turnos { 
        padding: 20px 18px 60px 18px; 
    }

    .progreso-pasos { display: none !important; }
    .app-header p { display: none !important; }
    .logo-container { max-width: 150px; margin-bottom: 10px; }

    .seccion-paso h2 { font-size: 1.15rem; }
    .instruccion { font-size: 0.82rem; margin-bottom: 18px; }

    .grilla-sintomas { grid-template-columns: 1fr; gap: 12px; }
    
    .tarjeta-sintoma { padding: 18px 16px; border-radius: 12px; }
    .tarjeta-icono { margin-bottom: 10px; }
    .tarjeta-icono img { 
        width: 65px; 
        height: 65px; 
    }
    
    .tarjeta-sintoma h3 { font-size: 1rem; }
    
    .fila-campos { grid-template-columns: 1fr; gap: 0; }
    .acciones-paso { flex-direction: column-reverse; gap: 10px; }
    .btn { width: 100%; }
}

/* =========================================================================
   ESTADOS DE ERROR EN VALIDACIONES
   ========================================================================= */
.input-estilizado.campo-error,
.custom-select-trigger.campo-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.mensaje-error-campo {
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

/* =========================================================================
   ESTILO PARA DÍAS NO DISPONIBLES EN EL CALENDAR (FLATPICKR)
   ========================================================================= */
.flatpickr-day.flatpickr-disabled, 
.flatpickr-day.flatpickr-disabled:hover {
    color: #cbd5e1 !important;
    background: transparent !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #cbd5e1 !important;
    background: transparent !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
/* Corrección para que el mensaje de sin horarios ocupe toda la fila y no se rompa */
.grilla-horas p {
    grid-column: 1 / -1 !important;
    text-align: center;
    color: #dc2626 !important;
    font-weight: 700;
    width: 100%;
    padding: 10px 0;
}

/* =========================================================================
   12. ESTILOS PARA EL SELECTOR DE PROFESIONALES (PACIENTE - TARJETAS)
   ========================================================================= */
   #wrapper-selector-medicos {
    background: rgba(255, 255, 255, 0.02); /* Fondo apenas perceptible */
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    padding: 16px;
    margin-top: 15px;
    margin-bottom: 20px;
}

#wrapper-selector-medicos > label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-texto-mutado);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Contenedor de las tarjetas de los médicos */
#contenedor-solapas-medicos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    overflow-x: visible;
}

/* Tarjeta individual del médico (Modo Reposo) */
#contenedor-solapas-medicos .sub-tab-btn {
    background: rgba(255, 255, 255, 0.05); /* Cristal traslúcido igual que los inputs */
    border: 1.5px solid var(--color-borde);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--color-texto-fuerte);
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 220px;
}

/* Efecto Hover solo para cuando NO está seleccionada */
#contenedor-solapas-medicos .sub-tab-btn:hover:not(.activo):not(:disabled) {
    border-color: rgba(14, 165, 233, 0.5);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Estado Activo / Seleccionado por el paciente (Efecto Neón) */
#contenedor-solapas-medicos .sub-tab-btn.activo {
    background: rgba(14, 165, 233, 0.15); /* Fondo teñido de celeste */
    border-color: var(--color-principal);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3), inset 0 0 8px rgba(14, 165, 233, 0.2);
}

/* Estado Bloqueado / No disponible en esa fecha */
#contenedor-solapas-medicos .sub-tab-btn.bloqueado {
    background: rgba(0, 0, 0, 0.2); /* Oscurecido total */
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--color-texto-mutado);
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

/* Insignia de Estado (Disponible / No disponible) */
#contenedor-solapas-medicos .badge-estado-solapa {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    background: rgba(0, 0, 0, 0.2); /* Fondo genérico oscuro para la pastilla */
}
/* =========================================================================
   ADAPTACIÓN MÓVIL (PANTALLAS CHICAS)
   ========================================================================= */
   @media (max-width: 650px) {
    #contenedor-solapas-medicos {
        flex-direction: column; /* Apila las tarjetas verticalmente */
        gap: 10px;
    }

    #contenedor-solapas-medicos .sub-tab-btn {
        width: 100%; /* Ocupa todo el ancho de la pantalla del celular */
        min-width: 100%;
        padding: 16px;
    }
}