/* ============================================================================
DECLARACIÓN DE PROPIEDAD INTELECTUAL Y DERECHOS DE AUTOR REGISTRADOS
============================================================================

PROPIETARIO ÚNICO, DESARROLLADOR, DISEÑADOR Y PROGRAMADOR EXCLUSIVO:
----------------------------------------------------------------------------
Ing. Roel Arturo Copetillo Portela
COPR810501rm1

HISTORIAL DE REGISTRO DE DESARROLLO (FECHA DE INICIO):
----------------------------------------------------------------------------
- Inicio oficial de diseño y desarrollo: 14 de Mayo de 2026

DECLARACIÓN DE DERECHOS LEGALES:
----------------------------------------------------------------------------
Tanto esta versión de prueba (trial/beta) como cualquier versión posterior,
estable, modificada, compilada, autoejecutable o derivada del código de esta 
aplicación, pertenecen al 100% en exclusiva y de manera vitalicia a su único
dueño y desarrollador Roel Arturo Copetillo Portela. Queda prohibida la copia, 
distribución, alteración o venta no autorizada sin el consentimiento expreso
por escrito del autor.

Todos los Derechos Reservados © 2026.
============================================================================ */

/* ── Color token NOM-036 ── */
:root {
    --nom-accent:      #00ff88;
    --nom-accent-2:    #33ff9f;
    --nom-glow:        rgba(0, 255, 136, 0.30);
    --nom-bg:          rgba(0, 255, 136, 0.06);
    --risk-green:      #00ff88;
    --risk-green-bg:   rgba(0, 255, 136, 0.10);
    --risk-yellow:     #ffd600;
    --risk-yellow-bg:  rgba(255, 214, 0, 0.10);
    --risk-orange-bg:  rgba(255, 140, 0, 0.10);
    --risk-red:        #ff2d55;
    --risk-red-bg:     rgba(255, 45, 85, 0.10);
    --risk-purple:     #d500f9;
    --risk-purple-bg:  rgba(213, 0, 249, 0.10);
}

/* ── Regla estricta: Inputs de captura en color naranja para diferenciar del texto del sistema ── */
#nom036-panel input[type="text"],
#nom036-panel input[type="number"],
#nom036-panel select,
#nom036-panel textarea,
#nom036-panel .content-editable-notes {
    color: var(--nom-accent) !important;
}

/* ── Tarjetas Visuales de Evaluación (8 Factores) ── */
.nom036-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 14px; /* Despegar las tarjetas de los bordes izquierdo y derecho */
}
.nom036-risk-factor-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 255, 255, 0.25);
    box-shadow: 0 0 14px rgba(0, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nom036-factor-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    line-height: 1.2;
}

.nom036-card-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0A0B10;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.nom036-card-option:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.2);
}
.nom036-card-option input[type="radio"],
.nom036-card-option input[type="checkbox"] {
    display: none;
}
.nom036-card-icon {
    font-size: 1.4rem;
    filter: grayscale(100%);
    opacity: 0.6;
}
/* Estilo para los emojis cuando no hay imagen, simulando una imagen de 84x84 */
span.nom036-card-icon:not(:has(img)) {
    width: 84px;
    height: 84px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.nom036-card-content {
    flex: 1;
}
.nom036-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}
.nom036-card-desc {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.3;
    margin-top: 2px;
}
/* Estados de selección por color (Verde, Amarillo, Rojo, Morado) */
.nom036-card-option.selected-verde {
    border-color: var(--risk-green);
    background: var(--risk-green-bg);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}
.nom036-card-option.selected-amarillo {
    border-color: var(--risk-yellow);
    background: var(--risk-yellow-bg);
    box-shadow: 0 0 10px rgba(255, 214, 0, 0.15);
}
.nom036-card-option.selected-rojo {
    border-color: var(--risk-red);
    background: var(--risk-red-bg);
    box-shadow: 0 0 10px rgba(255, 45, 85, 0.15);
}
.nom036-card-option.selected-morado {
    border-color: var(--risk-purple);
    background: var(--risk-purple-bg);
    box-shadow: 0 0 10px rgba(213, 0, 249, 0.15);
}
.nom036-card-option[class*="selected-"] .nom036-card-icon {
    filter: none;
    opacity: 1;
}

