/* ============================================================================
   Liga CTF — hoja del feature (mismo patrón que quiz.css o tutoring.css).

   Dirección (AD-G1/G2): superficie de producto dentro del portal, lenguaje
   "Dark Academy" del contrato (DESIGN.md), VARIANZA 3 / MOVIMIENTO 2 /
   DENSIDAD 6: es una herramienta de datos, no una landing.

   Reglas del sistema que se respetan aquí:
   - DS-G3 / DS-R24: cero valores crudos. Todo sale de los tokens de style.css.
   - DS-G2: no se define un :root paralelo; los tints se derivan con color-mix()
     del token que ya existe (DS-R9).
   - DESIGN.md §4 "The No Glass Rule": tarjetas sólidas con borde, sin blur ni
     translúcidos.
   - DESIGN.md §2: el rojo es acento (CTA, enlaces, estados activos), nunca
     relleno grande. Los CTA sólidos usan --accent-dark, no --accent: blanco
     sobre --accent da 3,76:1 y no llega a AA (nota ya presente en style.css).
   - AX-R10 / AX-G3: el foco se ve siempre; nunca outline:none sin reemplazo.
   - DS-R18: cifras con tabular-nums para que no bailen.
   - AX-R17 / AX-G6: prefers-reduced-motion detiene la animación infinita.
   ============================================================================ */

/* --- Cáscara --------------------------------------------------------------- */

.league-hero { padding: 96px 0 20px; text-align: center; }
.league-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 6px;
}
.league-hero h1 span { color: var(--accent); }
.league-hero p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 auto;
}

.league-container { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s ease-out;
}
.back-link:hover { color: var(--accent); }

/* --- Estados (vacío, sin acceso, cerrado, error) --------------------------- */

.league-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.league-state i { width: 44px; height: 44px; margin-bottom: 14px; opacity: 0.4; }
.league-state p { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 4px; }

/* --- Botón ---------------------------------------------------------------- */

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 26px;
  margin-top: 20px;
  border: 0;
  border-radius: var(--radius-pill);
  /* Base --accent-deep y NO --accent-dark: con --text, #DC2626 da 4,28:1 y se queda corto
     para AA (5,73:1 con #B91C1C). Medido, no supuesto. */
  background: var(--accent-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease-out, transform 0.15s ease-out;
}
/* El hover no cambia el color: mantiene el contraste y da la senal con el brillo del sistema. */
.btn-start:hover { box-shadow: var(--shadow-glow); }
.btn-start:active { transform: translateY(1px); }

/* --- Carga ---------------------------------------------------------------- */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px;
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 12px;
}
.loading-spinner::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ctf-spin 0.9s linear infinite;
}
@keyframes ctf-spin { to { transform: rotate(360deg); } }

/* --- Secciones y panel de cifras ------------------------------------------ */

.league-section { margin-bottom: 40px; }
.league-section > h2 {
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 16px;
}

