/* ═══════════════════════════════════════════════════════════════════════
   talleres.css — «Mujeres que Transforman su Futuro»
   Página pública del cliente (Vero García · Carchi Violeta).
   CSS PROPIO: cero CSS de plataforma (firewall multi-tenant, golpe 1683).
   Paleta: papel beige + violeta del logo Carchi Violeta (#9018c0).
   Mobile-first (390×844). Sin librerías externas.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --violeta:        #9018c0;
  --violeta-deep:   #6d0f93;
  --violeta-soft:   #f5eafc;
  --violeta-line:   rgba(144, 24, 192, .18);
  --ink:            #2b2233;
  --ink-soft:       #5d5268;
  --ink-dim:        #8a8090;
  --paper:          #f7f1e6;
  --card:           rgba(255, 255, 255, .80);
  --card-solid:     #fffdf9;
  --line:           rgba(43, 34, 51, .10);
  --ok:             #1d8f4e;
  --err:            #b32d1f;
  --shadow:         0 10px 30px rgba(43, 34, 51, .10);
  --shadow-sm:      0 4px 14px rgba(43, 34, 51, .08);
  --radius:         18px;
  --radius-sm:      12px;
  --font:           'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url('/verogarcia/img/talleres/fondo-beige.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilidades ─────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 90;
  background: var(--violeta); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--violeta);
  outline-offset: 3px;
  border-radius: 8px;
}

h1:focus-visible, h2:focus-visible { outline-offset: 6px; border-radius: 10px; outline-width: 2px; }

/* ── Splash / loader (solo en esta página) ──────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--paper);
  background-image: url('/verogarcia/img/talleres/fondo-beige.jpg');
  background-size: cover; background-position: center;
  transition: opacity .45s ease, visibility .45s ease;
}
.splash.is-off { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.splash-logo { width: 128px; height: 128px; max-width: 42vw; max-height: 42vw; }

/* Ruedita diseñada a medida: anillo violeta con radios y un sector lleno */
.rueda { width: 46px; height: 46px; display: block; }
.rueda .aro {
  fill: none; stroke: rgba(144, 24, 192, .22); stroke-width: 4;
}
.rueda .sector {
  fill: none; stroke: var(--violeta); stroke-width: 4;
  stroke-linecap: round; stroke-dasharray: 26 100; transform-origin: 24px 24px;
}
.rueda .radio { stroke: rgba(144, 24, 192, .55); stroke-width: 2; stroke-linecap: round; }
.rueda .giro { transform-origin: 24px 24px; animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.splash-txt { margin: 0; font-size: .85rem; color: var(--ink-soft); letter-spacing: .02em; }

/* ── Barra superior: atrás + progreso ───────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: .55rem .9rem;
  background: rgba(247, 241, 230, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; max-width: 620px; margin: 0 auto;
}
.back {
  flex: 0 0 auto;
  border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .82rem; font-weight: 500;
  padding: .35rem .5rem; margin-left: -.3rem; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: .25rem;
  transition: color .2s, background .2s;
}
.back:hover { color: var(--violeta-deep); background: rgba(144, 24, 192, .08); }
.back[hidden] { display: none; }

.pasos {
  flex: 1 1 auto; display: flex; gap: 4px; list-style: none;
  margin: 0; padding: 0;
}
.pasos li {
  flex: 1 1 0; height: 5px; border-radius: 999px;
  background: rgba(43, 34, 51, .12); overflow: hidden;
}
.pasos li::after {
  content: ''; display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--violeta), var(--violeta-deep));
  transition: width .35s ease;
}
.pasos li.is-on::after { width: 100%; }
.pasos li.is-now::after { width: 60%; }
.paso-txt {
  flex: 0 0 auto; font-size: .72rem; font-weight: 600; color: var(--ink-dim);
  font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.wrap {
  width: 100%; max-width: 620px; margin: 0 auto;
  padding: 1.1rem 1.05rem 3.2rem;
}

.screen { display: none; }
.screen.is-active { display: block; animation: aparecer .35s ease both; }
@media (prefers-reduced-motion: reduce) { .screen.is-active { animation: none; } }
@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.1rem;
}
.card + .card { margin-top: .9rem; }

/* ── Tipografía ─────────────────────────────────────────────────────── */
h1, h2 { margin: 0; line-height: 1.22; letter-spacing: -.01em; display: inline-block; max-width: 100%; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.22rem; font-weight: 600; }
.kicker {
  margin: 0 0 .55rem; font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--violeta-deep);
}
.lead { margin: .8rem 0 0; font-size: .95rem; color: var(--ink-soft); }
.lead strong { color: var(--ink); font-weight: 600; }
.help { margin: .5rem 0 0; font-size: .8rem; color: var(--ink-soft); }