/* =========================================================
   HISTOGRAMA Y SUGERENCIAS (Nativo)
========================================================= */
.nom036-histogram-container, .nom036-suggestions-container {
    margin-top: 25px;
    background: rgba(20, 24, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
}

.nom036-suggestions-list {
    margin: 0;
    padding-left: 20px;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.4;
}

.nom036-suggestions-list li {
    margin-bottom: 6px;
}

.nom036-histogram-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.nom036-histogram-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 140px;
    padding-top: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.nom036-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.nom036-bar-fill {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 2px;
}

.nom036-bar-label {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 500;
    text-align: center;
    width: max-content;
    max-width: 65px;
    word-break: break-word;
}

.nom036-bar-value {
    position: absolute;
    top: -20px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
}

.nom036-textarea-suggestions {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    /* Aplicar color naranja estandar para inputs NOM-036 */
    color: var(--nom-accent) !important;
}

/* ── Formulario preliminar ── */
#nom036-pre-form {
    display: flex;
    flex-direction: column;
}

/* ── Wrapper del módulo (display controlado por JS) ── */
#nom036-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0;
    padding: 0;
}

/* ── El card externo del tab NOM-036 se convierte en un wrapper transparente
   para que el fondo animado sea visible entre las secciones flotantes ── */
.nom036-tab-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden !important; /* Previene scroll externo */
}
/* El pre-form dentro del wrapper transparente debe tener su propio fondo card */
.nom036-tab-wrapper #nom036-pre-form {
    background: #0A0B10;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    padding: 22px 26px;
    overflow-y: auto;
}

/* ── Card flotante SUPERIOR: Título NOM-036 + selector de módulos (FIJO ESTÁTICO) ── */
.nom036-sticky-header {
    /* Ya no necesita ser sticky, el layout flex lo mantiene arriba fijo */
    z-index: 20;
    /* Estética estándar de los paneles flotantes del sistema */
    background: #0A0B10;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    padding: 16px 22px;
    margin-bottom: 20px; /* Separación física idéntica al gap general (20px) */
    flex-shrink: 0;
}

/* ── Fila de título + subtítulo en la misma línea ── */
.nom036-sticky-title-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}
@media (max-width: 768px) {
    .nom036-sticky-title-row {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
}
.nom036-norm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--nom-accent);
    white-space: nowrap;
    letter-spacing: 0.03em;
}
.nom036-norm-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
}

/* ── Card flotante INFERIOR: Formularios de evaluación (SCROLLABLE) ── */
.nom036-scroll-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto; /* Scroll independiente SOLO en esta caja */
    overflow-x: hidden;
    /* Estética estándar de los paneles flotantes del sistema */
    background: #0A0B10;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    padding: 20px 18px 20px 18px; /* Padding interior consistente */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 136,0.35) transparent;
}
.nom036-scroll-body::-webkit-scrollbar { width: 5px; }
.nom036-scroll-body::-webkit-scrollbar-track { background: transparent; }
.nom036-scroll-body::-webkit-scrollbar-thumb { background: rgba(0, 255, 136,0.35); border-radius: 4px; }

/* ── Ocultar header interno de cada sección (redundante con las cards) ── */
.nom036-section-header {
    display: none !important;
}