.league-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.panel-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.panel-stat .val {
  font-family: var(--font-metric);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.15;
  word-break: break-word;
}
.panel-stat .lbl {
  margin-top: 6px;
  font-family: var(--font-code);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.week-range { font-family: var(--font-code); font-size: 11px; color: var(--text-muted); margin: -8px 0 14px; }
.week-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.week-grid .panel-stat .val { font-size: clamp(18px, 2.4vw, 22px); }
.week-lists { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.week-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.week-card ul { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--text-secondary); }
.week-card li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.week-card li:last-child { border-bottom: 0; }

/* --- Catálogo de retos ---------------------------------------------------- */

.league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ctf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s ease-out;
}
.ctf-card:hover { border-color: var(--accent-soft); }
.ctf-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.ctf-code { font-family: var(--font-code); font-size: 11px; color: var(--accent); }
.ctf-league {
  font-family: var(--font-code);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.ctf-card h3 { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; margin: 0 0 10px; }
.ctf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--text-muted);
}
.ctf-points { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Tablas de datos ------------------------------------------------------ */

.ranking-wrap { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ranking-table th {
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.ranking-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.ranking-table .rank { font-family: var(--font-code); color: var(--text-muted); width: 48px; font-variant-numeric: tabular-nums; }
.ranking-table .num { font-family: var(--font-metric); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking-table .pts { color: var(--success); font-weight: 700; }
.ranking-table .ictf-name { font-weight: 700; color: var(--text); }

/* --- Panel del profesor --------------------------------------------------- */

.org-label { font-family: var(--font-code); font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.ictf-code { font-family: var(--font-code); font-size: 11px; color: var(--accent); }
.ictf-gates { font-family: var(--font-code); font-size: 12px; color: var(--warning); }
.ictf-detail td { padding-top: 0; }
.ictf-detail ul { list-style: none; margin: 0; padding: 0 0 6px; font-size: 12px; color: var(--text-muted); }
.ictf-detail li { padding: 3px 0; }
.ictf-tag {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
/* Estado por color + palabra: nunca solo color (AD-R15). */
.ictf-resuelto { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.ictf-entregado { color: var(--warning); border-color: color-mix(in oklab, var(--warning) 40%, transparent); }
.ictf-empezado { color: var(--text-secondary); border-color: var(--border); }

/* --- Visibilidad propia --------------------------------------------------- */

.visibility-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 32px;
}
.visibility-card h2 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.visibility-card .hint { font-size: 13px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 16px; }
.visibility-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
/* Objetivo tactil: la fila entera del checkbox, no los 20 px del texto (AX-G8). */
.visibility-form label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--text-secondary); }
.visibility-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-deep); }
.visibility-form input[type="text"] {
  flex: 1;
  min-width: 160px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-code);
  font-size: 13px;
}
.visibility-form input[type="text"]::placeholder { color: var(--text-muted); }
.visibility-msg {
  min-height: 1em;
  margin-top: 10px;
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--text-muted);
}
.visibility-msg[data-estado='ok'] { color: var(--success); }
.visibility-msg[data-estado='error'] { color: var(--error); }

/* --- Solves propios ------------------------------------------------------- */

.solve-list { list-style: none; padding: 0; margin: 0; }
.solve-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.solve-list li:last-child { border-bottom: none; }
.solve-list .solve-pts {
  font-family: var(--font-metric);
  color: var(--success);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.solve-list .fb { font-family: var(--font-code); font-size: 10px; color: var(--accent); margin-left: 6px; }

.empty-note { font-size: 13px; line-height: 1.6; color: var(--text-muted); padding: 16px 0; }

/* --- Foco visible (AX-G3): anillo del sistema, nunca outline:none a secas --- */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* --- Móvil y reduced motion (siempre al final: DS-R32) -------------------- */

@media (max-width: 900px) {
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .league-hero { padding-top: 88px; }
  .league-panel { grid-template-columns: repeat(2, 1fr); }
  .league-panel .panel-stat:last-child { grid-column: span 2; }
  .week-lists { grid-template-columns: 1fr; }
  .visibility-form { flex-direction: column; align-items: stretch; }
  .visibility-form label { align-self: flex-start; }
  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4) { display: none; }
  /* La tabla es contenido bidimensional: se permite scroll propio (AX-R19),
     pero el resto de la página no desborda. */
  .ranking-wrap { margin: 0 -20px; padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner::after { animation: none; border-top-color: var(--border); }
  .ctf-card, .btn-start, .back-link { transition: none; }
  .btn-start:active { transform: none; }
}

/* --- Landing pública del CTF (/ctf/) -------------------------------------- */
/* Prefijo .cl-: todo lo de aquí es de la landing. Reutiliza .league-hero,
   .league-container, .btn-start, .ctf-card, .ctf-league, .ranking-wrap,
   .ranking-table y .empty-note de arriba, y .btn-primary/.btn-secondary de
   style.css. Mismas reglas que el resto de la hoja: cero valores crudos, rojo
   solo como acento, tarjetas sólidas con borde, movimiento con transform y
   opacity y nada más, y reduced-motion al final del bloque. */

/* Hero: la cáscara es .league-hero; aquí solo crece para una portada. */
.cl-hero { padding: 150px 0 24px; position: relative; overflow: hidden; }
.cl-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  width: 720px;
  height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none;
}
.cl-hero > .league-container { position: relative; padding-bottom: 56px; }
.cl-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 30ch;
  margin: 0 auto 18px;
}
.cl-hero p { font-size: clamp(16px, 1.6vw, 18px); max-width: 52ch; margin-bottom: 28px; }

