/* Plantilla visual compartida SalConAmigos, versión 1. No altera lógica PHP ni formularios. */
html.sca-ui {
  --sca-font: Arial,Helvetica,sans-serif;
  --sca-base-size: 16px;
  --sca-title-1: clamp(1.8rem, 3.2vw, 2.35rem);
  --sca-title-2: clamp(1.4rem, 2.4vw, 1.8rem);
  --sca-title-3: 1.18rem;
  --sca-radius: 16px;
  --sca-radius-big: 24px;
  --sca-padding: clamp(16px, 2vw, 24px);
  --sca-gap: 14px;
  --sca-primary: #1565c0;
  --sca-on-primary: #fff;
  --sca-stroke: #dbe7f3;
  --sca-panel: #fff;
  --sca-ink: #142033;
  --sca-soft: #586579;
  color-scheme: light;
}
/* V2.6.1: conservar familia, tamaños, interlineado y espaciado vigentes.
   Las páginas interiores también utilizan system-ui. No imponer Arial a
   su texto, títulos o formularios; --sca-font solo estiliza componentes nuevos. */
html.sca-ui header:not(.card) .brand img,
html.sca-ui header:not(.card) .brand > img,
html.sca-ui .topbar .brand img {
  aspect-ratio:1;
  object-fit:contain;
  border-radius:10px;
  flex-shrink:0;
}
html.sca-ui .loginLogo {max-width:100%;object-fit:contain;}
html.sca-ui :is(button, a, input, select, textarea, summary):focus-visible {
  outline:3px solid #e39045;
  outline-offset:3px;
}
html.sca-ui :is(.card,.plan-card,.roleCard,.formCard) {border-radius:var(--sca-radius-big);}
@media(max-width:700px){
  /* Los fondos decorativos nunca deben crear desplazamiento horizontal en móvil. */
  html.sca-ui,html.sca-ui body {overflow-x:clip;}
  html.sca-ui {--sca-title-1:clamp(1.65rem,6.8vw,2rem);--sca-title-2:1.4rem;}
}
@media(prefers-reduced-motion: reduce){
  html.sca-ui *, html.sca-ui *::before, html.sca-ui *::after {scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important;}
}

