body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: #F2F2F2;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* Botones Estilo GOV.CO */
.btn-gov {
    background-color: white;
    color: #3366CC;
    border: 2px solid #3366CC;
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 700;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.btn-gov:hover,
.btn-gov.selected {
    background-color: #3366CC;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(51, 102, 204, 0.2);
}

/* Checkbox Cards */
.checkbox-card {
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: white;
    transition: all 0.2s;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
}

.checkbox-card:hover {
    border-color: #3366CC;
    background-color: #F8FBFF;
}

.checkbox-card.selected {
    border-color: #3366CC;
    background-color: #EFF6FF;
    ring: 1px solid #3366CC;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid #9CA3AF;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.checkbox-card.selected .checkbox-mark {
    border-color: #3366CC;
    background-color: #3366CC;
}

/* Acordeones */
details>summary {
    list-style: none;
    cursor: pointer;
    transition: all 0.3s;
}

details>summary::-webkit-details-marker {
    display: none;
}

details[open]>summary {
    background-color: #EFF6FF;
    border-bottom: 1px solid #E5E7EB;
}

.chevron {
    transition: transform 0.3s;
}

details[open] .chevron {
    transform: rotate(180deg);
}

/* Loader */
#loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Tabs Styles (Botones) */
.tab-btn {
    padding: 10px 20px;
    font-weight: 700;
    color: #3366CC;
    border: 1px solid #3366CC;
    border-radius: 20px;
    background-color: white;
    transition: all 0.3s;
    text-align: center;
    flex-grow: 1;
    min-width: 140px;
}

.tab-btn.active {
    color: white;
    background-color: #3366CC;
    border-color: #3366CC;
    box-shadow: 0 4px 6px rgba(51, 102, 204, 0.2);
}

.tab-btn:hover:not(.active) {
    background-color: #EFF6FF;
    transform: translateY(-1px);
}

/* --- ESTILOS MARKDOWN DENTRO DE DETALLES --- */
.md-content h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #004884;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 0.25rem;
}

.md-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3366CC;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.md-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.md-content ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.md-content ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.md-content p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.md-content a {
    color: #3366CC;
    text-decoration: underline;
}

.md-content strong {
    font-weight: 700;
    color: #004884;
}

.md-content blockquote {
    border-left: 4px solid #3366CC;
    padding-left: 1rem;
    color: #4B5563;
    background-color: #F9FAFB;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}

/* --- ACCESIBILIDAD --- */
.a11y-menu {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.a11y-btn {
    background-color: #004884;
    color: white;
    border: none;
    padding: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    transition: width 0.3s ease, background-color 0.2s;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.2);
}

.a11y-btn img {
    filter: brightness(0) invert(1);
}

.a11y-btn:hover {
    width: 140px;
    background-color: #3366CC;
}

.a11y-label {
    opacity: 0;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.a11y-btn:hover .a11y-label {
    opacity: 1;
}

/* Alto Contraste */
body.high-contrast {
    background-color: #000 !important;
    color: #FFF !important;
}

body.high-contrast header {
    background-color: #000 !important;
    border-bottom: 2px solid #FFFF00;
}

body.high-contrast .bg-white {
    background-color: #000 !important;
    color: #FFF !important;
    border: 1px solid #FFF !important;
}

body.high-contrast .bg-blue-50,
body.high-contrast .bg-gov-bg,
body.high-contrast .bg-gray-100 {
    background-color: #1a1a1a !important;
    color: #FFF !important;
    border: 1px solid #888;
}

body.high-contrast .text-gov-blue,
body.high-contrast .text-gov-dark-blue,
body.high-contrast .md-content strong,
body.high-contrast .md-content a,
body.high-contrast .md-content h1,
body.high-contrast .md-content h2,
body.high-contrast .md-content h3 {
    color: #FFFF00 !important;
}

body.high-contrast .text-gray-600,
body.high-contrast .text-gray-700,
body.high-contrast .text-gray-500,
body.high-contrast .text-gray-800 {
    color: #DDD !important;
}

body.high-contrast .btn-gov {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
}

body.high-contrast .btn-gov:hover,
body.high-contrast .btn-gov.selected {
    background-color: #FFFF00 !important;
    color: #000 !important;
}

body.high-contrast .checkbox-card {
    background-color: #000 !important;
    border-color: #FFF !important;
}

body.high-contrast .checkbox-card.selected {
    border: 2px solid #FFFF00 !important;
}

body.high-contrast .checkbox-mark {
    background-color: #000 !important;
    border-color: #FFFF00 !important;
}

body.high-contrast .checkbox-card.selected .checkbox-mark {
    background-color: #FFFF00 !important;
}

body.high-contrast .checkbox-card.selected .checkbox-mark svg {
    color: #000 !important;
}

body.high-contrast .tab-btn {
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
    background-color: #000 !important;
}

body.high-contrast .tab-btn.active {
    color: #000 !important;
    background-color: #FFFF00 !important;
}

body.high-contrast footer {
    background-color: #111 !important;
    border-top: 1px solid #FFFF00;
}

body.high-contrast img {
    filter: grayscale(100%) contrast(120%);
}

body.high-contrast #loader {
    background-color: #000 !important;
}

body.high-contrast select,
body.high-contrast input,
body.high-contrast textarea {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border: 1px solid #FFFF00 !important;
}

body.high-contrast .bg-blue-100 {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border: 1px solid #FFFF00 !important;
}

body.high-contrast details[open]>summary {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #FFFF00 !important;
}

body.high-contrast .bg-gray-200 {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border: 1px solid #FFFF00 !important;
}

body.high-contrast details .p-5 {
    background-color: #000 !important;
    color: #FFF !important;
}

body.high-contrast .md-content blockquote {
    background-color: #000 !important;
    color: #FFF !important;
    border-left: 4px solid #FFFF00 !important;
    border: 1px solid #FFFF00;
}

/* --- ESTILOS DE IMPRESIÓN (MEJORADO) --- */
@media print {
    @page {
        margin: 1cm;
        size: auto;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
    }

    /* Ocultar Elementos UI Web */
    header,
    footer,
    .a11y-menu,
    #navButtons,
    .tab-btn,
    .print\:hidden,
    #loader,
    button {
        display: none !important;
    }

    /* Contenedor Web General Oculto */
    #viewContainer>div:not(#print-area) {
        display: none !important;
    }

    /* Mostrar Contenedor de Impresión */
    #print-area {
        display: block !important;
    }

    /* Estilos de Bloques Impresos */
    .print-section {
        margin-bottom: 1.5rem;
    }

    .print-item {
        margin-bottom: 1rem;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.5rem;
    }

    /* Título de Item (Resaltado) */
    .print-title {
        background-color: #f0f9ff;
        /* Fondo Azul Claro */
        color: #004884;
        font-size: 12pt;
        font-weight: 800;
        padding: 8px 12px;
        border-radius: 6px;
        border: 1px solid #bfdbfe;
        margin-bottom: 0.5rem;
        break-after: avoid;
    }

    .print-content {
        font-size: 11pt;
        line-height: 1.3;
        text-align: justify;
        padding-left: 4px;
    }

    /* Encabezados de Sección */
    h1.print-header {
        font-size: 18pt;
        color: #3366CC;
        margin-bottom: 1rem;
        border-bottom: 2px solid #3366CC;
        font-weight: 800;
    }

    h2.print-subheader {
        font-size: 16pt;
        color: white;
        background-color: #004884;
        margin-top: 2rem;
        margin-bottom: 1rem;
        padding: 10px 15px;
        font-weight: 800;
        border-radius: 4px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        break-after: avoid;
    }

    /* Markdown en Impresión */
    .md-content p {
        margin-bottom: 0.5em;
    }

    .md-content h3 {
        font-size: 12pt;
        font-weight: bold;
        color: #333;
        margin-top: 1em;
    }

    .md-content ul,
    .md-content ol {
        padding-left: 1.5em;
    }

    /* Asegurar Logos */
    img {
        max-width: 100% !important;
    }
}