.nom036-header-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    background: var(--nom-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 18px var(--nom-glow);
    flex-shrink: 0;
}
.nom036-header-title { font-size: 1.15rem; font-weight: 700; color: #fff; }
.nom036-header-sub   { font-size: 0.80rem; color: #94a3b8; margin-top: 2px; }

/* ── Selector de módulo (tarjetas) ── */
.nom036-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
    gap: 11px;
}
.nom036-module-card {
    padding: 12px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.nom036-module-card:hover {
    background: var(--nom-bg);
    border-color: rgba(0, 255, 136,0.35);
    box-shadow: 0 0 14px var(--nom-glow);
    transform: scale(0.97);
}
.nom036-module-card.active {
    background: var(--nom-bg);
    border-color: #fff;
    box-shadow: 0 0 18px var(--nom-glow);
}
.nom036-module-card .card-icon { font-size: 1.44rem; margin-bottom: 4px; }
.nom036-module-card .card-title { font-weight: 700; color: #fff; font-size: 0.74rem; }
.nom036-section {
    /* Ya no necesita margen inferior, el layout de scroll-body se encarga */
    margin-bottom: 0;
    /* Estética estándar de los paneles flotantes del sistema */
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    display: none;
}
.nom036-section.active { 
    display: block !important; 
    min-height: 300px;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
}

.nom036-section-header {
    padding: 12px 18px;
    background: rgba(0, 255, 136,0.08);
    border-bottom: 1px solid rgba(0, 255, 136,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--nom-accent-2);
}

/* ── Formulario de datos ── */
.nom036-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 18px;
}

/* Specific 3-column layout for the module general inputs */
.nom036-eval-section .nom036-form-grid {
    grid-template-columns: repeat(6, 1fr);
}
.nom036-eval-section .nom036-form-grid > .nom036-form-group:nth-child(1),
.nom036-eval-section .nom036-form-grid > .nom036-form-group:nth-child(2) {
    grid-column: span 3;
}
.nom036-eval-section .nom036-form-grid > .nom036-form-group:nth-child(n+3) {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .nom036-eval-section .nom036-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .nom036-eval-section .nom036-form-grid > .nom036-form-group:nth-child(n) {
        grid-column: span 1;
    }
}

@media (max-width: 720px) {
    .nom036-form-grid,
    .nom036-eval-section .nom036-form-grid { 
        grid-template-columns: 1fr; 
    }
    .nom036-eval-section .nom036-form-grid > .nom036-form-group:nth-child(n) {
        grid-column: span 1;
    }
}
.nom036-form-group { display: flex; flex-direction: column; gap: 6px; }
.nom036-form-group.full { grid-column: 1 / -1; }
.nom036-label {
    font-size: 0.80rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nom036-input {
    height: 42px;
    box-sizing: border-box;
    padding: 9px 13px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    color: var(--nom-accent);
    font-size: 0.90rem;
    font-family: inherit;
    line-height: normal;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: none;
}
textarea.nom036-input {
    height: auto;
    min-height: 100px;
    resize: none;
}
.nom036-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.nom036-input:focus {
    outline: none;
    border-color: var(--nom-accent);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
}
.nom036-input option { background: #1a1a2e; }

/* ── Radio cards (opciones visuales) ── */
.nom036-radio-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px 18px;
}
.nom036-radio-label {
    font-size: 0.80rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.nom036-radio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nom036-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 13px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 100%;
}
.nom036-radio-option:hover {
    border-color: rgba(0, 255, 136,0.35);
    background: var(--nom-bg);
}
.nom036-radio-option input[type="radio"] { display: none; }
.nom036-radio-option.selected {
    /* Fallback default */
    border-color: #00ff88;
    background: rgba(0, 255, 136,0.08);
    box-shadow: 0 0 10px rgba(0, 255, 136,0.25);
}

/* Verde: Riesgo Bajo / Óptimo (value="0") */
.nom036-radio-option.selected:has(input[value="0"]) {
    border-color: #00e676;
    background: rgba(0,230,118,0.08);
    box-shadow: 0 0 10px rgba(0,230,118,0.25);
}

/* Amarillo: Riesgo Medio / Subóptimo (value="1") */
.nom036-radio-option.selected:has(input[value="1"]) {
    border-color: #ffd600;
    background: rgba(255,214,0,0.08);
    box-shadow: 0 0 10px rgba(255,214,0,0.25);
}

/* Rojo/Naranja: Riesgo Alto / Extremo (value="2") */
.nom036-radio-option.selected:has(input[value="2"]) {
    border-color: #ff3d00;
    background: rgba(255,61,0,0.08);
    box-shadow: 0 0 10px rgba(255,61,0,0.25);
}

/* Púrpura: Riesgo Muy Alto / Máximo (value="3") */
.nom036-radio-option.selected:has(input[value="3"]),
.nom036-radio-option.selected:has(input[value="4"]) {
    border-color: #d500f9;
    background: rgba(213,0,249,0.08);
    box-shadow: 0 0 10px rgba(213,0,249,0.25);
}
.nom036-radio-option .option-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}
.nom036-radio-option .option-desc {
    font-size: 0.73rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.35;
}
.nom036-radio-option .option-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-left: auto;
    white-space: nowrap;
    padding: 2px 7px;
    background: var(--nom-bg);
    border-radius: 5px;
    flex-shrink: 0;
}

/* ── Divisor ── */
.nom036-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 24px 18px;
}

