/* ==========================================================================
   translate-book.com — Design tokens & Home
   Fuente de verdad: Figma "translate-book.com"
   Nodos: Home 2032:392 · Cargando 2032:447 · Reanudar 2032:420
          Tipo de archivo 2032:594 · Botón hover 2018:703
          Colores 2021:1464 · Tipografía 2021:1787
   Sin dependencias. Los tokens viven en :root para reutilizarlos en toda la web.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fuentes (autoalojadas, subset latin, woff2)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/noto-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/noto-serif-500-latin.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Paleta — Figma / Colors */
  --color-ink: #191714;              /* text-1 */
  --color-ink-soft: #4f4b41;         /* text-2 */
  --color-ink-muted: #878277;        /* text-3 · Figma. Para AA en texto
                                        pequeño, usa #716c61 (4.6:1). */
  --color-line: #cfcdc8;             /* text-4 */
  --color-surface-sunken: #ebebe9;   /* text-5 */
  --color-surface: #f3f1f0;          /* text-6 */
  --color-surface-raised: #f7f7f6;   /* text-7 */
  --color-button-ink: #453b24;       /* text-button */
  --color-accent-soft: #f1e0ba;      /* yellow */
  --color-accent-line: #f4cc71;      /* borde del botón */
  --color-danger: #c03e3e;           /* red */
  --color-white: #ffffff;
  --color-bg-fallback: #c3a054;
  color-scheme: light;

  /* Gradiente del botón — Figma / yellow-linear */
  --gradient-brand: linear-gradient(180deg, #f5d282 0%, #f4ce76 100%);
  /* Estado hover — nodo 2018:703 */
  --gradient-brand-hover: linear-gradient(180deg, #f7da97 0%, #f5d384 100%);

  /* Alias semánticos (usar estos en componentes nuevos) */
  --color-bg: var(--color-surface);
  --color-text: var(--color-ink);
  --color-text-secondary: var(--color-ink-soft);
  --color-text-muted: var(--color-ink-muted);
  --color-border: var(--color-line);
  --color-error: var(--color-danger);

  /* Tipografía — Figma / Tipografía. Fluida entre mobile y desktop. */
  --font-display: "Noto Serif", Georgia, "Times New Roman", serif;
  --font-body: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, sans-serif;

  --fs-h1: clamp(36px, calc(27.18px + 0.975vw), 44px);
  --fs-h2: clamp(16px, calc(13.86px + 0.24vw), 18px);
  --fs-body: clamp(16px, calc(13.94px + 0.235vw), 18px);
  --fs-body-2: clamp(15px, calc(13.83px + 0.126vw), 16px);
  --fs-body-3: clamp(13px, calc(12.1px + 0.11vw), 14px);
  --fs-button: clamp(14px, calc(11.61px + 0.254vw), 16px);

  --lh-heading: 1.05;
  --lh-body: 1.4;
  --lh-button: 1.4;

  /* Forma y espaciado */
  --radius: 12px;
  --radius-pill: 40px;
  --content-max: 600px;
  --frame-pad: 12px;
  --card-pad-x: 16px;
  --card-pad-y: 20px;
  --gap-book-copy: 20px;
  --gap-copy-uploader: 24px;
  --footer-gap: clamp(36px, calc(9.6vh - 1px), 72px);

  --focus-ring: 2px solid var(--color-ink-soft);
  --focus-offset: 3px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-bg-fallback);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-ink);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

[hidden] {
  display: none !important;
}

/* The server injects localized copy after load. Hide the Spanish source until
   js/i18n.js has translated it; reveal anyway after 1.2s if JS fails. */
html.i18n-pending body {
  opacity: 0;
  animation: tb-reveal 0s 1.2s forwards;
}

@keyframes tb-reveal {
  to {
    opacity: 1;
  }
}

