/* =========================================================
   Lameno · Prototipo de entrada (splash, bienvenida, acceso, alta)
   Tokens idénticos a la guía aprobada (/app/estilos.css).
   Este fichero: tokens, base, contenedor de app y componentes comunes.
   ========================================================= */
:root {
  /* Marca (guía) */
  --bosque: #1B3619;
  --ciruela: #3A1430;
  --fucsia: #FF4FD8;
  --lima: #D7F36B;
  --rosa: #F9CBE3;
  --crema: #F7F1EA;
  /* Funcionales (guía) */
  --tinta: #141A14;
  --frambuesa: #A80C85;
  --arena: #ECE3D8;
  --rosa-hondo: #F3B3D4;
  /* Funcionales de interfaz, contraste calculado con WCAG 2.1:
     --suave sobre crema 6,3 · sobre arena 5,6 · sobre rosa 4,9
     --borde sobre crema 3,4 (no es texto; mínimo 3 para controles) */
  --suave: #5C5850;
  --borde: #8A8178;
  --campo: #FFFDFA;

  --f-serif: "Instrument Serif", "Times New Roman", serif;
  --f-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-logo: "Gloock", "Instrument Serif", serif;

  /* Escala móvil: la serif nunca baja de 24; cuerpo 18; interfaz 17 */
  --t-xl: 52px;
  --t-titulo: 44px;
  --t-sub: 28px;
  --t-cuerpo: 18px;
  --t-ui: 17px;
  --t-etiqueta: 13px;

  --r-boton: 999px;
  --r-bloque: 24px;
  --r-campo: 18px;
  --squircle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M28 0H72C92 0 100 8 100 28V72C100 92 92 100 72 100H28C8 100 0 92 0 72V28C0 8 8 0 28 0Z'/%3E%3C/svg%3E");

  /* Áreas seguras del marco simulado (barra de estado 50, indicador 34) */
  --arriba: 50px;
  --abajo: 30px;
  --lado: 24px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-suave: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bosque); color: var(--tinta);
  font: 400 var(--t-cuerpo)/1.5 var(--f-sans);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: italic; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
::selection { background: var(--rosa); color: var(--tinta); }
:focus-visible { outline: 3px solid var(--fucsia); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* ---------- Logotipo A «Peso» (guía) ---------- */
.logo { display: inline-block; white-space: nowrap; line-height: 1; }
.logo--a .logo__la { display: inline-block; font: italic 400 1.06em/1 var(--f-serif); letter-spacing: -.01em; margin-right: .02em; }
.logo--a .logo__meno { display: inline-block; font: 400 1em/1 var(--f-logo); letter-spacing: -.025em; }
.etiqueta { display: block; font: 500 var(--t-etiqueta)/1.25 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Orbe: el único degradado de la marca ---------- */
.orbe {
  --c1: var(--fucsia); --c2: rgb(249 203 227 / .85); --b: 18px;
  display: block; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--c1) 0 16%, var(--c2) 42%, rgb(249 203 227 / 0) 70%);
  filter: blur(var(--b));
}
.orbe--lima { --c1: var(--lima); --c2: rgb(215 243 107 / .55); }

/* ---------- Contenedor de la app ---------- */
.app {
  position: relative; width: 390px; height: 844px; overflow: hidden;
  background: var(--crema); color: var(--tinta); isolation: isolate;
}
.app__pantallas { position: absolute; inset: 0; }
.pantalla { position: absolute; inset: 0; }
.app__capas { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.app__capas > * { pointer-events: auto; }

.barra-estado {
  position: absolute; z-index: 40; inset: 0 0 auto; height: var(--arriba);
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 30px 0 36px; pointer-events: none;
  font: 600 16px/1 var(--f-sans); font-variant-numeric: tabular-nums;
  color: var(--tinta); transition: color .4s;
}
.barra-estado__iconos { display: flex; gap: 6px; align-items: center; }
.barra-estado svg { fill: currentColor; }
.indicador {
  position: absolute; z-index: 40; left: 50%; bottom: 8px; width: 134px; height: 5px;
  border-radius: 3px; background: var(--tinta); transform: translateX(-50%); pointer-events: none; transition: background-color .4s;
}
.app[data-tono="oscuro"] .barra-estado { color: var(--crema); }
.app[data-tono="oscuro"] .indicador, .app[data-tono="mixto"] .indicador { background: var(--crema); }

/* ---------- Esqueleto de pantalla ---------- */
.p {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding-top: var(--arriba); background: var(--crema); color: var(--tinta);
}
.p--bosque { background: var(--bosque); color: var(--crema); }
.p--ciruela { background: var(--ciruela); color: var(--rosa); }
.p__barra { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px var(--lado) 0 14px; flex: none; }
.p__cuerpo {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px var(--lado) 24px; scrollbar-width: none;
}
.p__cuerpo::-webkit-scrollbar { display: none; }
.p__pie { flex: none; display: grid; gap: 4px; padding: 12px var(--lado) calc(var(--abajo) + 10px); }
.p__ayuda { font-size: var(--t-ui); color: var(--suave); text-align: center; min-height: 26px; }
.p__ayuda--alerta { color: var(--frambuesa); font-weight: 600; }

.atras {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--arena); color: var(--tinta);
  transition: transform .3s var(--ease), background-color .2s;
}
.atras:active { transform: scale(.94); }
.p--bosque .atras, .p--ciruela .atras { background: rgb(247 241 234 / .14); color: var(--crema); }
.paso { font: 500 var(--t-etiqueta)/1.2 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--suave); font-variant-numeric: tabular-nums; }
.p--ciruela .paso, .p--bosque .paso { color: var(--rosa); }

