/* ==========================================================================
   TestOpoAcierta — hoja de estilos única
   Editar colores y tipografía en :root
   ========================================================================== */

:root {
  --teal-900: #134e4a;
  --teal-700: #0f766e;
  --teal-600: #14867c;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --ink:      #0f172a;
  --ink-soft: #475569;
  --ink-mute: #64748b;
  --line:     #e2e8f0;
  --bg:       #ffffff;
  --bg-alt:   #f8fafc;

  --amber:    #f59e0b;
  --wa:       #25d366;
  --wa-dark:  #128c3f;

  --radius:   14px;
  --radius-sm: 9px;
  --shadow:   0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.15);
  --shadow-lg: 0 12px 40px -12px rgba(15,23,42,.25);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.06rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--teal-700); }

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

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 720px; }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--teal-700); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 3px solid var(--teal-600); outline-offset: 2px; border-radius: 4px; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--teal-700);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.35em;
  font: inherit; font-weight: 600; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid transparent; border-radius: 100px;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: .6em 1em; font-size: .9rem; }
.btn-lg { padding: 1em 1.9em; font-size: 1.05rem; }
.btn-primary { --btn-bg: var(--teal-700); }
.btn-primary:hover { --btn-bg: var(--teal-900); }
.btn-wa { --btn-bg: var(--wa-dark); }
.btn-wa::before {
  content: ""; width: 1.05em; height: 1.05em; flex: none;
  background: currentColor;
  -webkit-mask: var(--wa-icon) center / contain no-repeat;
  mask: var(--wa-icon) center / contain no-repeat;
  --wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.46 1.32 4.97L2 22l5.25-1.38a9.9 9.9 0 004.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91S17.5 2 12.04 2zm5.8 14.03c-.24.68-1.4 1.3-1.94 1.35-.5.05-1.13.07-3.2-.85-2.45-1.09-4-3.66-4.12-3.83-.12-.17-.98-1.35-.98-2.58 0-1.22.64-1.82.87-2.07.23-.25.5-.31.68-.31.17 0 .35 0 .5.01.16.01.38-.06.59.45.21.51.72 1.76.79 1.89.06.12.1.27.02.44-.09.17-.13.27-.26.42-.13.15-.27.33-.39.44-.13.12-.27.26-.11.51.15.25.68 1.13 1.47 1.83.99.88 1.83 1.16 2.09 1.29.26.13.41.11.56-.07.15-.17.65-.76.82-1.02.17-.26.35-.21.58-.13.24.09 1.5.71 1.76.84.26.13.43.19.5.3.06.11.06.65-.18 1.33z'/%3E%3C/svg%3E");
}
.btn-wa:hover { --btn-bg: #0e7a37; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--teal-700); border-color: var(--line); }
.btn-ghost:hover { --btn-bg: var(--teal-50); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark rect { fill: var(--teal-700); }
.brand-mark path { stroke: #fff; }
.brand-text { font-size: 1.12rem; letter-spacing: -.02em; }
.brand-text strong { color: var(--teal-700); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--teal-700); }
@media (max-width: 720px) {
  .site-nav a:not(.btn) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 420px at 88% -10%, var(--teal-100), transparent 65%),
    linear-gradient(180deg, var(--teal-50), #fff 78%);
  padding: clamp(48px, 8vw, 92px) 0;
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-card { order: -1; }
}
.eyebrow {
  display: inline-block; margin: 0 0 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal-700); background: #fff;
  border: 1px solid var(--teal-100); border-radius: 100px; padding: .4em .9em;
}
.hl { color: var(--teal-700); }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.hero-badges li { font-size: .9rem; color: var(--ink-mute); display: flex; align-items: center; gap: .45em; }
.hero-badges li::before { content: "✓"; color: var(--teal-600); font-weight: 700; }

/* mock PDF */
.mock-pdf {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: rotate(-1.2deg);
}
.mock-pdf-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--bg-alt); border-bottom: 1px solid var(--line);
}
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.mock-file { margin-left: 8px; font-size: .8rem; color: var(--ink-mute); }
.mock-pdf-body { padding: 20px; font-size: .92rem; }
.mock-q { font-weight: 600; margin-bottom: 14px; }
.mock-opt {
  padding: .55em .8em; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-soft);
  display: flex; justify-content: space-between;
}
.mock-opt-ok { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-900); font-weight: 600; }
.mock-tick { color: var(--teal-600); }
.mock-note { margin: 14px 0 0; font-size: .8rem; color: var(--ink-mute); font-style: italic; }