/* ── Panel de resultado ── */
.nom036-result-panel {
    padding: 18px;
    display: none;
}
.nom036-result-panel.visible { display: block; }

.nom036-result-card {
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    border: 2px solid;
    margin-bottom: 18px;
    transition: all 0.4s ease;
}
.nom036-result-card.riesgo-bajo {
    background: var(--risk-green-bg);
    border-color: var(--risk-green);
    box-shadow: 0 0 28px rgba(0,255,136,0.20);
}
.nom036-result-card.riesgo-medio {
    background: var(--risk-yellow-bg);
    border-color: var(--risk-yellow);
    box-shadow: 0 0 28px rgba(255,214,0,0.20);
}
.nom036-result-card.riesgo-alto {
    background: var(--risk-orange-bg);
    border-color: var(--risk-orange);
    box-shadow: 0 0 28px rgba(255,140,0,0.20);
}
.nom036-result-card.riesgo-muy-alto {
    background: var(--risk-red-bg);
    border-color: var(--risk-red);
    box-shadow: 0 0 28px rgba(255,45,85,0.25);
    animation: pulseRed 1.5s ease infinite;
}

@keyframes pulseRed {
    0%,100% { box-shadow: 0 0 28px rgba(255,45,85,0.25); }
    50%      { box-shadow: 0 0 44px rgba(255,45,85,0.50); }
}

