/* Portada de la demostración: página suelta, sin el CSS de la web. Copia sus tokens
   (apps/web/src/index.css) y el estilo de la portada y de /extension (site.css). */

/* Inter, la fuente de la web, servida desde aquí (el build le pone otro nombre a la suya en cada
   versión). Copia de @fontsource-variable/inter (licencia SIL OFL 1.1), solo el subconjunto latino. */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #fff;
  --surface-2: #f1f3f8;
  --surface-3: #e8ebf3;
  --border: #e3e6ee;
  --border-strong: #cfd4e0;
  --text: #4a5368;
  --text-muted: #6b7489;
  --text-h: #0e1527;
  --accent-fill: #4f46e5;
  --accent-fill-hover: #4338ca;
  --accent: #4338ca;
  --accent-soft: #eef0ff;
  --success: #0f6b43;
  --ok-fill: #16a34a;
  --ai-1: #6366f1;
  --ai-2: #8b5cf6;
  --ai-3: #d946ef;
  --bezel: #0e1527;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05), 0 1px 3px rgb(16 24 40 / 0.06);
  --art-shadow: rgb(16 24 40 / 0.16);
  --radius: 14px;
  --radius-lg: 20px;
  --sans: 'Inter Variable', system-ui, 'Segoe UI', Roboto, sans-serif;

  /* La plataforma del examen (plataforma.css y mostrar-examen.js), que no es opjeo: sus colores
     no son el índigo de la marca. El verde del botón, más oscuro, para que el texto blanco se lea. */
  --pf-blue: #2196f3;
  --pf-now: #42a5f5;
  --pf-done: #66bb6a;
  --pf-todo: #bdbdbd;
  --pf-go: #2e7d32;
  --pf-badge: #343a40;
  --pf-num: #1976d2;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0e16;
    --surface: #131826;
    --surface-2: #1a2031;
    --surface-3: #232a3e;
    --border: #252c40;
    --border-strong: #343d56;
    --text: #b6bfd1;
    --text-muted: #8a94ab;
    --text-h: #f2f4fa;
    --accent-fill: #5b55f0;
    --accent-fill-hover: #6d68f5;
    --accent: #a5b0ff;
    --accent-soft: rgb(99 102 241 / 0.16);
    --success: #7fe0ae;
    --ok-fill: #22a05a;
    --ai-1: #818cf8;
    --ai-2: #a78bfa;
    --ai-3: #e879f9;
    --bezel: #39415a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --art-shadow: rgb(0 0 0 / 0.55);
    --pf-todo: #3d4559;
    --pf-badge: #4a525f;
    --pf-num: #64b5f6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text-h);
}

a {
  color: var(--accent);
}

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wrap {
  width: 100%;
  max-width: 1184px;
  margin: 0 auto;
  padding-inline: 16px;
}

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── Cabecera ───────── */

.top {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-h);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.top-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ───────── Botones ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.btn-primary {
  background: var(--accent-fill);
  box-shadow: 0 8px 20px -8px rgb(79 70 229 / 0.6);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-fill-hover);
}

.btn-primary .icon {
  transition: transform 0.15s;
}

.btn-primary:hover .icon {
  transform: translateX(3px);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-h);
}

.btn-secondary:hover {
  border-color: var(--accent-fill);
  color: var(--accent);
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-sm .icon {
  width: 16px;
  height: 16px;
}

/* ───────── Hero ───────── */

.hero {
  display: grid;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--ai-1), var(--ai-2) 55%, var(--ai-3));
}