/* Router: only the content area morphs between pages. */
.hero,
.flow-wrap,
.legal-wrap {
  view-transition-name: tb-content;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-group(tb-content) {
  animation-duration: 220ms;
  animation-timing-function: var(--ease);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Escala tipográfica reutilizable
   -------------------------------------------------------------------------- */
.type-h1,
.type-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: 0;
  color: var(--color-text);
}
.type-h1 { font-size: var(--fs-h1); }
.type-h2 { font-size: var(--fs-h2); }

.type-body,
.type-body-2,
.type-body-3 {
  margin: 0;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: var(--lh-body);
}
.type-body   { font-size: var(--fs-body); }
.type-body-2 { font-size: var(--fs-body-2); }
.type-body-3 { font-size: var(--fs-body-3); font-weight: 500; }

.type-button {
  font-family: var(--font-body);
  font-size: var(--fs-button);
  font-weight: 600;
  line-height: var(--lh-button);
}

/* --------------------------------------------------------------------------
   5. Fondo y marco
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--frame-pad);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.page-bg img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
}

.card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1680px;
  min-height: calc(100svh - (var(--frame-pad) * 2));
  padding: var(--card-pad-y) var(--card-pad-x);
  background: var(--color-bg);
  border-radius: var(--radius);
}

/* Brand */
.site-header {
  display: flex;
  flex: none;
  justify-content: center;
}

.brand {
  display: inline-flex;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: var(--color-ink);
  text-decoration: none;
}

.brand img {
  width: 100%;
  height: 100%;
}

.brand:hover img {
  opacity: 0.86;
}

.brand img {
  transition: opacity 160ms var(--ease);
}

/* --------------------------------------------------------------------------
   6. Home
   -------------------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--content-max);
  margin-top: var(--footer-gap);
  text-align: center;
}

.hero__book {
  width: clamp(41px, calc(25.66px + 1.64vw), 54px);
  height: auto;
  flex: none;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: var(--gap-book-copy);
}

.hero__lede {
  max-width: 600px;
  margin-inline: auto;
  color: var(--color-text-secondary);
}

/* Uploader */
.uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-top: var(--gap-copy-uploader);
  padding: 20px;
  background: var(--color-surface-raised);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  transition: background-color 160ms var(--ease),
    border-color 160ms var(--ease);
}

.uploader.is-dragover {
  background: #fbf7ec;
  border-color: var(--color-accent-line);
}

.uploader__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--color-text-secondary);
  background: var(--color-surface-sunken);
  border-radius: var(--radius);
}

.uploader__icon svg {
  width: 24px;
  height: 24px;
}

.uploader__hint {
  max-width: 440px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
}

.uploader__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

/* Línea de estado: reserva la altura del mensaje de error de Figma
   para que mostrar un archivo o un error nunca mueva el layout. */
.uploader__status {
  max-width: 100%;
  min-height: calc(var(--fs-body-3) * var(--lh-body));
  margin: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploader__status[data-state="selected"] {
  color: var(--color-text-secondary);
}

.uploader__status[data-state="error"] {
  color: var(--color-error);
}

/* Estados del uploader — nodo 2032:447 (cargando) y 2032:420 (reanudar) */
.uploader__loading,
.uploader__resume {
  display: none;
}

.uploader[data-state="loading"],
.uploader[data-state="resume"] {
  justify-content: center;
}

.uploader[data-state="loading"] > :not(.uploader__loading),
.uploader[data-state="resume"] > :not(.uploader__resume) {
  display: none;
}

.uploader[data-state="loading"] {
  min-height: 223px;
}

.uploader[data-state="loading"] .uploader__loading {
  display: block;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
}

.uploader[data-state="resume"] .uploader__resume {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.uploader__resume-title {
  margin: 0;
  text-align: center;
}

.uploader__file {
  display: flex;
  justify-content: center;
  margin: 0;
}

.pill {
  display: inline-block;
  max-width: 100%;
  padding: 6px 9px;
  overflow: hidden;
  color: var(--color-ink);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-accent-soft);
  border-radius: var(--radius-pill);
}

.uploader__resume-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.uploader__resume-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
}