/* ---------- Secciones ---------- */
.section { padding: clamp(44px, 7vw, 78px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title { margin-bottom: .35em; }
.section-sub { color: var(--ink-mute); font-size: .92rem; margin-bottom: 26px; }
.group-title {
  font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-mute); margin: 34px 0 14px;
}

/* ---------- Pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px;
  background: var(--teal-700); color: #fff; border-radius: 50%; font-weight: 700;
}
.steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.field { flex: 1 1 190px; }
.field-search { flex: 2 1 260px; }
.field input, .field select {
  width: 100%; padding: .72em .95em; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus { border-color: var(--teal-600); }

/* ---------- Grid de tarjetas ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover { border-color: #cbd5e1; box-shadow: var(--shadow); transform: translateY(-2px); }
.card.is-selected { border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.card-pack { background: linear-gradient(160deg, #fff, var(--teal-50)); border-color: var(--teal-100); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .3em .65em; border-radius: 100px;
  background: var(--bg-alt); color: var(--ink-mute); border: 1px solid var(--line);
}
.tag-new   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.tag-free  { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.tag-pack  { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }

.card h3 { margin-bottom: 6px; }
.card-oposicion { font-size: .85rem; color: var(--ink-mute); margin-bottom: 12px; }
.card-desc { font-size: .93rem; color: var(--ink-soft); margin-bottom: 14px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-mute); margin-bottom: 16px; }
.card-temas { font-size: .82rem; color: var(--ink-mute); margin-bottom: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.price-old { font-size: .9rem; font-weight: 500; color: var(--ink-mute); text-decoration: line-through; margin-left: .4em; }
.price-free { color: var(--teal-700); }

.btn-toggle {
  --btn-bg: var(--teal-50); --btn-fg: var(--teal-700);
  border-color: var(--teal-100); padding: .65em 1.1em; font-size: .92rem;
}
.btn-toggle:hover { --btn-bg: var(--teal-100); }
.btn-toggle[aria-pressed="true"] { --btn-bg: var(--teal-700); --btn-fg: #fff; border-color: var(--teal-700); }

.empty { text-align: center; color: var(--ink-mute); padding: 40px 0; }

/* ---------- FAQ ---------- */
details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px;
}
details summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--teal-700); font-size: 1.35rem; font-weight: 400; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- CTA + footer ---------- */
.cta h2 { margin-bottom: .4em; }
.cta .lead { margin-inline: auto; margin-bottom: 26px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 90px; font-size: .88rem; color: var(--ink-mute); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
.footer-inner p { margin: 0; }
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--ink-mute); text-decoration: none; }
.footer-nav a:hover { color: var(--teal-700); text-decoration: underline; }

/* ---------- Barra de selección ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--ink); color: #fff;
  box-shadow: 0 -8px 30px -10px rgba(15,23,42,.4);
  animation: subeBarra .22s ease-out;
}
@keyframes subeBarra { from { transform: translateY(100%); } to { transform: translateY(0); } }
.barra-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.barra-info { display: flex; flex-direction: column; line-height: 1.3; }
.barra-info strong { font-size: .95rem; }
#barra-total { font-size: 1.25rem; font-weight: 700; }
.barra-actions { display: flex; align-items: center; gap: 10px; }
.barra .btn-ghost { --btn-fg: #cbd5e1; border-color: #334155; }
.barra .btn-ghost:hover { --btn-bg: #1e293b; --btn-fg: #fff; }

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