/* Placement test · Enjoying Spanish
   Colores y tipografías tomados del sitio (variables del kit de Elementor). */
:root {
  --crema: #FDFDF5;
  --blanco: #FFFFFF;
  --texto: #231F20;
  --muted: #5F5A63;
  --line: #E6E1EE;
  --lila: #BDA4F7;
  --lila-claro: #EDE6FC;
  --lila-ink: #6B4FC4;
  --naranja: #FF5B35;
  --naranja-hover: #E9471F;
  --naranja-claro: #FFE6DE;
  --lima: #ECFFBF;
  --oscuro: #131A1A;
  --ok: #2E7D3A;
  --fuente: "Poppins", "Segoe UI", system-ui, sans-serif;
  --fuente-destacada: "Playfair Display", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--crema); }
body {
  margin: 0;
  background: var(--crema);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.6;
}
.page { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 40px; }

/* Encabezado */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 4px 20px; }
.brand { color: var(--texto); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand em { font-family: var(--fuente-destacada); font-weight: 600; color: var(--lila-ink); }
.back { color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--texto); text-decoration: underline; }

/* Tarjeta principal */
.card {
  background: var(--blanco);
  border-radius: 24px;
  padding: 44px 48px;
  box-shadow: 0 1px 2px rgba(35, 31, 32, .05), 0 18px 48px rgba(35, 31, 32, .07);
  min-height: 420px;
}
@media (max-width: 600px) { .card { padding: 28px 20px; border-radius: 20px; } }
.loading { color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }
.foot p { margin: 0 0 4px; }
.credit a { color: var(--texto); font-weight: 600; text-decoration: underline; text-decoration-color: var(--lila); text-underline-offset: 3px; }
.credit a:hover { color: var(--lila-ink); }
.credit a:focus-visible { outline: 3px solid var(--lila-ink); outline-offset: 2px; border-radius: 4px; }
.heart { color: var(--naranja); }

/* Tipografía */
h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.15; font-weight: 600; margin: 0 0 16px; letter-spacing: -.01em; text-wrap: balance; }
h1 em { font-family: var(--fuente-destacada); font-style: italic; font-weight: 500; color: var(--lila-ink); }
h1:focus, h2:focus { outline: none; }
.eyebrow { display: inline-block; margin: 0 0 16px; padding: 6px 14px; border-radius: 999px; background: var(--lima); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.note { font-size: 14.5px; background: var(--lila-claro); border-radius: 14px; padding: 14px 16px; margin: 0 0 28px; }

.facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.facts li { border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.facts b { display: block; font-size: 15px; }
.facts span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 520px) {
  .facts { gap: 8px; }
  .facts li { padding: 10px; }
  .facts b { font-size: 13px; line-height: 1.3; }
  .facts span { font-size: 12px; }
}

/* Formularios */
.field { margin-bottom: 18px; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.opt-label { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input:not([type]), textarea {
  width: 100%;
  font: inherit;
  color: var(--texto);
  background: var(--blanco);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus { outline: none; border-color: var(--lila-ink); box-shadow: 0 0 0 3px var(--lila-claro); }
.invalid input, .invalid textarea { border-color: var(--naranja); }
.error { display: block; color: #B8361A; font-size: 13.5px; margin-top: 6px; }
.help { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }
.prompt { font-size: 16px; background: var(--lila-claro); border-radius: 12px; padding: 12px 14px; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--lila-ink); }
.check a { color: var(--lila-ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Botones */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 16px;
  color: var(--blanco); background: var(--naranja);
  border: 2px solid var(--naranja); border-radius: 999px;
  padding: 14px 30px; cursor: pointer; text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:hover { background: var(--naranja-hover); border-color: var(--naranja-hover); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--naranja); border-color: var(--naranja); }
.btn-ghost { color: var(--lila-ink); background: transparent; border-color: var(--lila); }
.btn-ghost:hover { background: var(--lila-claro); border-color: var(--lila); }
.btn:focus-visible, .back:focus-visible, .brand:focus-visible, .opt:focus-within { outline: 3px solid var(--lila-ink); outline-offset: 3px; }
@media (max-width: 520px) { .actions .btn { width: 100%; } }

/* Progreso */
.progress { margin-bottom: 28px; }
.progress p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.progress p b { color: var(--texto); font-weight: 600; }
.segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.segs i { height: 6px; border-radius: 3px; background: var(--line); }
.segs i.done { background: var(--lila); }
.segs i.now { background: var(--lila-ink); }

/* Pregunta */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 22px; width: 100%; }
.instr { display: block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.sentence { font-size: clamp(22px, 4.4vw, 28px); line-height: 1.45; font-weight: 500; margin: 0; }
.blank {
  display: inline-block; min-width: 3.2em; padding: 0 6px; margin: 0 2px;
  border-bottom: 3px solid var(--lila); color: var(--lila-ink); font-weight: 600;
  line-height: 1.25; text-align: center;
}
.hint { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .options { grid-template-columns: minmax(0, 1fr); } }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; font-size: 17px; font-weight: 500;
  transition: border-color .15s ease, background-color .15s ease;
}
.opt:hover { border-color: var(--lila); }
.opt input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 2px solid var(--lila); border-radius: 50%; display: grid; place-items: center; }
.opt input::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lila-ink); transform: scale(0); transition: transform .12s ease; }
.opt input:checked::before { transform: scale(1); }
.opt input:focus { outline: none; }
.opt:has(input:checked) { border-color: var(--lila-ink); background: var(--lila-claro); }
.opt.is-checked { border-color: var(--lila-ink); background: var(--lila-claro); }
.opt-idk { grid-column: 1 / -1; color: var(--muted); font-size: 15px; font-weight: 400; border-style: dashed; }

/* Pausa entre partes */
.center { text-align: center; }
.center .lead { max-width: 46ch; margin-inline: auto; }
.badge-ok { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--lima); display: grid; place-items: center; }
.badge-ok svg { width: 30px; height: 30px; }

/* Resultado */
.level { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; flex-wrap: wrap; }
.level .code { display: inline-grid; place-items: center; min-width: 112px; height: 112px; padding: 0 16px; border-radius: 28px; background: var(--lila); color: var(--oscuro); font-size: 52px; font-weight: 700; letter-spacing: -.02em; }
.level .name { font-family: var(--fuente-destacada); font-style: italic; font-weight: 500; font-size: clamp(30px, 6vw, 40px); color: var(--lila-ink); line-height: 1.1; }
.scores { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.scores li { display: grid; grid-template-columns: 48px 70px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.scores b { font-weight: 700; }
.scores span { font-variant-numeric: tabular-nums; color: var(--muted); }
.scores em { font-style: normal; font-size: 13px; font-weight: 600; justify-self: end; color: var(--lila-ink); }
.scores li.ok em { color: var(--ok); }
.status { font-size: 14.5px; color: var(--muted); margin: 20px 0 0; }
.status.ok { color: var(--ok); }
.status.bad { color: #B8361A; }
.preview-banner { background: var(--naranja-claro); color: #8A2A12; font-size: 13.5px; border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
