/* Cuídame — esmalte de noche.
   Fondo ciruela, texto nácar, un solo acento rosa esmalte. El estado del círculo
   se lee en 5 uñas: esa es la única pieza decorativa de toda la app. */

@font-face { font-family: "Fraunces"; src: url("vendor/fuentes/fraunces-latin-full-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("vendor/fuentes/fraunces-latin-full-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("vendor/fuentes/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("vendor/fuentes/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ciruela: #1d0e1c;
  --vino: #2c162c;
  --vino-2: #40223f;
  --linea: #55335280;
  --nacar: #fbeee8;
  --nacar-2: #d3bccb;
  --esmalte: #ff5f96;
  --esmalte-osc: #c22d63;
  --menta: #7fe3bd;
  --ambar: #ffc24b;
  --rojo: #ff5548;
  --gris: #8a7489;
  --titulo: "Fraunces", "Iowan Old Style", Georgia, serif;
  --texto: "Atkinson", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --barra-alto: 104px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--ciruela); color: var(--nacar);
  font: 400 17px/1.45 var(--texto);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: var(--esmalte); }
:focus-visible { outline: 3px solid var(--nacar); outline-offset: 3px; border-radius: 6px; }

/* ---------- cabecera ---------- */
.cab {
  display: flex; align-items: center; gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 20px 6px;
  max-width: 480px; margin: 0 auto;
}
.marca {
  font: italic 600 26px/1 var(--titulo); font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--nacar); text-decoration: none; letter-spacing: -0.01em;
}
.punto {
  width: 22px; height: 22px; padding: 0; border: 0; background: transparent; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.punto::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--esmalte); }
.btn-icono {
  margin-left: auto; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: transparent; fill: var(--nacar-2); cursor: pointer; display: grid; place-items: center;
}
.btn-icono:active { background: var(--vino); }