.uploader__resume-buttons .btn {
  max-width: 100%;
}

.uploader__resume-buttons .btn > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botón reutilizable — incluye el hover del nodo 2018:703 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: clamp(8px, 0.6vw, 10px) clamp(10px, 0.7vw, 12px);
  overflow: hidden;
  color: var(--color-button-ink);
  font-family: var(--font-body);
  font-size: var(--fs-button);
  font-weight: 600;
  line-height: var(--lh-button);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: var(--gradient-brand);
  -webkit-appearance: none;
  appearance: none;
  border: 1.5px solid var(--color-accent-line);
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease);
}

/* Crossfade al gradiente hover sin animar backgrounds */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-brand-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease);
}

.btn > span {
  position: relative;
  z-index: 1;
}

.btn:hover::before,
.btn:focus-within::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(1px);
}

/* Mientras se guarda el pedido en Postgres */
.btn[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
  cursor: progress;
}

.btn:focus-visible {
  outline: none;
}

/* Variante oscura — "Subir nuevo libro" (nodo 2032:420) */
.btn--dark {
  color: var(--color-surface);
  background: var(--color-ink);
  border-color: var(--color-ink);
}

.btn--dark::before {
  background: #2b2723;
}

/* El botón oscuro no debe cambiar de color al pasar el ratón. */
.btn--dark:hover,
.btn--dark:focus-visible {
  color: var(--color-surface);
}

.btn--dark:hover::before,
.btn--dark:focus-within::before {
  opacity: 0;
}

.btn--dark:active {
  transform: none;
}

/* Footer — nodo 2032:392: una sola línea centrada, sin widget de soporte */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: var(--footer-gap);
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
  text-align: center;
}

.footer__copy {
  margin: 0;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.footer__links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 140ms var(--ease);
}

.footer__links a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 761px) {
  :root {
    --frame-pad: 24px;
  }

  .uploader[data-state="loading"] {
    min-height: 207px;
  }
}

@media (max-width: 760px) {
  .uploader__resume-buttons {
    gap: 8px;
  }
}

@media (max-width: 431px) {
  :root {
    --fs-h1: clamp(24px, 7.85vw, 36px);
  }
}

/* Tablet: misma composición que desktop, footer centrado y sin widget. */
@media (min-width: 761px) and (max-width: 899px) {
  .card {
    justify-content: center;
    min-height: max(calc(100svh - (var(--frame-pad) * 2)), 680px);
  }

  .brand {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero {
    margin-top: 0;
  }

  .footer {
    position: absolute;
    right: 32px;
    bottom: 32px;
    left: 32px;
    width: auto;
    margin: 0;
    padding: 0;
    gap: 8px;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }

  /* En flujo el footer va detrás del contenido: nunca se superpone. */
  .card--flow .footer {
    position: static;
    width: 100%;
  }
}

@media (min-width: 900px) {
  :root {
    --card-pad-x: 20px;
    --gap-book-copy: 28px;
    --gap-copy-uploader: 28px;
  }

  .card {
    justify-content: center;
    min-height: max(calc(100svh - (var(--frame-pad) * 2)), 680px);
  }

  .brand {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero {
    margin-top: 0;
  }

  .footer {
    position: absolute;
    right: 32px;
    bottom: 32px;
    left: 32px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: auto;
    margin: 0;
    padding: 0;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   8. Páginas de flujo (2–6)
   -------------------------------------------------------------------------- */
.card--flow {
  justify-content: flex-start;
  padding-bottom: 20px;
}

.card--flow .brand {
  position: static;
  transform: none;
}

.card--flow .footer {
  margin-top: 0;
  padding-top: 0;
}

/* La cabecera y el footer van en flujo: si el contenido crece, la tarjeta
   crece con él y nunca se solapan. En desktop el contenido queda centrado
   en el espacio disponible con el mismo offset que Figma. */
.flow-wrap {
  display: flex;
  flex: 1 0 auto;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding-block: 72px;
}

.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0;
  text-align: center;
}

.flow__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.flow__head .type-h1,
.flow__head .type-body {
  margin: 0;
}

.flow__lede {
  max-width: 600px;
  margin-inline: auto;
}

.flow__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Long translated price labels must not overflow narrow screens. */
.flow__actions .btn {
  max-width: 100%;
}

.flow__actions .btn > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  width: 100%;
  min-height: calc(var(--fs-body-3) * var(--lh-body));
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
  text-align: center;
}

.status[data-state="error"] {
  color: var(--color-error);
}

.status[data-state="selected"] {
  color: var(--color-text-secondary);
}

/* Página 2 — selector de idioma */
.language-panel {
  position: relative;
  width: min(400px, 100%);
  height: 294px;
  padding: 12px;
  overflow: hidden;
  text-align: left;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-sunken);
  border-radius: var(--radius);
}

.language-search {
  display: block;
  width: 100%;
  padding: 8px 12px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body);
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius);
  outline-offset: -2px;
  -webkit-appearance: none;
  appearance: none;
}