/* ── Pantalla 1: bienvenida ─────────────────────────────────────────── */
.portada { text-align: center; }
.portada .marca { width: 96px; height: 96px; margin: 0 auto .7rem; display: block; }
.portada h1 { font-size: 1.62rem; }
.portada .filete {
  width: 54px; height: 3px; margin: .9rem auto; border-radius: 999px;
  background: linear-gradient(90deg, var(--violeta), var(--violeta-deep));
}
.terminos {
  margin: 1rem 0 0; padding: .7rem .8rem; text-align: left;
  font-size: .78rem; line-height: 1.5; color: var(--ink-soft);
  background: var(--violeta-soft); border: 1px solid var(--violeta-line);
  border-radius: var(--radius-sm);
}

/* ── Fila de logos aliados (chicos y discretos, pero legibles) ────────
   Los cinco PNG son lienzos de 320×320 con MUCHÍSIMO relleno transparente
   distinto en cada uno (el n.º 3 es un logotipo apaisado: su tinta ocupa
   el 12% del alto; el n.º 2 va a la mitad por pedido del dueño). Por eso
   cada logo lleva su propia caja + `background-size` calculados sobre la
   caja real de tinta (medida con PIL): así los cinco se ven a la misma
   altura óptica (~25 px; el n.º 2 a 12,5 px por pedido del dueño, y el
   n.º 3 con 48 px de ancho porque es un logotipo apaisado).
   Los nombres salen de los archivos que dio el dueño: el n.º 2 es
   «Fundación Raíces» (nunca fue BlockBerry; corregido en golpe 4121). ── */
.aliados {
  --al: 1;                       /* escala óptica de la tira (sube en escritorio) */
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: .55rem .8rem;
  margin: 1.4rem 0 0; padding: .85rem .2rem 0;
  border-top: 1px solid var(--line);
}
.aliados .rotulo {
  flex-basis: 100%; text-align: center; font-size: .64rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim);
}
.aliados .aliado {
  display: block; flex: 0 0 auto;
  background-color: rgba(255, 255, 255, .92);
  background-repeat: no-repeat; background-position: center;
  border: 1px solid rgba(43, 34, 51, .09); border-radius: 10px;
  opacity: .98;
}
.aliados .al-1 {
  width: calc(var(--al) * 44px); height: calc(var(--al) * 35px);
  background-image: url('/verogarcia/img/talleres/aliado-1-carchi-violeta-gris.png');
  background-size: calc(var(--al) * 43.5px) calc(var(--al) * 43.5px);
}
.aliados .al-2 {   /* «Fundación Raíces» — a la mitad, como pidió el dueño */
  width: calc(var(--al) * 27.4px); height: calc(var(--al) * 22.5px);
  background-image: url('/verogarcia/img/talleres/aliado-2.png');
  background-size: calc(var(--al) * 22.2px) calc(var(--al) * 22.2px);
}
.aliados .al-3 {
  width: calc(var(--al) * 64px); height: calc(var(--al) * 20.7px);
  background-image: url('/verogarcia/img/talleres/aliado-3-blockberry.png');
  background-size: calc(var(--al) * 85.8px) calc(var(--al) * 85.8px);
}
.aliados .al-6 {
  width: calc(var(--al) * 34.7px); height: calc(var(--al) * 35px);
  background-image: url('/verogarcia/img/talleres/aliado-6-embajada-china.png');
  background-size: calc(var(--al) * 37px) calc(var(--al) * 37px);
}
.aliados .al-7 {
  width: calc(var(--al) * 38.9px); height: calc(var(--al) * 35px);
  background-image: url('/verogarcia/img/talleres/aliado-7-gerbi.png');
  background-size: calc(var(--al) * 43.3px) calc(var(--al) * 43.3px);
}

