/* ==========================================================
   Primer Encuentro Nacional de la Familia
   Base común: paleta, tipografía y controles de formulario
   ========================================================== */

:root {
    --azul:        #16224A;   /* azul marino de titulares */
    --azul-medio:  #26407F;   /* acento principal */
    --azul-suave:  #EEF1F8;   /* fondo de selección */
    --oro:         #C9A227;   /* acento de marca */
    --oro-suave:   #FBF4DF;
    --crema:       #F4F1E8;   /* fondo de página */
    --linea:       #E3E1D9;   /* bordes */
    --linea-fuerte:#CFCCC1;
    --texto:       #2C3242;
    --tenue:       #767C8C;
    --rojo:        #C0392B;
    --rojo-suave:  #FDF2F1;
    --verde:       #1E7A52;
    --verde-suave: #EAF5EF;
    --sombra:      0 1px 3px rgba(22, 34, 74, .06), 0 8px 32px rgba(22, 34, 74, .07);
    --radio:       10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--crema);
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--texto);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; color: var(--azul); font-weight: 700; line-height: 1.25; }
p { margin: 0 0 12px; }
a { color: var(--azul-medio); }

/* ---------------- Campos ---------------- */
.campo { margin-bottom: 20px; }
.campo:last-child { margin-bottom: 0; }
/* Rótulo del campo. Se excluyen los controles que traen su propio
   formato (interruptor, casilla), para que no hereden las mayúsculas. */
.campo > label:not(.interruptor):not(.casilla) {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--tenue);
    text-transform: uppercase;
    margin-bottom: 7px;
}
.campo .ayuda { display: block; font-size: 13px; color: var(--tenue); margin-top: 6px; line-height: 1.5; }
.req { color: var(--rojo); }