.language-search::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.language-search::-webkit-search-decoration {
  -webkit-appearance: none;
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 236px;
  padding-bottom: 36px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.language-list::-webkit-scrollbar {
  display: none;
}

.language-option {
  display: block;
  flex: none;
  width: 100%;
  padding: 8px 12px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body-2);
  font-weight: 400;
  line-height: var(--lh-body);
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  transition: background-color 140ms var(--ease);
}

.language-option:hover {
  background: var(--color-surface-sunken);
}

.language-option[aria-pressed="true"] {
  background: var(--color-accent-soft);
}

.language-option:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -2px;
}

.language-fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 59px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(247, 247, 246, 0), var(--color-surface-raised) 82%);
  border-radius: 0 0 var(--radius) var(--radius);
}

.language-empty {
  margin: 0;
  padding: 8px 12px;
  color: var(--color-text-muted);
  font-size: var(--fs-body-2);
}

/* Paneles con selección múltiple (idioma 2032:581 · formato 2032:594) */
.picker-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(400px, 100%);
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 9px;
  overflow: hidden;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body-2);
  font-weight: 400;
  line-height: var(--lh-body);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background: var(--color-accent-soft);
  border: 0;
  border-radius: var(--radius-pill);
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 140ms var(--ease);
}

.chip:hover {
  background: #ecd9a8;
}

.chip:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   9. Páginas legales
   -------------------------------------------------------------------------- */
.legal-wrap {
  display: flex;
  flex: 1 0 auto;
  justify-content: center;
  width: 100%;
  padding: 32px 0 40px;
}

.legal {
  width: 100%;
  max-width: var(--content-max);
  text-align: left;
}

.legal__title {
  margin: 0 0 8px;
}

.legal .legal__meta {
  margin: 0 0 32px;
  color: var(--color-text-muted);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
}

.legal h2 {
  margin: 32px 0 8px;
}

.legal p,
.legal li {
  color: var(--color-text-secondary);
  font-size: var(--fs-body-2);
  line-height: 1.6;
}

.legal p {
  margin: 0 0 12px;
}

.legal ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal a {
  color: var(--color-ink);
  text-underline-offset: 3px;
}

.legal a:hover {
  text-decoration-thickness: 2px;
}

.cookie-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 20px;
  padding: 0;
  list-style: none;
}

/* Las listas legales genéricas usan menos separación; esta necesita más aire. */
.legal .cookie-list {
  gap: 12px;
  margin: 8px 0 20px;
  padding: 0;
}

.cookie-item {
  padding: 16px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-sunken);
  border-radius: var(--radius);
}

.cookie-item code {
  color: var(--color-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body-3);
  overflow-wrap: anywhere;
}

.cookie-item p {
  margin: 8px 0 0;
  font-size: var(--fs-body-3);
}