.aviso-red { background: var(--ambar); color: #2a1a00; text-align: center; padding: 6px 12px; font-weight: 700; font-size: 15px; }

main { max-width: 480px; margin: 0 auto; padding: 8px 20px 40px; outline: none; }
body.con-barra main { padding-bottom: calc(var(--barra-alto) + 48px + env(safe-area-inset-bottom)); }

/* ---------- tipografía ---------- */
.frase {
  font: 700 clamp(36px, 11.5vw, 50px)/1.02 var(--titulo);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.02em; text-wrap: balance;
}
.frase.media { font-size: clamp(30px, 9vw, 40px); }
.sub { color: var(--nacar-2); margin-top: 10px; max-width: 34ch; }
.titulo-2 { font: 600 22px/1.2 var(--titulo); font-variation-settings: "SOFT" 100; margin-bottom: 10px; }
.nota { color: var(--nacar-2); font-size: 15px; }
.seccion { margin-top: 34px; }

/* ---------- la mano: 5 uñas ---------- */
.mano { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 26px 0 30px; min-height: 104px; }
.una {
  --c: var(--gris);
  position: relative; flex: 0 0 auto; width: 52px; height: 78px;
  border-radius: 50% 50% 16px 16px / 44% 44% 16px 16px;
  background: var(--c); color: #24101f;
  display: grid; place-items: center; padding-top: 12px;
  font: 700 24px/1 var(--titulo);
  box-shadow: inset 0 -10px 16px -8px #0006;
}
.una::before { /* brillo del esmalte */
  content: ""; position: absolute; left: 11px; top: 12px; width: 9px; height: 30px;
  border-radius: 9px; background: #fff; opacity: .38; transform: rotate(8deg);
}
.una.verde { --c: var(--menta); }
.una.amarillo { --c: var(--ambar); }
.una.rojo { --c: var(--rojo); color: #fff; }
.una.gris { --c: #5c4a5b; color: var(--nacar-2); }
.una.vacia { background: transparent; border: 2px dashed var(--linea); box-shadow: none; }
.una.vacia::before { display: none; }
.una.yo { outline: 2px solid var(--nacar); outline-offset: 4px; }
.mano .una:nth-child(1) { transform: translateY(14px) rotate(-7deg); }
.mano .una:nth-child(2) { transform: translateY(4px) rotate(-3deg); }
.mano .una:nth-child(4) { transform: translateY(4px) rotate(3deg); }
.mano .una:nth-child(5) { transform: translateY(14px) rotate(7deg); }
.una.rojo { animation: late 1.6s ease-in-out infinite; }
@keyframes late { 50% { filter: brightness(1.25); } }

.una.mini { width: 22px; height: 32px; padding: 0; border-radius: 50% 50% 7px 7px / 44% 44% 7px 7px; box-shadow: none; animation: none; }
.una.mini::before { left: 5px; top: 5px; width: 4px; height: 12px; }

/* ---------- lista de amigas ---------- */
.lista { list-style: none; margin: 22px 0 0; padding: 0; }
.fila { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--linea); }
.fila:last-child { border-bottom: 1px solid var(--linea); }
.fila .quien { font-weight: 700; font-size: 19px; line-height: 1.2; }
.fila .quien small { font-weight: 400; font-size: 15px; color: var(--nacar-2); }
.fila .cuando { color: var(--nacar-2); font-size: 15px; }
.fila .lado { text-align: right; font-size: 15px; }
.palabra { font-weight: 700; }
.palabra.verde { color: var(--menta); } .palabra.amarillo { color: var(--ambar); }
.palabra.rojo { color: var(--rojo); } .palabra.gris { color: var(--gris); }
.riesgo { display: block; color: var(--nacar-2); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 24px; border-radius: 28px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 18px; text-decoration: none; text-align: center; line-height: 1.15;
  background: var(--esmalte); color: #2a0716;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ancho { display: flex; width: 100%; }
.btn.suave { background: var(--vino-2); color: var(--nacar); }
.btn.linea { background: transparent; color: var(--nacar); box-shadow: inset 0 0 0 2px var(--linea); }
.btn.claro { background: var(--nacar); color: #2a0716; }
.btn.peligro { background: var(--rojo); color: #fff; }
.btn.chico { min-height: 46px; padding: 0 18px; font-size: 16px; border-radius: 23px; }
.enlace { background: none; border: 0; padding: 12px 0; color: var(--nacar-2); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 16px; }
.pila { display: grid; gap: 12px; margin-top: 22px; }
.fila-btn { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- formularios ---------- */
.campo { display: grid; gap: 6px; margin-top: 18px; }
.campo label, .etiqueta { font-weight: 700; font-size: 16px; }
.campo input[type=text], .campo input[type=password], .campo input[type=tel], .campo textarea {
  width: 100%; min-height: 56px; padding: 0 16px; border-radius: 14px;
  background: var(--vino); border: 2px solid var(--linea); color: var(--nacar); font-size: 19px;
}
.campo input:focus { border-color: var(--esmalte); outline: none; }
.campo .ayuda { color: var(--nacar-2); font-size: 15px; }
input.pin { letter-spacing: .5em; font-size: 26px; text-align: center; font-variant-numeric: tabular-nums; }
input.codigo { letter-spacing: .25em; text-transform: uppercase; text-align: center; font-size: 22px; }
.casilla { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; margin-top: 20px; color: var(--nacar-2); font-size: 15px; }
.casilla input { width: 26px; height: 26px; margin: 0; accent-color: var(--esmalte); }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcion span { display: grid; place-items: center; min-width: 64px; min-height: 50px; padding: 0 16px; border-radius: 25px; background: var(--vino); box-shadow: inset 0 0 0 2px var(--linea); font-weight: 700; }
.opcion input:checked + span { background: var(--nacar); color: #2a0716; box-shadow: none; }
.opcion input:focus-visible + span { outline: 3px solid var(--nacar); outline-offset: 3px; }
.error { color: var(--ambar); font-weight: 700; margin-top: 12px; min-height: 1.4em; }

/* ---------- pantallas de resultado de un toque ---------- */
.resultado { min-height: 62dvh; display: grid; align-content: center; justify-items: start; gap: 6px; }
.sello { margin-bottom: 18px; }
.sello .una { width: 84px; height: 124px; font-size: 44px; padding-top: 20px; border-radius: 50% 50% 24px 24px / 44% 44% 24px 24px; animation: posar .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.sello .una::before { left: 18px; top: 20px; width: 13px; height: 46px; }
@keyframes posar { from { transform: translateY(18px) scale(.86); opacity: 0; } }
.cargando { min-height: 50dvh; display: grid; place-items: center; color: var(--nacar-2); }

/* ---------- alertas ---------- */
.alerta { background: var(--rojo); color: #fff; border-radius: 22px; padding: 20px; margin: 4px 0 18px; }
.alerta.propia { background: var(--vino-2); box-shadow: inset 0 0 0 2px var(--rojo); }
.alerta h2 { font: 700 26px/1.08 var(--titulo); font-variation-settings: "SOFT" 100, "WONK" 1; text-wrap: balance; }
.alerta p { margin-top: 8px; font-size: 16px; }
.alerta a { color: inherit; font-weight: 700; }
.alerta .btn { background: #fff; color: #5b0d07; }
.alerta .btn.suave { background: #0003; color: #fff; }
.alerta.propia .btn { background: var(--nacar); color: #2a0716; }

/* ---------- mapa ---------- */
.mapa { height: 200px; border-radius: 18px; overflow: hidden; background: var(--vino); margin-top: 12px; }
.mapa .leaflet-container { background: var(--vino); font: inherit; }
.pin-mapa { width: 30px !important; height: 30px !important; margin: -15px 0 0 -15px !important; border-radius: 50%; display: grid; place-items: center; font: 700 15px/1 var(--texto); color: #24101f; background: var(--menta); border: 2px solid #1d0e1c; }
.pin-mapa.amarillo { background: var(--ambar); } .pin-mapa.rojo { background: var(--rojo); color: #fff; } .pin-mapa.gris { background: #a892a6; }

/* ---------- red de zona ---------- */
.red-num { font: 700 30px/1.1 var(--titulo); font-variation-settings: "SOFT" 100; }
.apoyo { border-top: 1px solid var(--linea); padding: 14px 0; }

/* ---------- código de la salida ---------- */
.codigo-salida { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--vino); border-radius: 18px; padding: 14px 16px; }
.codigo-salida b { font-size: 24px; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.gran-codigo { font: 700 52px/1 var(--texto); letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: 18px 0 6px; }

/* ---------- barra de acción ---------- */
#barra:empty { display: none; }
#barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: linear-gradient(to top, var(--ciruela) 72%, #1d0e1c00);
  padding: 22px 16px calc(14px + env(safe-area-inset-bottom));
}
.barra-in { max-width: 448px; margin: 0 auto; display: grid; grid-template-columns: 1fr 76px; gap: 12px; align-items: center; }
.barra-in .btn { min-height: 68px; border-radius: 34px; font-size: 21px; }
.barra-extra { max-width: 448px; margin: 0 auto 10px; display: flex; gap: 10px; }
.barra-extra .btn { flex: 1; }

.sos {
  --p: 0; position: relative; width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  background: conic-gradient(var(--rojo) calc(var(--p) * 1turn), var(--vino-2) 0);
  color: var(--nacar); font-weight: 700; font-size: 17px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.sos::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--vino); box-shadow: inset 0 0 0 2px var(--rojo); }
.sos span { position: relative; }
.sos.pulsando::before { background: #4d1714; }

/* ---------- hojas (modales desde abajo) ---------- */
.velo { position: fixed; inset: 0; z-index: 900; background: #0b040bcc; display: grid; align-items: end; }
.hoja {
  width: 100%; max-width: 480px; margin: 0 auto; max-height: 92dvh; overflow: auto;
  background: var(--vino); border-radius: 26px 26px 0 0;
  padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
  animation: subir .22s ease-out both;
}
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }
.hoja h2 { font: 700 28px/1.1 var(--titulo); font-variation-settings: "SOFT" 100, "WONK" 1; }
.hoja .campo input { background: var(--ciruela); }
.hoja .opcion span { background: var(--ciruela); }

/* ---------- tostadas ---------- */
#tostadas { position: fixed; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); z-index: 1000; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.tostada { pointer-events: auto; max-width: 440px; width: 100%; background: var(--nacar); color: #2a0716; border-radius: 18px; padding: 14px 18px; box-shadow: 0 10px 30px #000a; animation: subir .2s ease-out both; }
.tostada b { display: block; font-size: 17px; }
.tostada span { font-size: 15px; }

.pie { margin-top: 44px; color: var(--nacar-2); font-size: 14px; }
.pie a { color: var(--nacar-2); }
.separa { height: 1px; background: var(--linea); border: 0; margin: 28px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