/* ── Formularios ────────────────────────────────────────────────────── */
.campo { margin-top: .85rem; }
.campo:first-of-type { margin-top: 0; }
.campo label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: .3rem;
}
.campo input[type="text"], .campo input[type="tel"] {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--card-solid); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem .8rem;
  transition: border-color .2s, box-shadow .2s;
}
.campo input::placeholder { color: var(--ink-dim); }
.campo input:focus {
  outline: none; border-color: var(--violeta);
  box-shadow: 0 0 0 3px rgba(144, 24, 192, .16);
}
.campo input[aria-invalid="true"] { border-color: var(--err); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.dos .campo { margin-top: 0; }

/* WhatsApp: prefijo fijo + 9 dígitos */
.tel { display: flex; align-items: stretch; gap: .5rem; }
.tel .prefijo {
  display: inline-flex; align-items: center; padding: 0 .7rem;
  font-size: .95rem; font-weight: 600; color: var(--violeta-deep);
  background: var(--violeta-soft); border: 1.5px solid var(--violeta-line);
  border-radius: var(--radius-sm); white-space: nowrap;
}
.tel input { flex: 1 1 auto; min-width: 0; letter-spacing: .06em; }

/* ── Tarjetas de opción (cantón / curso) ────────────────────────────── */
.rejilla { display: grid; gap: .6rem; margin-top: 1rem; }
.rejilla.canton { grid-template-columns: 1fr 1fr; }
.rejilla.parroquia { grid-template-columns: 1fr; }
.rejilla.curso { grid-template-columns: 1fr 1fr; }

.opcion {
  position: relative; display: block; width: 100%; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card-solid); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem .75rem;
  transition: border-color .18s, box-shadow .18s, transform .12s, background .18s;
}
.opcion:hover { border-color: var(--violeta-line); box-shadow: var(--shadow-sm); }
.opcion:active { transform: scale(.985); }
.opcion[aria-pressed="true"] {
  border-color: var(--violeta); background: var(--violeta-soft);
  box-shadow: 0 0 0 3px rgba(144, 24, 192, .14);
}
.opcion[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: .35rem; right: .45rem;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--violeta); color: #fff; font-size: .72rem; font-weight: 700;
}
.opcion .nombre { font-weight: 600; font-size: .92rem; line-height: 1.35; display: block; overflow-wrap: anywhere; }
.opcion .sub { display: block; margin-top: .1rem; font-size: .74rem; color: var(--ink-dim); }
.opcion[disabled] { opacity: .55; cursor: progress; }

/* Tarjeta de curso con foto */
.opcion.curso { padding: 0; overflow: hidden; }
.opcion.curso .foto { display: block; position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--violeta-soft); }
.opcion.curso .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opcion.curso .horas {
  position: absolute; left: .4rem; bottom: .4rem;
  background: rgba(43, 34, 51, .74); color: #fff;
  font-size: .66rem; font-weight: 600; letter-spacing: .04em;
  padding: .14rem .42rem; border-radius: 999px;
  white-space: nowrap;
}
.opcion.curso .pie { display: block; padding: .55rem .6rem .65rem; }
.opcion.curso[aria-pressed="true"]::after { top: .35rem; right: .35rem; }

/* ── Botón principal ────────────────────────────────────────────────── */
.btn {
  display: block; width: 100%; margin-top: 1.25rem;
  font: inherit; font-size: 1rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--violeta), var(--violeta-deep));
  border: 0; border-radius: 999px; padding: .88rem 1.2rem;
  cursor: pointer; box-shadow: 0 8px 20px rgba(144, 24, 192, .28);
  transition: filter .2s, transform .12s, box-shadow .2s;
}
/* El CTA de los PASOS nunca se corta: cuando el paso es más alto que la
   pantalla (parroquia con 11 opciones, curso con 4 fotos, aviso de falla),
   el botón se pega al pie visible del viewport y deja aire de seguridad,
   así entra completo aun con la barra de progreso y «Atrás» en móviles
   bajos (360×640). En pasos cortos no se mueve: queda en su lugar natural.
   La PORTADA queda fuera a propósito: su CTA es la aceptación de los
   términos y debe leerse DESPUÉS del texto legal, no taparlo. */
