/* El centro de Pardelina: entrar, tu cuenta y los avisos (paginas/). Ayu Light, como Yume y
   pardelina.com: a la izquierda la marca y la columna de cada página; a la derecha, el mar con la
   pardela (mar.js). Copia de web/login.css de Yume, con las letras aquí mismo (nada de Google
   Fonts) y lo que añade el centro al final. */

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fuentes/fraunces-cursiva.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fuentes/figtree.woff2') format('woff2');
}

:root {
  --fondo: #FCFCFC;
  --blanco: #FFFFFF;
  --linea: rgba(107, 125, 143, 0.14);
  --linea-fuerte: rgba(107, 125, 143, 0.24);
  --tinta: #33383D;
  --texto: #4A5057;
  --suave: #5C6166;
  --tenue: #6B7483;
  --acento: #F29718;
  --acento-borde: rgba(242, 151, 24, 0.45);
  --acento-halo: rgba(242, 151, 24, 0.14);
  --sobre-acento: #3A2300;
  --error: #C43D3D;
  --error-halo: rgba(196, 61, 61, 0.14);
  --sombra-m: 0 6px 22px rgba(107, 125, 143, 0.12);
  --fuente: 'Figtree', system-ui, -apple-system, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --salida: cubic-bezier(0.22, 1, 0.36, 1);
  --muelle: linear(0, 0.0072, 0.0288 2.5%, 0.1134 5.2%, 0.2402 8.2%, 0.6015 16.4%, 0.7521 20.6%, 0.8703 25.3%, 0.9431 30%, 0.9876 34.8%, 1.0089 39.5%, 1.0155 43.6%, 1.0149 48.8%, 1.0038 63.4%, 0.9999 80.6%, 1);
  --rebote: linear(0, 0.0117, 0.0473 3.2%, 0.1869 6.6%, 0.4036 10.4%, 0.8081 18.6%, 0.9616 23.2%, 1.0493 28%, 1.0835 32%, 1.0858 36%, 1.0625 42%, 1.0209 51.6%, 0.9969 60.8%, 0.9951 70.6%, 1.0003 88%, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 15px/1.5 var(--fuente);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(242, 151, 24, 0.22); }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Las dos mitades ---------- */

.entrar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  min-height: 100dvh;
  padding: clamp(16px, 2.2vw, 32px);
  padding-top: max(clamp(16px, 2.2vw, 32px), env(safe-area-inset-top));
}
.entrar-lado {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px clamp(0px, 3vw, 56px) 0;
  transition: opacity 0.4s var(--salida), transform 0.5s var(--salida);
}

.marca { display: flex; align-items: center; gap: 9px; color: var(--tinta); }
.marca-ave { width: 30px; height: 30px; fill: var(--acento); }
.marca-nombre {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 48;
}

/* Un poco por encima del centro, que es donde el ojo lo ve centrado. */
.entrar-centro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0 88px;
  text-align: center;
}
.entrar-centro > * { animation: subir 0.9s var(--salida) backwards; }
.entrar-centro > :nth-child(2) { animation-delay: 0.07s; }
.entrar-centro > :nth-child(3) { animation-delay: 0.14s; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(44px, 4.8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--tinta);
  font-variation-settings: 'opsz' 144;
  text-wrap: balance;
}
.entradilla {
  margin: 18px 0 0;
  max-width: 25em;
  font-size: 17px;
  color: var(--suave);
  text-wrap: pretty;
}

/* ---------- La tarjeta ---------- */

