/* ==========================================================================
   SISTEMA DE DISEÑO - TECNOLÓGICO DE COSTA RICA 2026
   Basado en el Manual de Identidad Institucional
   ========================================================================== */

   :root {
    /* Colores Oficiales TEC */
    --tec-blue: #002855; 
    --tec-red: #EF3340;  
    
    /* Escala de Grises y Superficies (Regla del 70% de aire) */
    --bg-main: #FAFAFA;
    --surface-white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-muted: #6C7A89;
    --border-color: #E0E4E8;

    /* Sombras Modernas (Soft UI) */
    --shadow-sm: 0 2px 8px rgba(0, 40, 85, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 40, 85, 0.12);
    
    /* Transiciones */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Comportamiento de scroll suave y compensación del Navbar fijo */
html {
    scroll-behavior: smooth;
}

/* Aplicar el margen a TODAS las secciones exactas a las que salta el menú */
#calendario, 
#como, 
#info,
#normativa, 
#faq {
    scroll-margin-top: 130px; /* Le di un poco más de aire para que respire bien */
}

/* --- NAVEGACIÓN --- */
.navbar {
    background-color: var(--surface-white);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 2rem;
}

.navbar-brand img {
    max-height: 76px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .navbar-brand img {
        max-height: 56px;
    }
}

.nav-link {
    position: relative;
    color: var(--text-dark) !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    transition: color 0.25s ease;
}

/* Subrayado rojo del enlace activo o con el cursor encima */
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--tec-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--tec-blue) !important;
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

/* Barra de avance de lectura: crece a medida que se baja por la página */
.nav-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--tec-red);
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

.navbar-toggler {
    border: 1px solid rgba(0, 40, 85, 0.12);
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 40, 85, 0.12);
}

/* --- HERO SECTION (CARRUSEL MODERNIZADO) --- */
.hero-section {
    position: relative;
    height: 70vh; /* Ocupa el 70% de la pantalla */
    min-height: 500px;
    background-color: var(--tec-blue);
    overflow: hidden;
}

/* El carrusel ocupa todo el fondo */
.hero-carousel, .carousel-inner, .carousel-item {
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 8%;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

/* Capa oscura elegante para que el texto sea legible */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 25, 55, 0.78), rgba(16, 22, 33, 0.42));
    z-index: 1;
}

/* La tarjeta flotante central con efecto Glassmorphism */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 800px;
    
    /* Efecto cristal moderno */
    background: linear-gradient(145deg, rgba(68, 74, 84, 0.58), rgba(28, 33, 41, 0.7));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 45px rgba(8, 15, 28, 0.28);
}