/* Barra de progreso del perfil: fina, con contador (patrón Orchi, aspecto Lameno) */
.progreso { flex: 1; height: 6px; border-radius: 3px; background: var(--arena); overflow: hidden; }
.progreso span { display: block; height: 100%; border-radius: 3px; background: var(--bosque); width: var(--v); transition: width .7s var(--ease); }
.entra .progreso span { animation: progreso .8s var(--ease) both; }
@keyframes progreso { from { width: var(--antes, 0%); } }
.contador { font: 600 15px/1 var(--f-sans); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.p--ciruela .progreso { background: rgb(249 203 227 / .2); }
.p--ciruela .progreso span { background: var(--lima); }
.saltar {
  min-height: 48px; padding: 0 4px 0 16px; border: 0; background: none;
  font: 600 var(--t-ui)/1 var(--f-sans); color: var(--suave); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em;
}
.p--ciruela .saltar, .p--bosque .saltar { color: var(--rosa); }

/* ---------- Tipografía de pantalla ---------- */
.titulo { font: 400 var(--t-titulo)/.98 var(--f-serif); letter-spacing: -.015em; text-wrap: balance; margin: 4px 0 14px; color: var(--bosque); }
.titulo--xl { font-size: var(--t-xl); line-height: .94; }
.p--bosque .titulo { color: var(--crema); }
.p--bosque .titulo em { color: var(--fucsia); }
.p--ciruela .titulo { color: var(--crema); }
.p--ciruela .titulo em { color: var(--lima); }
.texto { font-size: var(--t-cuerpo); line-height: 1.5; text-wrap: pretty; }
.texto--suave { color: var(--suave); }
.texto b { font-weight: 600; color: var(--tinta); overflow-wrap: anywhere; }

/* ---------- Botones (guía: pastilla completa; 60 de alto por ser la acción de la pantalla) ---------- */
.boton {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 30px; width: 100%;
  border: 0; border-radius: var(--r-boton); font: 600 var(--t-ui)/1 var(--f-sans); text-decoration: none;
  transition: transform .3s var(--ease), background-color .25s, color .25s;
}
.boton:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(.98); }
.boton--fucsia { background: var(--fucsia); color: var(--tinta); }
.boton--lima { background: var(--lima); color: var(--tinta); }
.boton--rosa { background: var(--rosa); color: var(--bosque); }
.boton--bosque { background: var(--bosque); color: var(--crema); }
.boton--tinta { background: var(--tinta); color: var(--crema); }
.boton--texto { background: transparent; color: var(--bosque); min-height: 52px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.p--bosque .boton--texto, .p--ciruela .boton--texto { color: var(--rosa); }
.boton:disabled, .boton[aria-disabled="true"] { background: var(--arena); color: var(--suave); }
.boton:disabled { cursor: not-allowed; }
.boton .ic { width: 22px; height: 22px; }
.boton__flecha { width: 40px; height: 12px; fill: none; transition: transform .35s var(--ease); }
.boton:hover .boton__flecha { transform: translateX(4px); }

.enlace {
  position: relative; display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--frambuesa); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.enlace::after { content: ""; position: absolute; inset: -14px -6px; }

/* ---------- Campo de texto ---------- */
.campo { display: grid; gap: 10px; margin-top: 26px; }
.campo__etiqueta { font: 600 var(--t-ui)/1.2 var(--f-sans); }
.campo__caja {
  width: 100%; height: 64px; padding: 0 20px;
  border: 2px solid var(--borde); border-radius: var(--r-campo); background: var(--campo);
  font: 500 20px/1 var(--f-sans); color: var(--tinta);
  transition: border-color .2s, box-shadow .25s var(--ease);
}
.campo__caja::placeholder { color: var(--suave); opacity: 1; font-weight: 400; }
.campo__caja:focus, .campo--foco .campo__caja { outline: 0; border-color: var(--tinta); box-shadow: 0 0 0 5px var(--rosa); }
.campo--error .campo__caja, .campo--error .campo__caja:focus { border-color: var(--frambuesa); box-shadow: 0 0 0 5px rgb(168 12 133 / .14); }
.campo__error { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; color: var(--frambuesa); font-size: var(--t-ui); line-height: 1.45; font-weight: 500; }
.campo__error .ic { margin-top: 1px; }
.sugerencia { display: none; align-items: center; gap: 12px; flex-wrap: wrap; }
.campo:focus-within .sugerencia, .campo--foco .sugerencia { display: flex; }
.campo--error .sugerencia, .campo--rellenado .sugerencia { display: none !important; }
.sugerencia .etiqueta { color: var(--suave); }
.sugerencia__boton { min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--r-boton); background: var(--arena); font: 500 var(--t-ui)/1 var(--f-sans); }