/* Tema original / diario: SIEMPRE existe y vuelve al terminar cualquier celebración. */
html.sca-ui[data-sca-theme="diario"] {
  --sca-primary:#1565c0;
  --sca-on-primary:#fff;
  --sca-panel:#fff;
  --sca-ink:#142033;
  --sca-stroke:#dbe7f3;
  color-scheme:light;
}
/* El tema de Halloween utiliza la paleta real que ya existe en producción. */
html.sca-ui[data-sca-theme="halloween"] {
  --sca-primary:#d57938;
  --sca-on-primary:#fff;
  --sca-panel:#241822;
  --sca-ink:#ffefdd;
  --sca-stroke:#915837;
  color-scheme:light;
}
/* Los bloques internos de lectura conservan texto oscuro sobre fondo claro. */
html.sca-ui[data-sca-theme="halloween"] :is(.plan-card,.roleCard,.quick-item,.notice,.participation-summary) {color:#172033;}
/* V2.6.1: las tarjetas blancas no heredan las tintas claras de la portada.
   Las fichas y el registro conservan sus cabeceras oscuras específicas. */
html.sca-ui[data-sca-theme="halloween"] :is(.card,.legalPage,main > section:not([class]),.filtros,.tarjeta,.plan-card,.rel-card,.quick-item) {
  --muted:#52606f;
  --texto:#172033;
  color:var(--text,#172033);
}
html.sca-ui[data-sca-theme="halloween"] .cabecera .marca {color:#fff4eb;}
html.sca-ui[data-sca-theme="halloween"] main.contenedor > :is(h1,.ayuda) {color:#fff0e5;}

/* V2: misma escala institucional en portada, fichas, registro y paneles.
   Solo afecta a zonas compartidas; cada página conserva su propia información. */
html.sca-ui {--sca-header-logo:40px;--sca-header-text:1rem;--sca-header-sub:0.78rem;--sca-control-min:44px;}
html.sca-ui .topbar {width:min(100%,1320px);box-sizing:border-box;}
html.sca-ui header .brand {display:inline-flex;align-items:center;gap:10px;min-width:0;}
html.sca-ui header .brand img {object-fit:contain;flex:none;}
html.sca-ui :is(.topbar nav a.btn,header .btn) {min-height:var(--sca-control-min);}
html.sca-ui .roleCard {text-decoration:none;}
html.sca-ui :is(input,select,textarea,button) {max-width:100%;}
html.sca-ui :is(.wrap,.plan-wrap) {min-width:0;}
@media(max-width:700px){html.sca-ui {--sca-header-logo:36px;}}

/* V2.3 · formulario de ayuda público, sin alterar formularios existentes */
html.sca-ui .sca-ayuda-flotante {position:fixed;bottom:calc(18px + env(safe-area-inset-bottom, 0px));right:16px;z-index:2500;display:inline-flex;align-items:center;justify-content:center;max-width:min(82vw,270px);padding:11px 15px;background:#1565c0;color:#fff!important;border:2px solid #fff;border-radius:999px;box-shadow:0 5px 20px #0004;font:700 13px/1.2 var(--sca-font);text-decoration:none;}
html.sca-ui .sca-ayuda-flotante:hover {background:#00458d;}
html.sca-ui[data-sca-theme="halloween"] .sca-ayuda-flotante {background:#792f24;color:#fff!important;border-color:#ffc77d;}
@media(max-width:550px){html.sca-ui .sca-ayuda-flotante{font-size:12px;right:10px;bottom:calc(12px + env(safe-area-inset-bottom, 0px));padding:10px 12px}}
.sca-ayuda-page{min-height:100vh;box-sizing:border-box;max-width:850px;margin:0 auto;padding:24px 16px 48px;font-family:var(--sca-font,system-ui,sans-serif);color:#192d43;}
.sca-ayuda-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:28px;}
.sca-ayuda-brand{display:inline-flex;align-items:center;gap:12px;text-decoration:none;color:inherit;}
.sca-ayuda-brand img{width:50px;height:50px;object-fit:contain;}
.sca-ayuda-brand strong,.sca-ayuda-brand small{display:block;line-height:1.3;}
.sca-ayuda-brand strong{font-weight:850;font-size:20px;}
.sca-ayuda-brand small{color:#536a7b;font-size:12px;}
.sca-ayuda-volver{color:#1552a2;font-weight:650;}
.sca-ayuda-card{background:#fff;color:#172c40;border:1px solid #d4dfeb;border-radius:20px;padding:clamp(18px,4vw,34px);box-shadow:0 8px 35px #203a521c;}
.sca-ayuda-kicker{font-size:12px;color:#1a61a6;letter-spacing:1.2px;font-weight:800;}
.sca-ayuda-card h1{font-size:clamp(28px,4vw,36px);color:#172c40;margin:8px 0 12px;}
.sca-ayuda-card p{line-height:1.6;}
.sca-ayuda-form{display:grid;gap:10px;margin-top:20px;}
.sca-ayuda-form label{font-size:15px;font-weight:700;}
.sca-ayuda-form :is(input[type="email"],select,textarea){width:100%;min-width:0;box-sizing:border-box;padding:12px 14px;border-radius:10px;border:1px solid #8d9fb2;background:#fff;color:#192d43;font:inherit;font-size:16px;}
.sca-ayuda-form textarea{resize:vertical;}
.sca-ayuda-form .sca-ayuda-check{display:flex;align-items:flex-start;gap:10px;line-height:1.45;font-size:14px;font-weight:500;}
.sca-ayuda-check input{width:18px;height:18px;margin:1px 0;flex:0 0 auto;}
.sca-ayuda-oculto{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden;}
.sca-ayuda-aviso{padding:12px;border-radius:10px;background:#f0f6fb;color:#334e63;margin:6px 0;font-size:14px;}
.sca-ayuda-origen{font-size:13px;overflow-wrap:anywhere;}
.sca-ayuda-enviar{border:0;border-radius:12px;background:#1565c0;color:#fff;font-weight:750;padding:14px 20px;cursor:pointer;min-height:46px;}
.sca-ayuda-enviar:hover{background:#00458d;}
.sca-ayuda-error,.sca-ayuda-correcto{padding:15px;border-radius:12px;line-height:1.6;margin:15px 0;}
.sca-ayuda-error{border:1px solid #e3b1b1;background:#fff1f1;color:#7b1b1b;}
.sca-ayuda-correcto{border:1px solid #92c7aa;background:#e9f8ef;color:#154d2b;}
.sca-ayuda-alternativa{margin:20px 0 0;font-size:14px;}
.sca-ayuda-pie{text-align:center;color:#586579;font-size:14px;margin-top:24px;}
.sca-ayuda-pie a{color:#1552a2;}
html.sca-ui[data-sca-theme="halloween"] .sca-ayuda-page{color:#ffead8;}
html.sca-ui[data-sca-theme="halloween"] .sca-ayuda-volver{color:#ffcc8b;}
html.sca-ui[data-sca-theme="halloween"] .sca-ayuda-brand small{color:#ecc9ac;}
html.sca-ui[data-sca-theme="halloween"] .sca-ayuda-pie a{color:#ffcc8b;}
@media(max-width:500px){.sca-ayuda-page{padding:14px 12px 40px;}.sca-ayuda-brand strong{font-size:18px;}.sca-ayuda-brand img{height:42px;width:42px;}.sca-ayuda-volver{font-size:13px;}}

/* V2.4: el botón de incidencias no tapa la navegación inferior en móvil. */
@media (max-width:899px) {
 html.sca-ui body:has(.bottomNav, .bottom-nav) .sca-ayuda-flotante {
   bottom:calc(82px + env(safe-area-inset-bottom, 0px));
 }
}