.hero-content h1 {
    color: var(--surface-white);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.hero-content h2 {
    color: var(--surface-white);
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

@media (max-width: 768px) {
    .hero-content { padding: 2rem; }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-content h2 { font-size: 1.2rem; }
}

.landing-main {
    margin-top: 4rem !important;
    margin-bottom: 4rem !important;
}

.landing-intro .lead {
    max-width: 760px;
    margin: 0 auto;
}

/* ==========================================================================
   FOOTER MODERNO (SPLIT DESIGN - ADAPTADO A TEC)
   ========================================================================== */
   .tec-footer {
    background-color: var(--tec-blue);
    color: var(--surface-white);
}

/* El SVG no trae tamaño propio, así que hay que acotarlo o sale enorme */
.footer-logo {
    width: 100%;
    max-width: 190px;
    height: auto;
}

@media (max-width: 768px) {
    .footer-logo {
        max-width: 150px;
    }
}

/* Línea divisoria sutil */
.border-white-10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.help-title {
    font-size: 2rem;
}

@media (max-width: 768px) {
    .help-title { font-size: 1.5rem; }
    .tec-footer .fs-5 { font-size: 1rem !important; }
}

/* ==========================================================================
   BOTÓN DE ACCESIBILIDAD FIJO (STYLE UNAH)
   ========================================================================== */
.a11y-fixed-btn-container {
    position: fixed;
    bottom: 20px; /* Separación del borde inferior */
    left: 20px;   /* Separación del borde izquierdo */
    z-index: 1050; /* Por encima de casi todo (Bootstrap modals son 1055+) */
}

.btn-a11y-fixed {
    background-color: var(--surface-white);
    color: var(--tec-blue);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem; /* Icono grande */
    border: none;
    transition: all 0.3s ease;
    padding: 0;
}

/* Efectos hover fluidos */
.btn-a11y-fixed:hover {
    background-color: var(--tec-red); /* Cambia a Rojo TEC al pasar el mouse */
    color: var(--surface-white);
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3) !important;
}

/* Ajuste para móviles */
@media (max-width: 576px) {
    .btn-a11y-fixed {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
    .a11y-fixed-btn-container {
        bottom: 15px;
        left: 15px;
    }
}
/* ==========================================================================
   CALENDARIO PERSONALIZADO (SPLIT-VIEW)
   ========================================================================== */
.custom-calendar-wrapper {
    max-width: 1050px;
    margin: 0 auto;
    background-color: var(--surface-white);
    border-radius: 20px !important;
    box-shadow: var(--shadow-sm);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px 5px;
}

.calendar-legend {
    line-height: 1.2;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 999px;
    flex-shrink: 0;
}

.legend-swatch-event {
    background-color: var(--tec-red);
    box-shadow: 0 0 0 3px rgba(239, 51, 64, 0.12);
}

.legend-swatch-today {
    background-color: var(--surface-white);
    border: 2px solid var(--tec-blue);
}

.calendar-day {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    cursor: default;
    transition: var(--transition);
    font-size: 1rem;
    position: relative;
}

/* Días que tienen elecciones */
.calendar-day.has-event {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-dark);
}

.calendar-day.has-event:hover {
    background-color: rgba(0, 40, 85, 0.1);
}

/* Día seleccionado (Círculo Azul) */
.calendar-day.selected-day {
    background-color: var(--tec-blue) !important;
    color: var(--surface-white) !important;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 40, 85, 0.3);
}

.calendar-day.today-day {
    box-shadow: inset 0 0 0 2px rgba(0, 40, 85, 0.55);
}

.calendar-day.selected-day.today-day {
    box-shadow: 0 4px 8px rgba(0, 40, 85, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.calendar-day-number {
    position: relative;
    z-index: 1;
}

.calendar-event-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--tec-red);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.calendar-day.selected-day .calendar-event-indicator {
    background-color: var(--surface-white);
    box-shadow: none;
}

#eventListContainer {
    min-height: 220px;
}

/* --- ESTILOS DE LA LISTA DE EVENTOS --- */
.event-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.event-item:last-child {
    border-bottom: none;
}

.event-time {
    color: var(--tec-red);
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 65px;
    padding-top: 2px;
}

.event-description {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
}

.event-description a {
    color: var(--tec-blue);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 5px;
    transition: var(--transition);
}

.event-description a:hover {
    color: var(--tec-red);
    text-decoration: underline;
}

/* Aviso para las convocatorias que todavía no tienen enlace de votación */
.event-pending {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    background-color: rgba(0, 40, 85, 0.04);
    border-left: 3px solid rgba(0, 40, 85, 0.15);
    border-radius: 0 12px 12px 0;
    padding: 0.6rem 0.85rem;
    margin: 0.85rem 0 0;
}

.event-link-label {
    background-color: rgba(0, 40, 85, 0.06);
    border: 1px solid rgba(0, 40, 85, 0.08);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    margin-top: 0.85rem !important;
    line-height: 1.45;
}

.event-link-label:hover {
    background-color: rgba(239, 51, 64, 0.08);
}

.accordion {
    border-radius: 18px;
    overflow: hidden;
}

.accordion-item {
    border-color: var(--border-color);
}

.accordion-button {
    color: var(--tec-blue);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    color: var(--tec-blue);
    background-color: rgba(0, 40, 85, 0.06);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    padding: 1.25rem;
}

.list-group-item {
    gap: 1rem;
}

.list-group-item a {
    line-height: 1.45;
}

.video-cta-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    box-shadow: var(--shadow-md);
}