/* ---------- Baldosa de icono (squircle de la guía) ---------- */
.baldosa {
  position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--arena); color: var(--tinta);
  -webkit-mask: var(--squircle) center / 100% 100%; mask: var(--squircle) center / 100% 100%;
}
.baldosa .ic { position: relative; width: 28px; height: 28px; }
.baldosa .orbe { position: absolute; inset: -12%; --b: 10px; opacity: 0; transition: opacity .5s var(--ease); }
.baldosa--xl { width: 88px; height: 88px; }
.baldosa--xl .ic { width: 40px; height: 40px; }
.baldosa--lima { background: var(--lima); }
.baldosa--fucsia { background: var(--fucsia); }
.baldosa--rosa { background: var(--rosa); }
.baldosa--crema { background: var(--crema); }

.app-icono {
  width: 44px; height: 44px; flex: none; display: grid; grid-auto-flow: column; place-content: center;
  background: var(--fucsia); color: var(--bosque); font-size: 28px; line-height: 1; padding-bottom: 3px;
  -webkit-mask: var(--squircle) center / 100% 100%; mask: var(--squircle) center / 100% 100%;
}
.app-icono__l { font: italic 400 1.04em/1 var(--f-serif); }
.app-icono__a { font: 400 1em/1 var(--f-logo); margin-left: -.02em; }

/* ---------- Capas: hoja inferior, aviso de correo, diálogo del sistema, tostada ---------- */
.velo { position: absolute; inset: 0; background: rgb(20 26 20 / .55); display: flex; align-items: flex-end; }
.hoja {
  width: 100%; background: var(--crema); color: var(--tinta);
  border-radius: 32px 32px 0 0; padding: 14px var(--lado) calc(var(--abajo) + 14px);
  display: grid; gap: 14px; justify-items: start;
}
.hoja__asa { justify-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--borde); margin-bottom: 8px; }
.hoja .titulo { margin: 0; font-size: 36px; }
.hoja .acciones { width: 100%; display: grid; gap: 4px; margin-top: 6px; }

.aviso {
  position: absolute; left: 10px; right: 10px; top: calc(var(--arriba) + 6px);
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left;
  padding: 14px 16px; border: 0; border-radius: 24px; background: var(--tinta); color: var(--crema);
}
.aviso__meta { display: flex; justify-content: space-between; font: 500 var(--t-etiqueta)/1.2 var(--f-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rosa); }
.aviso__texto { display: block; font-size: 16px; line-height: 1.35; margin-top: 4px; }
.aviso__texto b { font-weight: 700; letter-spacing: .06em; color: var(--lima); }

/* Diálogo del sistema: neutro a propósito, lo pinta iOS/Android, no la marca */
.sistema { position: absolute; inset: 0; background: rgb(20 26 20 / .45); display: grid; place-items: center; }
.sistema__caja { width: 290px; border-radius: 20px; background: #F2F2F0; color: #1A1A1A; text-align: center; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
.sistema__texto { padding: 22px 20px 18px; font-size: 16px; line-height: 1.35; }
.sistema__texto b { display: block; font-size: 17px; margin-bottom: 6px; }
.sistema__boton { display: block; width: 100%; min-height: 50px; border: 0; border-top: 1px solid #D4D4D0; background: transparent; font-size: 17px; color: #1F4FB8; }
.sistema__boton--fuerte { font-weight: 600; }

.tostada {
  position: absolute; z-index: 30; left: 50%; bottom: calc(var(--abajo) + 104px); transform: translateX(-50%);
  width: max-content; max-width: 330px; padding: 14px 20px; border-radius: 16px; background: var(--tinta); color: var(--crema);
  font-size: 16px; line-height: 1.35; text-align: center;
}