.screen:not(.portada) .btn {
  position: sticky;
  bottom: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 6;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(144, 24, 192, .24); }
.btn[disabled] { opacity: .6; cursor: not-allowed; box-shadow: none; }
/* `display: block` de .btn gana al `[hidden]` del navegador: sin esta regla
   el botón «Volver» de la pantalla de Curso se veía SIEMPRE, aunque el HTML
   lo marque `hidden` (defecto real que detectó el director de diseño).
   `.back[hidden]` ya tenía su guardia; ahora la tienen todos los botones. */
.btn[hidden] { display: none; }
.aviso[hidden] { display: none; }
.btn.secundario {
  /* Fondo sólido: este botón también puede quedar pegado al pie sobre las
     tarjetas de curso y necesita leerse siempre. */
  background: var(--card-solid); color: var(--violeta-deep);
  border: 1.5px solid var(--violeta-line);
  box-shadow: 0 6px 18px rgba(43, 34, 51, .10);
}

/* ── Avisos (validación / falla suave) ──────────────────────────────── */
.aviso {
  margin-top: .95rem; padding: .7rem .8rem; border-radius: var(--radius-sm);
  font-size: .84rem; line-height: 1.45; display: none;
}
.aviso.is-on { display: block; }
.aviso.error { background: #fdecea; border: 1px solid rgba(179, 45, 31, .28); color: var(--err); }
.aviso.info  { background: var(--violeta-soft); border: 1px solid var(--violeta-line); color: var(--violeta-deep); }
.aviso.ok    { background: #e9f7ef; border: 1px solid rgba(29, 143, 78, .28); color: var(--ok); }

/* ── Pantalla 7: cierre ─────────────────────────────────────────────── */
.cierre { text-align: center; }
.cierre .sello {
  width: 60px; height: 60px; margin: 0 auto .8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--violeta); color: #fff; font-size: 1.8rem; font-weight: 700;
}
.resumen {
  margin: 1.1rem 0 0; padding: 0; list-style: none; text-align: left;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.resumen li {
  display: flex; justify-content: space-between; gap: .8rem;
  padding: .6rem .8rem; font-size: .87rem; border-top: 1px solid var(--line);
}
.resumen li:first-child { border-top: 0; }
.resumen .k { color: var(--ink-dim); flex: 0 0 auto; }
.resumen .v { font-weight: 600; text-align: right; word-break: break-word; }

/* ── Móvil angosto (360 px) — que respire, sin apretar ────────────────
   La tarjeta gana ancho útil y el título baja un punto para no partirse
   en tres líneas; el texto legal sube un poco. Sigue siendo el mismo
   diseño: nada cambia de color ni de estructura. ── */
@media (max-width: 400px) {
  .wrap { padding-left: .95rem; padding-right: .95rem; }
  .card { padding: 1.15rem 1rem 1.2rem; }
  h1 { font-size: 1.42rem; }
  .portada h1 { font-size: 1.5rem; }
  h2 { font-size: 1.16rem; }
  h1, h2 { line-height: 1.3; }
  .kicker { letter-spacing: .07em; }
  .lead { font-size: .93rem; }
  .terminos { font-size: .8rem; }
  .opcion { padding: .78rem .8rem; }
  .opcion.curso { padding: 0; }
  .dos { gap: .6rem; }
}

/* ── Escritorio ─────────────────────────────────────────────────────── */
@media (min-width: 620px) {
  .wrap { padding: 1.8rem 1.2rem 4rem; }
  h1 { font-size: 1.8rem; }
  .portada h1 { font-size: 2rem; }
  .portada .marca { width: 116px; height: 116px; }
  .card { padding: 1.7rem 1.6rem; }
  .rejilla.canton { grid-template-columns: repeat(3, 1fr); }
  .rejilla.parroquia { grid-template-columns: repeat(3, 1fr); }
  .rejilla.curso { grid-template-columns: repeat(4, 1fr); }
  .aliados { --al: 1.15; }   /* la tira crece en escritorio, misma escala óptica */
}

@media (min-width: 900px) {
  body { background-attachment: fixed; }
}

/* ── Accesibilidad de movimiento ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
  .rueda .giro { animation: none; }
  .screen.is-active { animation: none; }
  .pasos li::after { transition: none; }
  .opcion, .btn { transition: none; }
}