/* --- CYCLING QUESTIONS ANIMATION --- */
@keyframes cycleAndFade {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }

    5% {
        opacity: 1;
        transform: translateY(0);
    }

    28% {
        opacity: 1;
        transform: translateY(0);
    }

    33% {
        opacity: 0;
        transform: translateY(5px);
    }

    100% {
        opacity: 0;
        transform: translateY(5px);
    }
}

.cycling-question {
    animation: cycleAndFade 9s infinite;
}

/* Ajuste para alto contraste en las preguntas rotativas */
body.high-contrast .cycling-question {
    color: #FFFF00 !important;
}

/* --- NARRATIVE FORM (Párrafo con Selectores) --- */
.narrative-container {
    max-width: 800px;
    margin: 0 auto;
}

.narrative-section {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.narrative-section h3 {
    color: #004884;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 16px;
    border-bottom: 2px solid #eff6ff;
    padding-bottom: 8px;
}

.narrative-row {
    margin-bottom: 16px;
    line-height: 2.2;
    font-size: 1.1rem;
    color: #374151;
}

.narrative-label {
    font-weight: 600;
    color: #374151;
    margin-right: 4px;
}

/* Inline Selectors & Inputs */
.inline-select,
.inline-input {
    display: inline-block;
    border: none;
    border-bottom: 2px solid #3366CC;
    background-color: #F8FBFF;
    color: #3366CC;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px 4px 0 0;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    margin: 0 4px;
}

.inline-select:hover,
.inline-input:hover,
.inline-select:focus,
.inline-input:focus {
    background-color: #e0e7ff;
    outline: none;
    border-bottom-color: #004884;
}

.inline-input {
    min-width: 80px;
    max-width: 200px;
}

.inline-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

/* Legal Note Banner */
.legal-banner {
    background-color: #FFFBEB;
    /* Yellow-50 */
    border-left: 4px solid #F59E0B;
    /* Amber-500 */
    color: #92400E;
    /* Amber-800 */
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

/* High Contrast adjustments */
body.high-contrast .narrative-section {
    background-color: #000 !important;
    border-color: #FFFF00 !important;
}

body.high-contrast .narrative-section h3 {
    color: #FFFF00 !important;
    border-bottom-color: #FFFF00 !important;
}

body.high-contrast .narrative-row,
body.high-contrast .narrative-label {
    color: #FFF !important;
}

body.high-contrast .inline-select,
body.high-contrast .inline-input {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border-bottom: 2px solid #FFFF00 !important;
}

body.high-contrast .legal-banner {
    background-color: #000 !important;
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
}