.video-cta-button {
    letter-spacing: 0.02em;
}

/* ==========================================================================
   TARJETAS "CÓMO PARTICIPAR"
   ========================================================================== */
   .step-card {
    transition: var(--transition);
    border-radius: 12px !important;
    border: 1px solid rgba(0, 40, 85, 0.06);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md) !important;
}

.step-card .card-body {
    gap: 1rem;
    align-items: flex-start;
}

.step-icon-container {
    background-color: var(--tec-blue);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.step-card:hover .step-icon-container {
    background-color: var(--tec-red);
    transform: scale(1.1) rotate(5deg);
}

.help-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.help-item i {
    flex-shrink: 0;
}

.help-highlight {
    color: var(--tec-red);
    font-weight: 500;
    text-decoration: none;
}

.help-highlight:hover {
    color: var(--tec-red);
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 0.9rem 1rem;
    }

    .navbar-collapse {
        padding-top: 1rem;
    }

    .navbar-nav {
        gap: 0.5rem !important;
    }

    .nav-link {
        padding: 0.35rem 0;
    }

    .hero-section {
        height: 72vh;
        min-height: 440px;
    }

    .hero-content {
        width: calc(100% - 2rem);
        padding: 2rem 1.5rem;
    }

    .hero-content h1 {
        font-size: clamp(1.7rem, 5vw, 2.3rem);
    }

    .hero-content h2 {
        font-size: clamp(1rem, 2.8vw, 1.3rem);
    }
}

@media (max-width: 767.98px) {
    .landing-main {
        margin-top: 2.5rem !important;
        margin-bottom: 3rem !important;
    }

    .landing-main.container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-section {
        height: 68vh;
        min-height: 390px;
    }

    .hero-content {
        top: 58%;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: calc(100% - 1.5rem);
        max-width: 680px;
        padding: 1.35rem 1.1rem;
        border-radius: 20px;
    }

    .hero-content h1 {
        font-size: 1.9rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .hero-content h2 {
        font-size: 1rem;
        line-height: 1.35;
    }

    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next {
        display: none;
    }

    .landing-intro {
        margin-bottom: 2.5rem !important;
    }

    .landing-intro h2 {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .landing-intro .lead {
        font-size: 1rem;
    }

    #calendario .col-md-5,
    #calendario .col-md-7 {
        padding: 1.5rem !important;
    }

    #monthYearDisplay,
    #calendario h3 {
        font-size: 1.45rem !important;
    }

    .calendar-grid {
        gap: 8px 2px;
    }

    .calendar-legend {
        gap: 0.75rem !important;
        font-size: 0.8rem;
    }

    .calendar-day {
        width: 34px;
        height: 34px;
        font-size: 0.92rem;
    }

    .calendar-event-indicator {
        bottom: 4px;
        width: 6px;
        height: 6px;
    }

    #eventListContainer {
        min-height: 0;
    }

    .event-item {
        flex-direction: column;
        gap: 0.35rem;
        padding: 1rem 0;
    }

    .event-time {
        min-width: 0;
        padding-top: 0;
        font-size: 1rem;
    }

    .event-description {
        font-size: 0.92rem;
    }

    .event-link-label {
        width: 100%;
    }

    .list-group-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .list-group-item .badge {
        min-width: 0 !important;
        width: auto;
    }

    .video-cta-section {
        padding: 2rem 1rem !important;
    }

    .video-cta-section h3 {
        font-size: 1.4rem;
        line-height: 1.25;
    }

    .video-cta-button {
        width: 100%;
        max-width: 320px;
        padding: 1rem 1.25rem !important;
        font-size: 0.95rem;
        white-space: normal;
    }

    .step-card .card-body {
        flex-direction: column;
        padding: 1.5rem !important;
    }

    .step-icon-container {
        width: 54px;
        height: 54px;
        margin-right: 0 !important;
    }

    .step-card h5 {
        font-size: 1rem;
    }

    .accordion-button {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .accordion-body {
        padding: 1rem;
    }

    .help-item {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
        font-size: 0.95rem;
    }
}