.cl-eyebrow {
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 14px;
}
/* .league-hero p y .cl-hero p pisan el eyebrow (color, tamaño, margen): se vuelve a fijar con más peso. */
.cl-hero p.cl-eyebrow { font-size: 12px; color: var(--accent); max-width: none; margin: 0 0 14px; }

.cl-hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.cl-hero-cta .btn-primary,
.cl-hero-cta .btn-secondary { min-height: 48px; white-space: nowrap; text-decoration: none; }

.cl-hero-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  font-size: 14px;
  color: var(--text-secondary);
}
.cl-hero-stats li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cl-hero-stats i, .cl-hero-stats svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.cl-hero-stats strong {
  font-family: var(--font-metric);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cl-hero-stats strong[data-estado='error'] { font-family: var(--font-body); font-weight: 500; color: var(--text-muted); }

/* Entrada escalonada: fadeUp 0.6s, 0.1s por elemento (DESIGN §6). */
.cl-hero-in { opacity: 0; animation: cl-fade-up 0.6s ease forwards; }
.cl-hero-in:nth-child(1) { animation-delay: 0s; }
.cl-hero-in:nth-child(2) { animation-delay: 0.1s; }
.cl-hero-in:nth-child(3) { animation-delay: 0.2s; }
.cl-hero-in:nth-child(4) { animation-delay: 0.3s; }
.cl-hero-in:nth-child(5) { animation-delay: 0.4s; }
@keyframes cl-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Secciones: ritmo void / surface / void (DESIGN §5). */
.cl-section { padding: 80px 0; }
.cl-section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cl-section .league-container { padding-bottom: 0; }
.cl-section h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  max-width: 24ch;
}
.cl-section h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
.cl-section p { color: var(--text-secondary); font-size: 15px; line-height: 1.65; margin: 0 0 14px; }
.cl-section p:last-child { margin-bottom: 0; }
.cl-section strong { color: var(--text); }
.cl-lead { max-width: 60ch; margin-bottom: 28px; }
.cl-narrow { max-width: 760px; }

/* Revelado: opacity + translateY(20px) en 500ms. Sin JS se ve igualmente. */
.cl-reveal { opacity: 1; transform: none; }
.js .cl-reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .cl-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* 2. Qué es: dos columnas, texto | ligas. */
.cl-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: start; }
.cl-split > * { min-width: 0; }
.cl-leagues {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cl-leagues li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.cl-leagues li:last-child { border-bottom: 0; }
.cl-league-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faded); }
.cl-league-dot[data-nivel='1'] { background: var(--level-1); }
.cl-league-dot[data-nivel='2'] { background: var(--level-2); }
.cl-league-dot[data-nivel='3'] { background: var(--level-3); }
.cl-league-dot[data-nivel='4'] { background: var(--level-4); }
.cl-league-name { font-weight: 600; font-size: 15px; color: var(--text); }
/* Estado por color + palabra, nunca solo color (AD-R15). */
.cl-league-state {
  font-family: var(--font-code);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.cl-league-state.is-open { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, transparent); }