.tarjeta {
  width: min(100%, 400px);
  margin: 40px 0 0;
  padding: 26px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--linea);
  border-radius: 24px;
  background: var(--blanco);
  box-shadow: 0 1px 2px rgba(107, 125, 143, 0.06), var(--sombra-m);
}
.tarjeta.mal { animation: temblar 0.42s var(--salida); }
@keyframes temblar {
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* Con Google y con Apple: blancos, con su logo. */
.otra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--tinta);
  font: 500 15px/1 var(--fuente);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.4s var(--rebote);
}
.otra:hover { background: #F7F8F9; border-color: rgba(107, 125, 143, 0.34); }
.otra:active { transform: scale(0.98); }
.otra svg { width: 17px; height: 17px; flex-shrink: 0; }
.otra-apple { fill: currentColor; transform: translateY(-1px); }

.separa {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  font-size: 13px;
  color: var(--tenue);
}
.separa::before, .separa::after { content: ''; flex: 1; height: 1px; background: var(--linea); }

.tarjeta input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 10px;
  background: var(--blanco);
  font: inherit;
  font-size: 16px;
  color: var(--tinta);
  transition: border-color 0.2s, box-shadow 0.3s var(--salida);
}
.tarjeta input::placeholder { color: var(--tenue); opacity: 0.8; }
.tarjeta input:focus { outline: 0; border-color: var(--acento-borde); box-shadow: 0 0 0 4px var(--acento-halo); }
.tarjeta input[aria-invalid='true'] { border-color: var(--error); }
.tarjeta input[aria-invalid='true']:focus { box-shadow: 0 0 0 4px var(--error-halo); }

.continuar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--acento);
  color: var(--sobre-acento);
  font: 500 15px/1 var(--fuente);
  cursor: pointer;
  transition: transform 0.4s var(--rebote), filter 0.2s;
}
.continuar:hover { filter: brightness(1.04); }
.continuar:active { transform: scale(0.97); }
.continuar svg { transition: transform 0.45s var(--rebote); }
.continuar:hover svg { transform: translateX(3px); }
.continuar[aria-busy='true'] { cursor: progress; }
.continuar[aria-busy='true'] svg { animation: esperar 0.9s ease-in-out infinite; }
@keyframes esperar { 50% { transform: translateX(4px); opacity: 0.4; } }

.nota { margin: 2px 0 0; font-size: 13px; color: var(--tenue); text-wrap: pretty; }
.nota[data-error] { color: var(--error); font-weight: 500; }

/* Al entrar, la columna se va mientras la pardela sale volando (entrar.js). */
body[data-dentro] .entrar-lado { opacity: 0; transform: translateY(-8px); }

/* ---------- El mar ---------- */

.panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 28px;
  background: #E3ECF3;
  box-shadow: inset 0 0 0 1px rgba(51, 56, 61, 0.05);
  animation: aparecer 1.2s var(--salida) backwards;
}
.escena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sol { fill: #F8BD62; }
.isla { fill: #B8C8D6; }
.isla-lejos { fill: #CAD7E2; }
.horizonte { stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.2; }
.olas path { fill: none; stroke-linecap: round; }

/* ---------- Móvil: la columna y, debajo, el mar en una franja ---------- */

@media (max-width: 900px) {
  .entrar { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 16px; }
  .entrar-lado { padding: 4px 4px 0; }
  .entrar-centro { padding: 32px 0 24px; }
  .panel { height: clamp(170px, 30svh, 300px); border-radius: 22px; margin-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 520px) {
  .entradilla { font-size: 16px; }
  .tarjeta { margin-top: 32px; padding: 20px; border-radius: 20px; }
}

@keyframes subir { from { opacity: 0; transform: translateY(14px); } }
@keyframes aparecer { from { opacity: 0; transform: scale(0.985); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Lo del centro ---------- */

[hidden] { display: none !important; }

/* Los dos pasos de entrar: el correo y el código. */
.paso { display: grid; gap: 10px; }
.paso-codigo { animation: subir 0.5s var(--salida) backwards; }
.enviado { margin: 0 0 4px; font-size: 14px; color: var(--suave); overflow-wrap: anywhere; text-wrap: pretty; }
.enviado strong { color: var(--tinta); font-weight: 600; }
.tarjeta #codigo {
  height: 48px;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
}
.tarjeta #codigo::placeholder { letter-spacing: 0.32em; opacity: 0.45; }

.otras { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 13px; color: var(--tenue); }
.enlace {
  padding: 2px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--suave);
  text-decoration: underline;
  text-decoration-color: var(--linea-fuerte);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.enlace:hover { color: var(--tinta); text-decoration-color: currentColor; }
.enlace:disabled { opacity: 0.5; cursor: default; }
a.continuar { text-decoration: none; }

/* Tu cuenta. */
.cuenta { text-align: left; }
.cuenta h2 { margin: 0; font: 600 12px/1.4 var(--fuente); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tenue); }
.estado { margin: 0; color: var(--texto); text-wrap: pretty; }
.plan { margin: 0; font-size: 14px; color: var(--suave); }
.cuenta .continuar { margin-top: 6px; }
.cuenta + .cuenta { margin-top: 16px; }
.entrar-centro > .otras { margin-top: 20px; animation-delay: 0.21s; }

/* Tus passkeys. */
.lista { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 2px; }
.lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linea); }
.lista li:first-child { border-top: 0; }
.lista li div { display: grid; min-width: 0; }
.lista strong { font-weight: 600; color: var(--tinta); overflow-wrap: anywhere; }
.lista span { font-size: 13px; color: var(--tenue); }
.lista .vacia { font-size: 14px; color: var(--tenue); }
.lista .enlace { flex-shrink: 0; font-size: 13px; }
.lista .enlace[data-seguro] { color: var(--error); text-decoration-color: currentColor; }
.otra svg[viewBox='0 0 24 24'] { width: 18px; height: 18px; }
.otra[aria-busy='true'] { cursor: progress; opacity: 0.7; }

/* La oferta de crear una passkey, tras entrar con el código. */
.paso-passkey { justify-items: center; text-align: center; animation: subir 0.5s var(--salida) backwards; }
.paso-passkey .continuar { width: 100%; }
.paso-icono { width: 34px; height: 34px; color: var(--acento); margin-bottom: 2px; }

/* Los avisos (has salido, Lina de otra cuenta). */
.acciones { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 32px 0 0; }
.acciones .continuar { padding: 0 22px; }
.acciones .enlace { font-size: 14px; }

/* El paso a su Lina: casi nunca se ve (se va al cargar). */
body.pasando { min-height: 100dvh; display: grid; place-items: center; }

/* Los planes para elegir (tu cuenta). */
.planes-lista { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.planes-lista li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--linea); border-radius: 14px; }
.planes-lista div { display: grid; gap: 1px; min-width: 0; }
.planes-lista strong { font-weight: 600; color: var(--tinta); }
.planes-lista .precio { font-size: 15px; color: var(--tinta); font-variant-numeric: tabular-nums; }
.planes-lista span:not(.precio) { font-size: 13px; color: var(--tenue); }
.planes-lista .continuar { flex-shrink: 0; padding: 0 16px; }
.planes-lista .continuar[aria-busy='true'] { cursor: progress; opacity: 0.75; }
.cuenta .nota[data-error] { color: var(--error); }
@media (max-width: 420px) {
  .planes-lista li { flex-direction: column; align-items: stretch; }
}

/* ---------- Elegir plan: el mar a la izquierda y los planes a la derecha ---------- */

/* Sin Lina y con planes, la cuenta es solo elegir uno (paginas/planes.html). Recién entrado se llega
   sin recargar (entrar.js): la columna se va, el mar se estira como una goma de la derecha a la
   izquierda y se recoge allí, y los planes salen por la derecha mientras se recoge (--tras: lo que
   tarda en dejarles sitio). Durante el vuelo el mar va fijo y .hueco-mar guarda su celda.
   Cargada de primeras, lo mismo sin el vuelo. */
.entrar[data-vista='elegir'] .panel,
.entrar[data-vista='elegir'] .hueco-mar { grid-column: 1; grid-row: 1; }
.entrar[data-vista='elegir'] .entrar-lado { grid-column: 2; grid-row: 1; }
.entrar-lado.saliendo {
  opacity: 0;
  transform: translateX(-28px);
  filter: blur(4px);
  transition: opacity 0.3s ease, transform 0.45s var(--salida), filter 0.3s ease;
}

[data-vista='elegir'] .marca,
[data-vista='elegir'] .entrar-centro > * { animation: llegar 0.95s var(--salida) backwards; animation-delay: var(--tras, 0s); }
[data-vista='elegir'] .entrar-centro > :nth-child(2) { animation-delay: calc(var(--tras, 0s) + 0.06s); }
[data-vista='elegir'] .entrar-centro > :nth-child(3) { animation-delay: calc(var(--tras, 0s) + 0.12s); }
[data-vista='elegir'] .entrar-centro > :nth-child(4) { animation-delay: calc(var(--tras, 0s) + 0.2s); }
[data-vista='elegir'] .entrar-centro > :nth-child(5) { animation-delay: calc(var(--tras, 0s) + 0.24s); }
@keyframes llegar { from { opacity: 0; transform: translateX(40px); filter: blur(6px); } }
.tras-el-mar { --tras: 0.62s; }
h1[tabindex='-1']:focus { outline: 0; }

.eleccion { width: min(100%, 420px); text-align: left; gap: 12px; }
.opciones { position: relative; display: grid; gap: 8px; min-inline-size: 0; margin: 0 0 4px; padding: 0; border: 0; }

/* Cada plan, una opción; la elegida la marca el resalte, uno solo que se desliza de una a otra. */
.opcion {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.25s;
  animation: asomar 0.7s var(--salida) backwards;
  animation-delay: calc(var(--tras, 0s) + 0.2s);
}
.opcion + .opcion { animation-delay: calc(var(--tras, 0s) + 0.27s); }
/* Con translate y scale sueltos: transform es de colocar el resalte (elegir.js). */
@keyframes asomar { from { opacity: 0; translate: 0 12px; } }
@keyframes encender { from { opacity: 0; scale: 0.97; } }
.opcion:hover { border-color: rgba(107, 125, 143, 0.4); }
.opcion[data-elegida] { border-color: transparent; }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 3px; }