.nom036-result-score {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
}
.nom036-result-level {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.nom036-result-action {
    font-size: 0.85rem;
    color: #cbd5e1;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Tabla de desglose ── */
.nom036-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 6px;
    table-layout: fixed;
    word-wrap: break-word;
}
.nom036-score-table th {
    padding: 8px 12px;
    text-align: left;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nom036-score-table th:nth-child(1) { width: 30%; }
.nom036-score-table th:nth-child(2) { width: 55%; }
.nom036-score-table th:nth-child(3) { width: 15%; }
.nom036-score-table td {
    padding: 9px 12px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.nom036-score-table tr:last-child td { border-bottom: none; }
.nom036-score-table .score-val {
    font-weight: 700;
    color: #fff;
    text-align: right;
}

/* ── Botones de acción ── */
.nom036-actions {
    display: flex;
    gap: 12px;
    padding: 16px 18px 18px;
    flex-wrap: wrap;
}
.nom036-btn-calc {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #ffffff;
    border-radius: 24px; padding: 10px 24px;
    font-family: 'JetBrains Mono', monospace; font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.nom036-btn-calc::after {
    content: ''; position: absolute;
    top: 0; left: -80%; width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(0, 255, 136, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(0, 255, 136, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.nom036-btn-calc:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #00ff88; color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3), 0 0 15px rgba(0, 255, 136, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.nom036-btn-calc:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

.nom036-btn-reset {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    border-radius: 24px; padding: 10px 24px;
    font-family: 'JetBrains Mono', monospace; font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.nom036-btn-reset::after {
    content: ''; position: absolute;
    top: 0; left: -80%; width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.1) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.nom036-btn-reset:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #ffffff; color: #ffffff;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1), 0 0 15px rgba(255, 255, 255, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.nom036-btn-reset:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

.nom036-btn-print {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: #ffffff;
    border-radius: 24px; padding: 10px 24px;
    font-family: 'JetBrains Mono', monospace; font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
    margin-left: auto;
}
.nom036-btn-print::after {
    content: ''; position: absolute;
    top: 0; left: -80%; width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(0, 240, 255, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(0, 240, 255, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.nom036-btn-print:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #00f0ff; color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.3), 0 0 15px rgba(0, 240, 255, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.nom036-btn-print:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

/* ── Advertencia de peso máximo ── */
.nom036-warning {
    display: none;
    padding: 10px 14px;
    background: rgba(255,45,85,0.10);
    border: 1px solid rgba(255,45,85,0.30);
    border-radius: 8px;
    font-size: 0.82rem;
    color: #ff6b8a;
    margin: 0 18px 10px;
    line-height: 1.45;
}
.nom036-warning.visible { display: block; }

/* ── Datos del estudio ── */
.nom036-datos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    padding: 16px 18px;
}
@media (max-width: 820px) {
    .nom036-datos-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Badge de puntaje por factor ── */
.factor-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(0, 255, 136,0.12);
    color: #fff;
    border: 1px solid rgba(0, 255, 136,0.2);
}

/* =========================================================
   FORMULARIO PRELIMINAR (DATOS DEL CENTRO DE TRABAJO)
========================================================= */
.nom036-form-grid {
    margin-bottom: 20px;
}
.nom036-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nom036-input-group label {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.nom036-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(0, 255, 136,0.3);
    color: #fff;
    border-radius: 6px;
    padding: 10px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.9rem;
}
.nom036-select:focus {
    border-color: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136,0.4);
}

/* =========================================================
   ESTILOS DE IMPRESIÓN (MEMBRETADA PDF)
========================================================= */

/* Ocultar el contenedor por defecto de forma segura (evita bug de Chrome con display: none) */
#print-report-container { 
    position: absolute;
    left: -9999px;
    top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: -1000;
}

@media print {
    /* Ocultar toda la interfaz interactiva y fondos mediante display: none para que no ocupen espacio físico en la página */
    body > *:not(#print-report-container) {
        display: none !important;
    }
    
    /* Configuración de la página */
    @page {
        size: letter;
        margin: 0.5cm 1cm 1cm 1cm;
    }

    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
        display: block !important; /* SOBREESCRIBE display: flex DE LA APP PRINCIPAL */
        position: static !important;
    }

    /* Mostrar el contenedor de impresión */
    #print-report-container {
        display: block !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 100%;
        color: #000;
        font-family: 'Arial', sans-serif;
        background: #ffffff;
    }

    /* Estilos formales de tabla del reporte */
    .print-header {
        background-color: #0f4b55 !important;
        color: #ffffff !important;
        padding: 6px;
        text-align: center;
        font-weight: bold;
        font-size: 13pt;
        border: 1px solid #0f4b55;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .print-section-title {
        background-color: #e5e0d8 !important;
        color: #000 !important;
        padding: 4px 8px;
        text-align: center;
        font-weight: bold;
        font-size: 11pt;
        border: 1px solid #ccc;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 8px;
        font-size: 9.5pt;
    }
    
    .print-table td {
        border: 1px solid #ffffff;
        padding: 4px 6px;
    }

    /* Filas — color uniforme gris claro (todas usan .print-row-light) */
    .print-row-light td:nth-child(1) { background-color: #e8e8e8 !important; font-weight: bold; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-row-light td:nth-child(2) { background-color: #f2f2f2 !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Resultados del motor */
    .print-result-box {
        margin-top: 8px;
        border: 2px solid #ccc;
        padding: 8px 12px;
    }
    .print-result-title {
        font-weight: bold;
        font-size: 11pt;
        margin-bottom: 6px;
        text-align: center;
    }
    .print-breakdown {
        width: 100%;
        border-collapse: collapse;
        margin-top: 6px;
    }
    .print-breakdown th, .print-breakdown td {
        border: 1px solid #ccc;
        padding: 4px 8px;
        text-align: left;
    }
    .print-breakdown th {
        background-color: #e5e0d8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}










/* Custom Select Options Styling */
select.nom036-input option { background-color: #111; color: #fff; padding: 10px; }


select.nom036-input { 
    color-scheme: dark; 
    height: 42px; 
    box-sizing: border-box; 
    line-height: normal; 
}

.nom036-custom-select-wrapper { position: relative; width: 100%; user-select: none; }
.nom036-custom-select-trigger { 
    height: 42px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.10); /* Estandarizado con otros inputs */
    color: #fff; padding: 0 12px; display: flex; align-items: center; cursor: pointer; border-radius: 6px;
    transition: all 0.3s ease;
}
.nom036-custom-select-wrapper.open .nom036-custom-select-trigger {
    border: 1px solid rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 10px rgba(0,255,136,0.15);
}
.nom036-custom-select-options { 
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    background: #1a1a1a; border: 1px solid rgba(0, 255, 136,0.3); border-top: none;
    max-height: 200px; overflow-y: auto; display: none;
}
.nom036-custom-select-options.open { display: block; }
.nom036-custom-select-option { padding: 10px; cursor: pointer; color: #fff; }
.nom036-custom-select-option:hover { background: rgba(0, 255, 136,0.1); }

/* CLASE A PRUEBA DE BALAS PARA OCULTAR EL SELECT NATIVO */
.nom036-native-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: hidden !important;
}

/* Layout modifications for horizontal options testing */
.nom036-risk-factor-block.horizontal-layout {
    grid-column: 1 / -1; /* Make it take the full width of the parent grid */
}
.nom036-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nom036-risk-factor-block.horizontal-layout .nom036-options-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}
.nom036-risk-factor-block.horizontal-layout .nom036-card-option {
    flex: 1;
    min-width: 200px;
}
.nom036-risk-factor-block.horizontal-layout .nom036-card-title {
    font-size: 1.08rem; /* +2 points approx */
}
.nom036-risk-factor-block.horizontal-layout .nom036-card-desc {
    font-size: 0.81rem; /* +1 point approx */
}
.nom036-risk-factor-block.horizontal-layout .nom036-factor-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
}
.nom036-risk-factor-block.horizontal-layout .nom036-card-icon {
    font-size: 3.5rem; /* Scale up emojis to match the new image sizes */
}

/* Base style for icons to avoid layout shift when border is added */
.nom036-card-icon img {
    box-sizing: border-box;
    border: 2px solid transparent;
}

/* Glowing borders for the monitos icon based on selection color */
.nom036-card-option.selected-verde .nom036-card-icon img {
    border-color: var(--risk-green);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}
.nom036-card-option.selected-amarillo .nom036-card-icon img {
    border-color: var(--risk-yellow);
    box-shadow: 0 0 8px rgba(255, 214, 0, 0.4);
}
.nom036-card-option.selected-rojo .nom036-card-icon img {
    border-color: var(--risk-red);
    box-shadow: 0 0 8px rgba(255, 45, 85, 0.4);
}
.nom036-card-option.selected-morado .nom036-card-icon img {
    border-color: var(--risk-purple);
    box-shadow: 0 0 8px rgba(213, 0, 249, 0.4);
}

/* 8-column grid layout for Datos Generales */
.nom036-eval-section .nom036-datos-generales-grid {
    grid-template-columns: repeat(8, 1fr);
}
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(1) {
    grid-column: span 4;
}
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(2),
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(3),
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(4),
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(5),
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(6),
.nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(7) {
    grid-column: span 2;
}
@media (max-width: 900px) {
    .nom036-eval-section .nom036-datos-generales-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(1) {
        grid-column: span 4;
    }
    .nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(n+2) {
        grid-column: span 2;
    }
}
@media (max-width: 720px) {
    .nom036-eval-section .nom036-datos-generales-grid {
        grid-template-columns: 1fr;
    }
    .nom036-eval-section .nom036-datos-generales-grid > .nom036-form-group:nth-child(n) {
        grid-column: span 1;
    }
}



/* Ajuste específico para Cargas en Equipo (8 elementos, 2 filas de 4) */
#nom036-sec-equipo .nom036-datos-generales-grid > .nom036-form-group {
    grid-column: span 2 !important;
}

.nom036-tab-wrapper.xrz-st-stacking,
.nom036-scroll-body.xrz-st-stacking {
    position: relative;
}
#nom036-pre-form.xrz-st-leaving,
#nom036-panel.xrz-st-leaving {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none !important;
    box-sizing: border-box;
}
#nom036-pre-form.xrz-st-entering,
#nom036-panel.xrz-st-entering {
    position: relative;
    z-index: 1;
    pointer-events: none !important;
}
.nom036-section.xrz-st-entering {
    display: block !important;
    position: relative;
    z-index: 1;
    pointer-events: none !important;
}
.nom036-section.xrz-st-leaving {
    display: block !important;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none !important;
    box-sizing: border-box;
}

/* Resultados / warnings: fade corto local (no son cambio de escenario) */
@keyframes nomFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.nom036-result-panel.visible,
.nom036-custom-select-options.open,
.nom036-warning.visible {
    animation: nomFadeIn 0.3s ease-out forwards;
}
