/*
 * Página de la app del teléfono (app.html).
 *
 * Reutiliza el fondo, el sello y el pie de la portada (`portal.css`) y añade lo
 * propio de una página con contenido: una columna que se lee de arriba abajo,
 * en vez de la rejilla de dos tarjetas centrada que tiene la portada.
 *
 * Aquí no hay bienvenida, así que tampoco hay `--espera`: lo que entra, entra
 * enseguida. El escalonado se hace con `--i`, igual que en la portada, y en el
 * CSS y no en un `style=` del HTML, porque la CSP del servidor no admite estilos
 * en línea.
 */

.app__shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: clamp(16px, 3vw, 24px);
  width: min(100%, 860px);
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) clamp(16px, 5vw, 32px)
    max(32px, env(safe-area-inset-bottom));
}

/* ---------- Encabezado ---------- */

.app__head {
  text-align: center;
  max-width: 660px;
  animation: app-entra 620ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

.app__head h1 {
  margin: 10px 0 10px;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--tinta-alta);
}

.app__lead {
  margin: 0;
  font-size: clamp(0.94rem, 2.6vw, 1.03rem);
  color: rgba(226, 232, 240, 0.76);
}

@keyframes app-entra {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Tarjetas ---------- */

.tarjeta {
  --i: 0;
  width: 100%;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.12);
  background:
    linear-gradient(140deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.92));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  animation: app-entra 620ms cubic-bezier(0.2, 0.7, 0.3, 1) calc(var(--i) * 90ms) backwards;
}

.tarjeta:nth-of-type(1) { --i: 1; }
.tarjeta:nth-of-type(2) { --i: 2; }
.tarjeta:nth-of-type(3) { --i: 3; }
.tarjeta:nth-of-type(4) { --i: 4; }

.tarjeta p {
  margin: 0 0 10px;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.6;
}

.tarjeta p:last-child {
  margin-bottom: 0;
}

.tarjeta__titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--tinta-alta);
}

.tarjeta__marca {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  color: var(--oro-claro);
  background: rgba(202, 163, 73, 0.14);
  border: 1px solid rgba(202, 163, 73, 0.34);
}

.tarjeta__marca svg {
  width: 17px;
  height: 17px;
}

.tarjeta__nota {
  font-size: 0.86rem;
  color: var(--tinta-suave);
}

.tarjeta code {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.84em;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.1);
  color: var(--tinta-fuerte);
}

/* La tarjeta de la actualización obligatoria: es un aviso, no un párrafo más. */
.tarjeta--aviso {
  border-color: rgba(202, 163, 73, 0.3);
  background:
    linear-gradient(140deg, rgba(60, 48, 20, 0.5), rgba(15, 23, 42, 0.92));
}

/* ---------- La tarjeta de descarga ---------- */

.tarjeta--descarga {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(14px, 3vw, 22px);
  align-items: start;
}

.descarga__icono {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: var(--oro-claro);
  background: rgba(202, 163, 73, 0.14);
  border: 1px solid rgba(202, 163, 73, 0.34);
}

.descarga__icono svg {
  width: 28px;
  height: 28px;
}

.descarga__cuerpo h2 {
  margin: 2px 0 14px;
  font-size: clamp(1.15rem, 3.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tinta-alta);
}

.descarga__datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px 18px;
  margin: 0 0 14px;
}

.descarga__datos dt {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinta-tenue);
}

.descarga__datos dd {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--tinta-alta);
}

.descarga__notas {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.55;
}

.descarga__accion {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 4px;
}

.descarga__peso {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.84rem;
  color: var(--tinta-suave);
  text-align: center;
}

/* Cuando el archivo todavía no está publicado, el botón no debe parecer vivo. */
.boton-oro[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.6);
}

.boton-oro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 340px);
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(202, 163, 73, 0.6);
  background: linear-gradient(180deg, rgba(202, 163, 73, 0.96), rgba(150, 116, 30, 0.96));
  color: #140f04;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(202, 163, 73, 0.2);
  transition: filter 0.16s ease, transform 0.16s ease;
}

.boton-oro svg {
  width: 19px;
  height: 19px;
}

.boton-oro:hover,
.boton-oro:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.boton-oro:active {
  transform: translateY(0) scale(0.99);
}

/* ---------- Pasos de instalación ---------- */

.pasos {
  list-style: none;
  counter-reset: paso;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.pasos li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pasos__num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--oro-claro);
  background: rgba(202, 163, 73, 0.14);
  border: 1px solid rgba(202, 163, 73, 0.34);
}

.pasos h3 {
  margin: 4px 0 4px;
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--tinta-alta);
}

.pasos p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.76);
}

/* ---------- Huella del archivo ---------- */

.huella {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.1);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--tinta-fuerte);
  overflow-wrap: anywhere;
}

/* ---------- Volver ---------- */

.app__volver {
  margin-top: 4px;
}

.app__volver a {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--tinta-suave);
  text-decoration: none;
}

.app__volver a:hover,
.app__volver a:focus-visible {
  color: var(--tinta-alta);
}

@media (prefers-reduced-motion: reduce) {
  .app__head,
  .tarjeta {
    animation: none;
  }

  .boton-oro {
    transition: none;
  }
}