.resalte {
  position: absolute;
  inset: 0 0 auto;
  border: 1.5px solid var(--acento);
  border-radius: 14px;
  background: rgba(242, 151, 24, 0.05);
  box-shadow: 0 0 0 4px var(--acento-halo);
  pointer-events: none;
  transition: transform 0.55s var(--salida), height 0.55s var(--salida);
  animation: encender 0.6s var(--salida) backwards;
  animation-delay: calc(var(--tras, 0s) + 0.5s);
}
.resalte.quieto { transition: none; }

.punto {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--linea-fuerte);
  border-radius: 50%;
  transition: background 0.25s, border-color 0.25s;
}
.punto::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--blanco); transform: scale(0); transition: transform 0.4s var(--rebote); }
.opcion[data-elegida] .punto { background: var(--acento); border-color: var(--acento); }
.opcion[data-elegida] .punto::after { transform: scale(1); }

.opcion-texto { display: grid; gap: 2px; min-width: 0; }
.opcion-nombre { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 16px; font-weight: 600; color: var(--tinta); }
.insignia { padding: 1px 8px; border-radius: 999px; background: var(--acento-halo); color: #8A4D00; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.opcion-lema { font-size: 13px; color: var(--tenue); text-wrap: pretty; }
.opcion-precio { display: grid; justify-items: end; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opcion-precio .antes { font-size: 12.5px; color: var(--tenue); text-decoration-color: rgba(107, 116, 131, 0.7); }
.opcion-precio strong { font-size: 17px; font-weight: 600; color: var(--tinta); }
.opcion-precio .mes { font-size: 13px; color: var(--tenue); }

.eleccion .continuar { width: 100%; }
.eleccion .nota { min-height: 1.5em; text-align: center; }
.letra { max-width: 30em; margin: 18px 0 0; font-size: 12.5px; color: var(--tenue); text-wrap: pretty; }
[data-vista='elegir'] .entrar-centro > .otras { flex-wrap: wrap; margin-top: 6px; }
.otras .quien { color: var(--suave); overflow-wrap: anywhere; }

/* En el móvil, el mar arriba y los planes debajo: se estira de abajo arriba y se recoge arriba, y
   los planes salen de debajo de él mientras se recoge, subiendo también. */
@media (max-width: 900px) {
  .tras-el-mar { --tras: 0.66s; }
  .entrar[data-vista='elegir'] { grid-template-rows: auto 1fr; }
  .entrar[data-vista='elegir'] .entrar-lado { grid-column: 1; grid-row: 2; }
  .entrar-lado.saliendo { transform: translateY(-14px); }
  [data-vista='elegir'] .marca,
  [data-vista='elegir'] .entrar-centro > * { animation-name: subir; }
  [data-vista='elegir'] .entrar-centro { padding-top: 24px; }
}
@media (max-width: 420px) {
  .opcion { gap: 10px; padding: 14px; }
}