/* 3. Cómo funciona: pasos en columna con línea vertical, no tres tarjetas. */
.cl-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.cl-steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 20px; padding-bottom: 36px; }
.cl-steps li::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 48px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.cl-steps li:last-child { padding-bottom: 0; }
.cl-steps li:last-child::before { display: none; }
.cl-step-num {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-metric);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.cl-step-body { padding-top: 8px; min-width: 0; }

/* 4. Ranking: la tabla es la de .ranking-table; aquí el skeleton y el tamaño. */
.cl-ranking { font-size: 14px; }
.cl-ranking th.num { text-align: right; }
.cl-ranking td { padding: 12px; }
.cl-ranking .ictf-name { font-weight: 600; }
.cl-skel td span {
  display: block;
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  animation: cl-pulse 1.2s ease-in-out infinite;
}
.cl-skel td:nth-child(1) span { width: 28px; }
.cl-skel td:nth-child(2) span { width: 60%; }
.cl-skel td:nth-child(3) span,
.cl-skel td:nth-child(4) span { width: 36px; margin-left: auto; }
@keyframes cl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.cl-ranking-error { color: var(--text-secondary); }

/* 5. Evidencia: bento 3 columnas, dos celdas anchas, sin huecos. */
.cl-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.cl-cell { min-width: 0; padding: 24px; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s ease-out; }
.cl-cell:hover { transform: translateY(-4px); box-shadow: var(--shadow-elevated); }
.cl-cell-wide { grid-column: span 2; }
.cl-cell i, .cl-cell svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 14px; }
.cl-cell h3 { font-size: 18px; }
.cl-cell p { font-size: 14px; }

/* 6. Precios: un plan destacado + filas compactas. */
.cl-pricing { max-width: 900px; }
.cl-plan-featured {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  padding: 32px;
  margin: 8px 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 40px;
}
.cl-plan-featured > * { min-width: 0; }
.cl-plan-featured-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; grid-column: 1 / -1; }
.cl-plan-featured-head h3 { font-size: 22px; margin: 0; }
.cl-plan-featured .ctf-league { font-size: 11px; padding: 4px 10px; /* AD-G7: el rojo de --accent sobre este fondo da 4,03:1 y a 11 px no pasa AA; el acento queda en el borde y el texto va en --text (13:1). */
  color: var(--text); border-color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-pill); }
.cl-price { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.cl-price-num {
  font-family: var(--font-metric);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.cl-price-per { font-size: 14px; color: var(--text-muted); }
.cl-price-alt { font-family: var(--font-metric); font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin: 0; align-self: start; }
.cl-plan-list { list-style: none; margin: 8px 0 0; padding: 0; grid-column: 1; }
.cl-plan-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-secondary); padding: 5px 0; }
.cl-plan-list i, .cl-plan-list svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; margin-top: 3px; }
.cl-plan-actions { grid-column: 2; grid-row: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; justify-self: start; }
.cl-plan-actions .btn-start { margin-top: 0; min-height: 48px; padding: 12px 28px; font-size: 14px; white-space: nowrap; }
.cl-link-plain {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color 0.2s ease;
}
.cl-link-plain:hover { color: var(--accent); }

.cl-plan-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cl-plan-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 24px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.cl-plan-rows li:last-child { border-bottom: 0; }
.cl-plan-rows > li > * { min-width: 0; }
.cl-row-text h3 { font-size: 16px; margin-bottom: 4px; }
.cl-row-text p { font-size: 13px; margin: 0; }
.cl-row-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 0; white-space: nowrap; }
.cl-row-price .cl-price-num { font-size: 22px; }
.cl-price-sep { color: var(--text-faded); padding: 0 4px; }
.cl-row-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.cl-row-cta:hover { border-color: var(--accent); color: var(--accent); }

/* 7. Preguntas: details/summary nativos. */
.cl-faq { border-top: 1px solid var(--border); margin-top: 8px; }
.cl-faq details { border-bottom: 1px solid var(--border); }
.cl-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.cl-faq summary::-webkit-details-marker { display: none; }
.cl-faq summary i, .cl-faq summary svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s ease; }
.cl-faq details[open] summary svg { transform: rotate(180deg); }
.cl-faq summary:hover { color: var(--accent); }
.cl-faq summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.cl-faq details p { padding: 0 4px 18px; max-width: 64ch; }