.entrada, .selector {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    font-family: inherit;
    font-size: 16px;
    color: var(--azul);
    background: #fff;
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    transition: border-color .18s ease, box-shadow .18s ease;
    appearance: none;
}
textarea.entrada { height: auto; min-height: 92px; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.selector {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2316224A'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 13px;
    padding-right: 40px;
    cursor: pointer;
}
.entrada::placeholder { color: #A8AEBC; }
.entrada:focus, .selector:focus {
    outline: none;
    border-color: var(--azul-medio);
    box-shadow: 0 0 0 3px rgba(38, 64, 127, .12);
}
.entrada.error, .selector.error { border-color: var(--rojo); background: var(--rojo-suave); }

.mensaje-error { display: none; font-size: 13px; color: var(--rojo); margin-top: 6px; font-weight: 500; }
.mensaje-error.visible { display: block; }

.rejilla { display: grid; gap: 16px; }
.rejilla.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------- Opciones marcables ---------------- */
.opciones { display: flex; flex-wrap: wrap; gap: 9px; }
.opciones.apiladas { flex-direction: column; }
.opcion { position: relative; flex: 1 1 auto; min-width: 140px; }
.opciones.apiladas .opcion { min-width: 0; }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-caja {
    display: flex; align-items: center; gap: 10px; height: 100%;
    cursor: pointer; background: #fff;
    border: 1px solid var(--linea); border-radius: var(--radio);
    padding: 13px 15px; font-size: 15px; font-weight: 600; color: var(--azul);
    transition: all .18s ease; line-height: 1.35;
}
.opcion-caja .marca {
    width: 18px; height: 18px; min-width: 18px;
    border: 2px solid var(--linea-fuerte); border-radius: 50%;
    position: relative; transition: all .18s ease;
}
.opcion-caja .marca::after {
    content: ''; position: absolute; inset: 2px;
    border-radius: 50%; background: var(--azul-medio);
    transform: scale(0); transition: transform .16s ease;
}
.opcion-caja .sub { display: block; font-weight: 400; font-size: 13px; color: var(--tenue); margin-top: 1px; }
.opcion-caja:hover { border-color: var(--azul-medio); }
.opcion input:checked + .opcion-caja { border-color: var(--azul-medio); background: var(--azul-suave); }
.opcion input:checked + .opcion-caja .marca { border-color: var(--azul-medio); }
.opcion input:checked + .opcion-caja .marca::after { transform: scale(1); }
.opcion input:focus-visible + .opcion-caja { box-shadow: 0 0 0 3px rgba(38, 64, 127, .25); }

.casilla { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; }
.casilla input { position: absolute; opacity: 0; pointer-events: none; }
.casilla .caja {
    width: 20px; height: 20px; min-width: 20px; margin-top: 1px;
    border: 1px solid var(--linea-fuerte); border-radius: 5px; background: #fff;
    display: flex; align-items: center; justify-content: center; transition: all .18s ease;
}
.casilla .caja::after {
    content: ''; width: 9px; height: 5px; margin-top: -3px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(.5); opacity: 0; transition: all .16s ease;
}
.casilla input:checked + .caja { background: var(--azul-medio); border-color: var(--azul-medio); }
.casilla input:checked + .caja::after { opacity: 1; transform: rotate(-45deg) scale(1); }

/* ---------------- Botones ---------------- */
.boton {
    font-family: inherit; font-size: 15px; font-weight: 700;
    border: none; border-radius: 40px; padding: 0 28px; height: 48px;
    cursor: pointer; transition: all .2s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    white-space: nowrap; text-decoration: none;
}
.boton-principal { background: var(--azul); color: #fff; }
.boton-principal:hover { background: var(--azul-medio); }
.boton-oro { background: var(--oro); color: var(--azul); }
.boton-oro:hover { background: #b8931f; }
.boton-suave { background: transparent; color: var(--azul); border: 1px solid var(--linea-fuerte); }
.boton-suave:hover { border-color: var(--azul-medio); color: var(--azul-medio); }
.boton-texto { background: none; border: none; color: var(--azul-medio); font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; font-size: 14px; }
.boton-texto:hover { text-decoration: underline; }
.boton:disabled { opacity: .45; cursor: not-allowed; }
.boton-bloque { width: 100%; }
.boton-chico { height: 38px; padding: 0 16px; font-size: 13px; }

/* ---------------- Etiquetas ---------------- */
.etiqueta {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; border-radius: 30px; padding: 4px 11px;
    background: var(--azul-suave); color: var(--azul-medio); white-space: nowrap;
}
.etiqueta.oro { background: var(--oro-suave); color: #8A6D12; }
.etiqueta.verde { background: var(--verde-suave); color: var(--verde); }
.etiqueta.roja { background: var(--rojo-suave); color: var(--rojo); }
.etiqueta.neutra { background: #F0EFEA; color: var(--tenue); }

/* ---------------- Avisos ---------------- */
.aviso {
    display: flex; gap: 11px; align-items: flex-start;
    background: var(--azul-suave); border-radius: var(--radio);
    padding: 14px 16px; font-size: 14.5px; line-height: 1.55; color: var(--azul);
    margin-bottom: 16px;
}
.aviso:last-child { margin-bottom: 0; }
.aviso i { font-size: 17px; line-height: 1.4; color: var(--azul-medio); flex-shrink: 0; }
.aviso.oro { background: var(--oro-suave); color: #6B540E; }
.aviso.oro i { color: #A5811A; }
.aviso.rojo { background: var(--rojo-suave); color: #8A2B22; }
.aviso.rojo i { color: var(--rojo); }
.aviso.verde { background: var(--verde-suave); color: #14563A; }
.aviso.verde i { color: var(--verde); }

/* ---------------- Tablas ---------------- */
.tabla-scroll { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); background: #fff; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th, .tabla td { padding: 11px 14px; text-align: left; border-top: 1px solid var(--linea); vertical-align: top; }
.tabla thead th {
    background: #FAF9F5; color: var(--azul); border: none; border-bottom: 1px solid var(--linea);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; white-space: nowrap;
}
.tabla tfoot td { background: #FAF9F5; font-weight: 700; color: var(--azul); }
.tabla td.num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla td.fuerte { font-weight: 700; color: var(--azul); }
.tabla tbody tr:hover { background: #FCFBF8; }
.tabla .menor { font-size: 12.5px; color: var(--tenue); font-weight: 400; }

/* ---------------- Modales ---------------- */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(22, 34, 74, .5);
    display: none; align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto;
}
.modal.abierto { display: flex; }
.modal-caja {
    background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
    box-shadow: var(--sombra); animation: aparecer .22s ease;
    max-height: calc(100vh - 80px); display: flex; flex-direction: column;
}
.modal-caja.ancho { max-width: 980px; }
.modal-caja.medio { max-width: 760px; }
.modal-cab {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 24px 28px 16px; border-bottom: 1px solid var(--linea); flex-shrink: 0;
}
.modal-cab h3 { font-size: 19px; }
.modal-cab .sub { font-size: 13.5px; color: var(--tenue); margin: 3px 0 0; }
.modal-cuerpo { padding: 22px 28px; overflow-y: auto; flex: 1; }
.modal-pie {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 28px 22px; border-top: 1px solid var(--linea); flex-wrap: wrap; flex-shrink: 0;
}
.cerrar-modal {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--tenue); font-size: 22px; line-height: 1; flex-shrink: 0;
}
.cerrar-modal:hover { color: var(--azul); }

@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- Utilidades ---------------- */
.oculto { display: none !important; }
.centro { text-align: center; }
.tenue { color: var(--tenue); }
.chico { font-size: 13.5px; }
.m0 { margin: 0 !important; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fila-entre { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.crece { flex: 1; }

@media (max-width: 720px) {
    .rejilla.c2, .rejilla.c3 { grid-template-columns: 1fr; }
    .opcion { min-width: 0; flex: 1 1 100%; }
    .modal { padding: 0; }
    .modal-caja { max-height: 100vh; border-radius: 0; min-height: 100vh; }
    .modal-cab, .modal-cuerpo, .modal-pie { padding-left: 18px; padding-right: 18px; }
}

@media print {
    body { background: #fff; }
    .modal, .boton, .no-imprimir { display: none !important; }
}

/* ==========================================================
   Interruptor
   ========================================================== */
.interruptor {
    display: flex; align-items: flex-start; gap: 13px;
    cursor: pointer; border: 1px solid var(--linea);
    border-radius: var(--radio); padding: 14px 16px; background: #fff;
    transition: all .2s ease;
}
.interruptor:hover { border-color: var(--azul-medio); }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }

.interruptor .palanca {
    width: 42px; height: 24px; min-width: 42px; margin-top: 1px;
    background: #D8D5CB; border-radius: 30px;
    position: relative; transition: background .22s ease;
}
.interruptor .palanca::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
    transition: transform .22s ease;
}
.interruptor input:checked + .palanca { background: var(--azul-medio); }
.interruptor input:checked + .palanca::after { transform: translateX(18px); }
.interruptor input:focus-visible + .palanca { box-shadow: 0 0 0 3px rgba(38, 64, 127, .28); }

.interruptor .texto { flex: 1; text-transform: none; letter-spacing: normal; }
.interruptor .titulo { font-weight: 700; color: var(--azul); font-size: 15px; display: block; line-height: 1.35; }
.interruptor .detalle { font-size: 13px; color: var(--tenue); display: block; margin-top: 2px; line-height: 1.5; }

.interruptor input:checked ~ .texto .titulo { color: var(--azul-medio); }
.interruptor:has(input:checked) { border-color: var(--azul-medio); background: var(--azul-suave); }