.cookie-item .cookie-item__meta {
  color: var(--color-text-muted);
  font-weight: 500;
}

.legal__contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
}

.legal__contact p {
  margin: 0;
}

/* Página 3 — progreso */
.progress {
  display: block;
  width: min(589px, 100%);
  height: 8px;
  overflow: hidden;
  background: var(--color-surface-sunken);
  border: 0;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}

.progress::-webkit-progress-bar {
  background: var(--color-surface-sunken);
  border-radius: 8px;
}

.progress::-webkit-progress-value {
  background: var(--color-ink);
  border-radius: 8px;
}

.progress::-moz-progress-bar {
  background: var(--color-ink);
  border-radius: 8px;
}

/* Página 4 — previsualización */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.preview__label {
  padding: 8px 12px;
  color: var(--color-text-muted);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body);
  text-align: left;
  background: var(--color-surface-raised);
  border-radius: var(--radius);
}

.preview__sheet {
  width: 100%;
  aspect-ratio: 210 / 297;
  background: var(--color-white);
  border: 1px solid var(--color-surface-sunken);
  border-radius: var(--radius);
}

/* Página 5 — resumen / pedido */
.order-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.order-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(400px, 100%);
  padding: 19px 20px;
  text-align: left;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-surface-sunken);
  border-radius: var(--radius);
}

.price-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-detail {
  display: flex;
  flex-direction: column;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.price {
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
}

.price--old {
  color: var(--color-line);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.price--new {
  color: var(--color-ink);
}

.offer {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body);
}

.summary__dot {
  flex: none;
  width: 5px;
  height: 5px;
  background: var(--color-ink);
  border-radius: 50%;
}

.guarantee {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--color-button-ink);
  background: var(--color-accent-soft);
  border-radius: var(--radius);
}

.guarantee p {
  margin: 0;
  font-size: var(--fs-body-2);
  font-weight: 400;
  line-height: var(--lh-body);
}

.guarantee svg {
  flex: none;
  width: 24px;
  height: 24px;
}

/* Campos de email / formularios */
.email-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(400px, 100%);
  text-align: left;
}

.field-label {
  color: var(--color-text);
  font-size: var(--fs-body-3);
  font-weight: 500;
  line-height: var(--lh-body);
}

.field {
  width: 100%;
  padding: 10px 12px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body);
  background: var(--color-surface-raised);
  border: 0;
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}

.field::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

.field:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

@media (min-width: 720px) {
  .preview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .preview {
    gap: 8px;
  }
}

@media (min-width: 900px) {
  .card--flow {
    padding-bottom: 32px;
  }

  .flow-wrap {
    align-items: center;
    padding-block: 0;
    padding-top: 14px;
  }

  .flow {
    gap: 20px;
  }

  .card--flow .footer {
    position: static;
    width: calc(100% - 24px);
    margin: 0;
    padding: 0;
  }

  .legal-wrap {
    padding: 40px 0 56px;
  }

  .price {
    font-size: 32px;
  }

  .order-card {
    padding: 20px;
  }

  .field-label--lg {
    font-size: var(--fs-body-2);
    font-weight: 400;
  }
}

/* --------------------------------------------------------------------------
   10. Accesibilidad / preferencias
   -------------------------------------------------------------------------- */
@media (hover: none) {
  .btn:hover::before {
    opacity: 0;
  }
}

@media (prefers-contrast: more) {
  :root {
    --color-text-muted: #5f5a50;
    --color-border: #a9a59c;
  }
}

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

/* Banner de consentimiento (funcional, no CMP certificada). */
.consent[hidden] {
  display: none;
}

.consent {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  padding: 18px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(25, 23, 20, 0.18);
}

.consent__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.consent__title {
  margin: 0 0 4px;
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
}

.consent__text {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.consent__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.consent__actions .btn {
  min-width: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
}

.consent__manage {
  margin-top: 14px;
}

@media (max-width: 700px) {
  .consent__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