/* 8. CTA final: banda sobria, sin relleno rojo. */
.cl-final {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
}
.cl-final h2 { margin: 0 auto 12px; }
.cl-final p { max-width: 52ch; margin: 0 auto 28px; }
.cl-final .btn-primary { text-decoration: none; min-height: 48px; }

/* Foco en los interactivos que no son a/button/input de arriba. */
.cl-faq summary:focus-visible,
.cl-row-cta:focus-visible,
.cl-link-plain:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Responsive de la landing: después de todo lo que sobrescribe (DS-R32). */
@media (max-width: 900px) {
  .cl-split { grid-template-columns: 1fr; gap: 32px; }
  .cl-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-cell-wide { grid-column: span 2; }
  .cl-plan-featured { grid-template-columns: 1fr; }
  .cl-plan-list { grid-column: 1; }
  .cl-plan-actions { grid-column: 1; grid-row: auto; }
}

@media (max-width: 640px) {
  .cl-hero { padding-top: 120px; }
  .cl-hero::before { width: 140vw; }
  .cl-hero-cta { flex-direction: column; align-items: stretch; }
  .cl-hero-cta .btn-primary, .cl-hero-cta .btn-secondary { justify-content: center; white-space: normal; }
  .cl-hero-stats { flex-direction: column; align-items: center; gap: 10px; }
  .cl-section { padding: 56px 0; }
  .cl-bento { grid-template-columns: 1fr; }
  .cl-cell-wide { grid-column: auto; }
  .cl-leagues li { grid-template-columns: 10px minmax(0, 1fr); gap: 8px 12px; padding: 10px 16px; }
  .cl-league-state { grid-column: 2; justify-self: start; }
  .cl-steps li { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
  .cl-step-num { width: 36px; height: 36px; font-size: 14px; }
  .cl-steps li::before { left: 17px; top: 40px; }
  .cl-plan-featured { padding: 24px 20px; }
  .cl-plan-actions { align-items: stretch; width: 100%; }
  .cl-plan-actions .btn-start { white-space: normal; }
  .cl-plan-rows li { grid-template-columns: 1fr; gap: 10px; padding: 18px 20px; }
  .cl-row-price { white-space: normal; }
  .cl-row-cta { justify-self: start; }
  .cl-faq summary { font-size: 15px; }
  .cl-final { padding: 40px 20px; }
}

/* Feedback táctil (AD-R38): todo control baja 1 px al pulsarse. */
#contenido .btn-primary:active, #contenido .btn-secondary:active,
#contenido .btn-start:active, #contenido .cl-row-cta:active { transform: translateY(1px); }

/* Motivos declarados (AD-G8): jerarquía en la entrada del hero y en el revelado de secciones;
   transición en el skeleton de carga; feedback en los hovers, en el pulsado y en el chevron del FAQ. */
@media (prefers-reduced-motion: reduce) {
  /* AD-G9: nada de movimiento, tampoco el que viene de style.css (scroll suave, hover de botones). */
  html { scroll-behavior: auto; }
  .cl-hero-in { animation: none; opacity: 1; }
  .js .cl-reveal { opacity: 1; transform: none; transition: none; }
  .cl-skel td span { animation: none; }
  #contenido .btn-primary, #contenido .btn-secondary, #contenido .btn-start,
  #contenido .cl-cell, #contenido .cl-faq summary svg, #contenido .cl-row-cta,
  #contenido .cl-link-plain, #contenido a, #contenido summary { transition: none; }
  #contenido .btn-primary:hover, #contenido .btn-secondary:hover,
  #contenido .btn-primary:active, #contenido .btn-secondary:active,
  #contenido .cl-cell:hover { transform: none; }
}
