/* Tipografía: Fredoka (títulos y botones), redonda como las formas de la app, y
   Atkinson Hyperlegible (texto), diseñada para que se lea bien con baja visión. */
@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Fredoka:wght@500;600;700&display=swap");

/* Paleta vibrante ("diseño de dopamina"), con todo el texto en contraste AA o más. */
:root {
  --tinta: #1e1033;        /* berenjena casi negra: texto y bordes */
  --fondo: #fbf7ff;        /* lavanda muy clara */
  --superficie: #ffffff;
  --violeta: #6a2bd9;      /* principal: botones y enlaces (7:1 con blanco) */
  --violeta-osc: #4b1d96;
  --fucsia: #d61f75;
  --amarillo: #ffd23f;
  --naranja: #ff6b1a;
  --cian: #00b4d8;
  --verde: #00b67a;
  --alerta: #b3122e;
  --ok: #0a7048;
  --tinte-amarillo: #fff1b8;
  --tinte-rosa: #ffe1ef;
  --tinte-cian: #d7f5fc;
  --tinte-verde: #d2f7e5;
  --tinte-violeta: #eee6fc;

  /* Nombres de antes, para las páginas que aún los usan */
  --acento: var(--violeta);
  --acento-tinta: #ffffff;
  --suave: var(--tinte-violeta);

  --radio: 1.5rem;
  --radio-chico: 1rem;
  --sombra: 0 6px 18px rgba(74, 29, 150, .18);
  --sombra-alta: 0 14px 34px rgba(74, 29, 150, .28);
  --letra-titulo: "Fredoka", "Atkinson Hyperlegible", system-ui, sans-serif;
  --letra-texto: "Atkinson Hyperlegible", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--letra-texto);
  background:
    radial-gradient(40rem 26rem at 105% -10%, rgba(214, 31, 117, .10), transparent 70%),
    radial-gradient(36rem 24rem at -10% 110%, rgba(0, 180, 216, .12), transparent 70%),
    var(--fondo);
  background-attachment: fixed;
  color: var(--tinta);
  line-height: 1.55;
}
h1, h2, h3, button, .boton, figcaption, .etiqueta, label, .menu a strong {
  font-family: var(--letra-titulo);
}
h1, h2, h3 { line-height: 1.2; letter-spacing: .005em; }

header.barra {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1.2rem; color: #fff;
  background: linear-gradient(100deg, var(--violeta-osc), var(--violeta) 45%, var(--fucsia));
  border-radius: 0 0 var(--radio) var(--radio);
  box-shadow: var(--sombra);
}
header.barra a { color: #fff; font-family: var(--letra-titulo); font-weight: 600; text-decoration: none;
  padding: .45rem .9rem; border: 2px solid rgba(255, 255, 255, .9); border-radius: 999px; }