h1 {
  max-width: 19ch;
  font-size: clamp(32px, 8vw, 46px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede {
  max-width: 46ch;
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.actions .btn {
  padding-inline: 18px;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  font-size: 15px;
  list-style: none;
}

.facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.facts .icon {
  width: 16px;
  height: 16px;
  /* Centrado con la primera línea (15 px × 1,55). */
  margin-top: 3.5px;
  color: var(--success);
  stroke-width: 2.6;
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 520px);
  min-width: 0;
  margin: 0;
}

/* Un halo suave detrás de la ilustración (el degradado de la web). */
.hero-art::before {
  content: '';
  position: absolute;
  inset: 8% 6% 4% 10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(139 92 246 / 0.22), rgb(99 102 241 / 0.1) 55%, transparent);
  filter: blur(8px);
}

.art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ───────── Piezas de las ilustraciones (SVG) ───────── */

/* La sombra, solo en el rect de fondo de cada pieza (nada animado dentro de un filtro). */
.lift {
  filter: drop-shadow(0 18px 28px var(--art-shadow));
}

.lift-sm {
  filter: drop-shadow(0 6px 10px var(--art-shadow));
}

.s-win,
.s-card,
.s-pill {
  fill: var(--surface);
  stroke: var(--border);
}

.s-page {
  fill: var(--bg);
}

.s-bar {
  fill: var(--surface-2);
}

.s-dot,
.s-line {
  fill: var(--surface-3);
}

.s-ext {
  fill: var(--accent-soft);
  stroke: var(--accent-fill);
  stroke-width: 1.5;
}

.s-box {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.s-field {
  fill: var(--surface);
  stroke: var(--border-strong);
}

.s-accent {
  fill: var(--accent-fill);
}

.s-ok {
  fill: var(--ok-fill);
}

.s-tick {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.s-stroke-muted {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.s-bezel {
  fill: var(--bezel);
}

.s-sel {
  fill: var(--surface);
  stroke: var(--accent-fill);
  stroke-width: 1.5;
}

.s-cursor {
  fill: var(--text-h);
  stroke: var(--surface);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* La plataforma del examen. */
.pf-on {
  fill: var(--pf-blue);
}

.pf-now {
  fill: var(--pf-now);
}

.pf-done {
  fill: var(--pf-done);
}

.pf-todo {
  fill: var(--pf-todo);
}

.pf-go {
  fill: var(--pf-go);
}

.pf-badge {
  fill: var(--pf-badge);
}

/* Textos: los de la ilustración grande miden 16 unidades (≥ 10 px a 390 px de ancho); los de
   los pasos, 12 unidades (≥ 10 px: esos dibujos se ven a 0,87-0,93 px por unidad). */
.s-t {
  font-family: var(--sans);
  font-size: 12px;
}

.art .s-t {
  font-size: 16px;
}

.s-t-muted {
  fill: var(--text-muted);
}

.s-h-t {
  fill: var(--text-h);
  font-size: 12px;
  font-weight: 650;
}

.art .s-h-t {
  font-size: 16px;
}

.s-brand-t {
  fill: var(--text-h);
  font-weight: 700;
}

.art .s-brand-t {
  font-size: 17px;
}

.s-step-brand {
  font-size: 12px;
}

.s-url {
  fill: var(--text-muted);
}

.art .s-num {
  fill: var(--pf-num);
  font-size: 18px;
  font-weight: 700;
}

.s-cap {
  fill: var(--text-muted);
}

.pf-badge-t,
.pf-go-t,
.s-btn-t {
  fill: #fff;
  font-weight: 600;
}

.s-field-t {
  fill: var(--text-h);
}

/* La casilla que la extensión marca: tres veces y se queda marcada. */
.mark {
  animation: mark 2.8s ease-in-out 3 both;
}

@keyframes mark {
  0%,
  30% {
    opacity: 0;
  }
  42%,
  100% {
    opacity: 1;
  }
}

/* ───────── Pasos ───────── */

.band {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(24px, 5vw, 30px);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-head p {
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 16px;
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.step-art {
  display: grid;
  place-items: center;
  height: 112px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--bg));
}

.step-art svg {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

.step-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 20px 20px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: 0 0 0 4px var(--accent-soft);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.step h3 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 15px;
}

/* El botón (o la nota) va abajo, alineado entre tarjetas y con la misma altura. */
.step .btn {
  margin-top: auto;
}

.step .step-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: auto;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-h);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}

.step-note .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ───────── Empezar de cero y nota para el revisor ───────── */

.extras {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.reset,
.reviewers {
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.reset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  background: var(--bg);
}

.reset .btn {
  justify-content: flex-start;
  text-align: left;
}

.reset-title {
  color: var(--text-h);
  font-weight: 650;
}

#borrado {
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

.reviewers {
  border-style: dashed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.reviewers h2 {
  margin-bottom: 4px;
  font-size: 15px;
}

/* ───────── Pie ───────── */

.foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.foot-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ───────── Móvil: los botones principales a todo el ancho ───────── */

@media (max-width: 559px) {
  .actions {
    flex-direction: column;
    align-self: stretch;
  }
}

/* ───────── Pantallas medianas y grandes ───────── */

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .wrap {
    padding-inline: 32px;
  }

  .foot-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 40px;
    padding-top: 16px;
    padding-bottom: 20px;
  }

  .step-art {
    height: 104px;
  }

  .step-body {
    gap: 6px;
    padding: 14px 18px 18px;
  }

  /* Hasta 520 px de ancho, pero en pantallas bajas cede para que los pasos se vean sin bajar. */
  .hero-art {
    justify-self: end;
    width: min(100%, 520px, max(420px, 100vh - 448px));
  }

  .step p {
    font-size: 14.5px;
    line-height: 1.5;
  }

  .facts {
    flex-flow: row wrap;
    gap: 8px 20px;
    font-size: 14px;
  }

  .facts .icon {
    margin-top: 3.5px;
  }

  .band {
    padding: 20px 0 40px;
  }

  .section-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
  }

  .section-head p {
    max-width: 64ch;
    text-align: right;
  }
}

@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
  }
}

/* Portátiles bajos (p. ej. 1280×720): todo más compacto para ver al menos los títulos de los pasos. */
@media (min-width: 960px) and (max-height: 780px) {
  .hero {
    column-gap: 24px;
    padding-top: 16px;
    padding-bottom: 20px;
  }

  .hero-copy {
    gap: 12px;
  }

  h1 {
    font-size: 40px;
  }

  .lede {
    font-size: 17px;
  }

  .band {
    padding-top: 20px;
  }

  .section-head {
    margin-bottom: 14px;
  }

  .section-head h2 {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn .icon {
    transition: none;
  }

  .mark {
    animation: none;
  }
}