header.barra a:hover { background: rgba(255, 255, 255, .16); }
header.barra h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
/* Botones del encabezado (código para el teléfono y galería), a la derecha. */
header.barra .acciones { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
header.barra .acciones button {
  min-height: 0; font-size: 1rem; padding: .45rem .9rem; border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px; background: transparent; color: #fff; box-shadow: none;
}
header.barra .acciones button:hover { background: rgba(255, 255, 255, .16); transform: none; }

/* Globo grande con el código QR, abierto bajo su botón. */
.con-globo { position: relative; }
.globo-qr {
  position: absolute; right: 0; top: calc(100% + 1rem); z-index: 20;
  width: min(26rem, calc(100vw - 2rem)); padding: 1.4rem; text-align: center;
  background: var(--superficie); color: var(--tinta); border: 3px solid var(--tinta); border-radius: var(--radio);
  box-shadow: var(--sombra-alta);
}
/* La puntita del globo, apuntando al botón. */
.globo-qr::before {
  content: ""; position: absolute; top: -.85rem; right: 2.5rem; width: 1.4rem; height: 1.4rem;
  background: var(--superficie); border-left: 3px solid var(--tinta); border-top: 3px solid var(--tinta);
  border-top-left-radius: .35rem; transform: rotate(45deg);
}
.globo-qr h2 { margin-top: 0; color: var(--violeta-osc); }
.globo-qr #qr svg { display: block; width: 100%; height: auto; border-radius: var(--radio-chico); }
.globo-qr .direccion { font-weight: 700; word-break: break-all; margin-bottom: 0; }
main { max-width: 60rem; margin: 0 auto; padding: 1rem; }
body.ancho main { max-width: 78rem; }

/* Resultado con panel: lo que se mira a la izquierda y la explicación fija a la derecha.
   En el teléfono, uno debajo del otro. */
.con-panel { display: grid; gap: 1rem; align-items: start; }
.con-panel > .panel > :first-child { margin-top: 0; }
@media (min-width: 60rem) {
  .con-panel { grid-template-columns: minmax(0, 1fr) 24rem; }
  .con-panel > .panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
h2 { font-size: 1.55rem; font-weight: 600; margin: 1.1rem 0 .5rem; }
p { margin: .5rem 0; }
.grande { font-size: 1.3rem; }

button, .boton {
  font-family: var(--letra-titulo); font-weight: 600; font-size: 1.15rem; line-height: 1.2;
  min-height: 3.6rem; padding: .7rem 1.4rem;
  border: 3px solid var(--violeta); border-radius: 999px;
  background: var(--violeta); color: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  text-decoration: none; box-shadow: var(--sombra);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
button:hover:not(:disabled), .boton:hover { transform: translateY(-2px); box-shadow: var(--sombra-alta); }
button:active:not(:disabled), .boton:active { transform: translateY(0); box-shadow: var(--sombra); }
button.secundario, .boton.secundario { background: var(--superficie); color: var(--violeta); }
button.peligro { background: var(--superficie); color: var(--alerta); border-color: var(--alerta); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
/* Foco visible sobre cualquier fondo: anillo de tinta con halo amarillo. */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--tinta); outline-offset: 3px; box-shadow: 0 0 0 7px var(--amarillo);
}
@media (prefers-reduced-motion: reduce) {
  button, .boton { transition: none; }
  button:hover:not(:disabled), .boton:hover { transform: none; }
}
.fila { display: flex; flex-wrap: wrap; gap: .7rem; margin: .8rem 0; }
.fila > button, .fila > .boton { flex: 1 1 12rem; }

input[type="text"], input[type="password"], textarea {
  font: inherit; width: 100%; padding: .8rem 1rem; border: 3px solid var(--tinta); border-radius: var(--radio-chico); background: var(--superficie);
}
textarea { min-height: 5rem; }
label { font-weight: 600; display: block; margin-top: .6rem; }

[hidden] { display: none !important; }

.tarjeta { background: var(--superficie); border: 3px solid var(--tinta); border-radius: var(--radio); padding: 1.2rem; margin: 1rem 0; box-shadow: var(--sombra); }
.aprendi { background: var(--tinte-amarillo); border: 3px solid var(--tinta); border-radius: var(--radio); padding: 1.2rem; margin: 1rem 0; box-shadow: var(--sombra); }
.aprendi h2 { margin-top: 0; }
.aviso { border: 3px solid var(--alerta); background: var(--tinte-rosa); color: var(--alerta); border-radius: var(--radio-chico); padding: .8rem 1.1rem; margin: 1rem 0; font-weight: 700; }

.espera { display: flex; align-items: center; gap: 1rem; font-size: 1.3rem; font-weight: 700; padding: 1.5rem 0; }
.espera::before {
  content: ""; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: .4rem solid var(--tinte-violeta); border-top-color: var(--violeta); border-right-color: var(--fucsia);
  animation: giro 1s linear infinite;
}
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .espera::before { animation: none; border-color: var(--violeta); } }

video.camara, canvas.lienzo { width: 100%; max-height: 62vh; background: var(--tinta); border-radius: var(--radio); border: 3px solid var(--tinta); object-fit: contain; box-shadow: var(--sombra); }
canvas.lienzo { background: #fff; touch-action: none; aspect-ratio: 1; max-width: 62vh; display: block; margin: 0 auto; }

.dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.dos figure { margin: 0; }
.dos img { width: 100%; border: 3px solid var(--tinta); border-radius: var(--radio); background: #fff; display: block; box-shadow: var(--sombra); }
figcaption { font-weight: 600; text-align: center; padding-top: .4rem; }

/* Menú */
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.2rem; }
.menu a {
  position: relative; overflow: hidden; display: block; padding: 1.4rem; border: 3px solid var(--tinta);
  border-radius: var(--radio); background: var(--superficie); color: var(--tinta); text-decoration: none;
  box-shadow: var(--sombra); transition: transform .15s ease, box-shadow .15s ease;
}
.menu a:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--sombra-alta); }
/* Una mancha redonda de fondo en cada tarjeta. */
.menu a::after {
  content: ""; position: absolute; right: -2.5rem; bottom: -2.5rem; width: 8rem; height: 8rem;
  border-radius: 50%; background: rgba(255, 255, 255, .22); pointer-events: none;
}
.menu a:nth-child(4n + 1) { background: var(--violeta); color: #fff; }
.menu a:nth-child(4n + 2) { background: var(--fucsia); color: #fff; }
.menu a:nth-child(4n + 3) { background: var(--amarillo); }
.menu a:nth-child(4n + 4) { background: var(--cian); }
.menu a strong { display: block; font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin-top: .3rem; }
.menu a span.icono { font-size: 2.6rem; display: grid; place-items: center; width: 4rem; height: 4rem;
  border-radius: 50%; background: rgba(255, 255, 255, .9); margin-bottom: .6rem; }
.menu a em { font-style: normal; display: block; margin-top: .3rem; }
.menu a .etiqueta { background: rgba(255, 255, 255, .92); color: var(--tinta); }
@media (prefers-reduced-motion: reduce) { .menu a { transition: none; } .menu a:hover { transform: none; } }
.etiqueta { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .7rem; border-radius: 999px; background: var(--tinta); color: #fff; }

/* Paleta */
.paleta { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; list-style: none; padding: 0; }
.paleta li { border: 3px solid var(--tinta); border-radius: var(--radio-chico); overflow: hidden; background: var(--superficie); box-shadow: var(--sombra); }
.paleta .muestra { height: 4.5rem; border-bottom: 3px solid var(--tinta); }
.paleta .texto { padding: .4rem .6rem; font-size: .9rem; }
.paleta .texto b { display: block; }
.circulo { position: relative; width: 14rem; height: 14rem; margin: 1rem auto; border-radius: 50%; border: 3px solid var(--tinta);
  /* Círculo de pintor: rojo, morado, azul, verde, amarillo, naranja, en el sentido del reloj. */
  background: conic-gradient(from 90deg, hsl(0 85% 50%), hsl(270 75% 50%) 60deg, hsl(240 85% 50%) 120deg, hsl(180 85% 38%) 150deg, hsl(120 85% 36%) 180deg, hsl(60 95% 50%) 240deg, hsl(30 95% 50%) 300deg, hsl(0 85% 50%)); }
.circulo::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: var(--superficie); border: 3px solid var(--tinta); }
.circulo .punto { position: absolute; width: 2rem; height: 2rem; margin: -1rem; border-radius: 50%; border: 4px solid #fff; outline: 3px solid var(--tinta); z-index: 2;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.circulo .punto.principal { width: 2.8rem; height: 2.8rem; margin: -1.4rem; }

/* Formas */
.formas { list-style: none; padding: 0; display: grid; gap: .5rem; }
.formas button { width: 100%; justify-content: flex-start; text-align: left; font-family: var(--letra-texto); font-weight: 400;
  background: var(--superficie); color: var(--tinta); border-color: var(--tinta); border-radius: var(--radio-chico); }

/* Entrevista */
.turno { margin: .8rem 0; }
.turno .p { font-weight: 700; }
.turno .r { border-left: .4rem solid var(--acento); padding-left: .8rem; }
.casillas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.casilla { border: 3px solid var(--tinta); border-radius: var(--radio-chico); padding: .6rem; text-align: center; font-family: var(--letra-titulo); font-weight: 600; background: var(--superficie); }
.casilla.si { background: var(--tinte-verde); }
.casilla.no { background: var(--tinte-rosa); }
.casilla span { display: block; font-size: 1.6rem; }

/* Galería */
/* La foto es la protagonista; la ilustración va pequeña en la esquina. */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.2rem; }
.galeria article { border: 3px solid var(--tinta); border-radius: var(--radio); overflow: hidden; background: var(--superficie); cursor: pointer;
  box-shadow: var(--sombra); transition: transform .15s ease, box-shadow .15s ease; }
.galeria article:hover { transform: translateY(-3px); box-shadow: var(--sombra-alta); }
@media (prefers-reduced-motion: reduce) { .galeria article { transition: none; } .galeria article:hover { transform: none; } }
.galeria .marco { position: relative; }
.galeria img.foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--tinte-violeta); }
.galeria img.foto.sin-foto { object-fit: contain; background: #fff; }
.galeria img.ilustracion { position: absolute; right: .6rem; bottom: .6rem; width: 30%; aspect-ratio: 1;
  background: #fff; border: 3px solid #fff; border-radius: var(--radio-chico); box-shadow: var(--sombra-alta); }
.galeria img.capa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.galeria .marco .etiqueta { position: absolute; left: .6rem; top: .6rem; }
.galeria article .pie { padding: .6rem .8rem; }
.galeria article .pie h3 { margin: 0; font-size: 1.05rem; }
.galeria .franjas { display: flex; height: 1.4rem; border-top: 3px solid var(--tinta); }
.galeria .franjas div { flex: 1; }

#puerta { position: fixed; inset: 0; background: var(--fondo); display: grid; place-items: center; padding: 1rem; z-index: 10; }
#puerta form { max-width: 26rem; width: 100%; background: var(--superficie); border: 3px solid var(--tinta); border-radius: var(--radio);
  padding: 1.6rem; box-shadow: var(--sombra-alta); }
#puerta h1 { color: var(--violeta-osc); margin-top: 0; }

label.boton { margin-top: 0; }
