/* Tutoriales SIFASTER — misma paleta que el sistema (styles.css de SIFASTER). */
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fuentes/Inter-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fuentes/Inter-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("fuentes/Inter-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("fuentes/Montserrat-800-latin.woff2") format("woff2"); }

:root {
  --bg: #f8faf9;
  --panel: #ffffff;
  --panel-2: #f3f6f5;
  --line: #e7ece9;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #0f8f67;
  --brand-2: #0b6e50;
  --brand-soft: #eaf7f1;
  --mark: #fff1b8;
  --wa: #1fa855;
  --sombra: 0 1px 2px rgba(16, 24, 20, .05), 0 8px 24px -12px rgba(16, 24, 20, .18);
  --radio: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513;
    --panel: #161e1b;
    --panel-2: #1c2622;
    --line: #26332e;
    --text: #e6ece9;
    --muted: #94a39c;
    --brand: #25b386;
    --brand-2: #4cc79e;
    --brand-soft: #143128;
    --mark: #5c4d12;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img, video { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2 { line-height: 1.2; margin: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

.saltar { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.saltar:focus { left: 16px; }

/* Cabecera */
.cabecera { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.cabecera-in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.marca img { border-radius: 10px; }
.marca b { display: block; font: 800 22px/1 "Montserrat", sans-serif; letter-spacing: -.02em; }
.marca em { font-style: normal; color: var(--brand); }
.marca small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.avance { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 130px; }
.avance-txt { font-size: 13px; color: var(--muted); font-weight: 600; }
.avance-barra { width: 130px; height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.avance-barra i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .4s; }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }

/* Héroe y buscador */
.heroe { text-align: center; padding: 44px 0 22px; }
.heroe h1 { font: 800 clamp(26px, 4.6vw, 40px)/1.15 "Montserrat", sans-serif; letter-spacing: -.02em; }
.heroe-sub { color: var(--muted); margin: 10px auto 22px; max-width: 560px; }
.buscador { position: relative; max-width: 680px; margin: 0 auto; }
.buscador .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; }
.buscador input {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  padding: 16px 56px 16px 52px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel);
  box-shadow: var(--sombra); transition: border-color .2s, box-shadow .2s;
}
.buscador input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), var(--sombra); }
.buscador input::-webkit-search-cancel-button { cursor: pointer; }
.atajo { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 600 12px/1 "Inter", sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: var(--panel-2); }
.buscador input:not(:placeholder-shown) ~ .atajo { display: none; }
.sugerencias { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.sugerencias button { font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; cursor: pointer; }
.sugerencias button:hover { border-color: var(--brand); color: var(--brand); }

/* Temas */
.temas { display: flex; gap: 8px; overflow-x: auto; padding: 18px 2px 6px; scrollbar-width: thin; }
.temas button {
  flex: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.temas button .ico { width: 17px; height: 17px; }
.temas button:hover { color: var(--text); background: var(--panel); }
.temas button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.temas .n { font-size: 12px; opacity: .75; }
.conteo { color: var(--muted); font-size: 14px; margin: 10px 2px 6px; min-height: 21px; }

/* Secciones y tarjetas */
.seccion { margin-top: 26px; }
.seccion-cab { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.seccion-cab h2 { font-size: 20px; }
.seccion-cab span { color: var(--muted); font-size: 14px; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tarjeta {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra);
  transition: transform .18s, border-color .18s;
}
.tarjeta:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.mini { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(10, 14, 12, .82); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 6px; }
.mini .visto { position: absolute; left: 8px; top: 8px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px 3px 6px; border-radius: 99px; display: inline-flex; gap: 4px; align-items: center; }
.mini .visto .ico { width: 14px; height: 14px; stroke-width: 3; }
.mini .seguir { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .35); }
.mini .seguir i { display: block; height: 100%; background: var(--brand); }
.mini .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .18s; background: rgba(10, 14, 12, .25); }
.mini .play span { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .95); display: grid; place-items: center; color: var(--brand); }
.mini .play svg { width: 24px; height: 24px; fill: currentColor; stroke: none; margin-left: 3px; }
.tarjeta:hover .play, .tarjeta:focus-visible .play { opacity: 1; }
.tarjeta-txt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.tarjeta-num { font-size: 12px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.tarjeta-tit { font-size: 16px; font-weight: 700; line-height: 1.3; }
.tarjeta-pasos { font-size: 13px; color: var(--muted); }

/* Resultados de búsqueda */
.hits { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.hit { display: grid; grid-template-columns: 200px 1fr; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radio); padding: 12px; box-shadow: var(--sombra); }
.hit .mini { border-radius: 10px; overflow: hidden; }
.hit h3 { margin: 2px 0 6px; font-size: 17px; }
.hit h3 a { color: var(--text); text-decoration: none; }
.hit h3 a:hover { color: var(--brand); }
.hit-pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hit-pasos a { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.hit-pasos a:hover { background: var(--brand-soft); }
.hit-pasos .t { flex: none; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; min-width: 38px; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.vacio { text-align: center; padding: 36px 16px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radio); }
.vacio b { color: var(--text); }

/* Ayuda extra */
.ayuda-extra { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: var(--radio); padding: 20px 22px; }
.ayuda-extra h2 { font-size: 18px; }
.ayuda-extra p { margin: 4px 0 0; color: var(--muted); }

/* Botones */
.btn { font: inherit; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn-pri { background: var(--brand); color: #fff; }
.btn-pri:hover { background: var(--brand-2); }
.btn-sec { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-sec:hover { border-color: var(--brand); color: var(--brand); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: default; }

/* Reproductor */
.rep-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; flex-wrap: wrap; }
.rep-tema { font-size: 14px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 6px 12px; border-radius: 99px; }
.rep-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.marco { background: #000; border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); aspect-ratio: 16 / 9; }
.marco video { width: 100%; height: 100%; }
.rep-info { padding: 16px 2px 4px; }
.rep-num { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.rep-info h1 { font: 800 clamp(22px, 3vw, 28px)/1.2 "Montserrat", sans-serif; letter-spacing: -.01em; }
.rep-meta { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.rep-acciones { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.rep-acciones #btnSiguiente { margin-left: auto; }
.capitulos { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: auto; }
.capitulos h2 { font-size: 17px; }
.cap-ayuda { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.capitulos ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.capitulos button {
  width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 10px; cursor: pointer; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
}
.capitulos button:hover { background: var(--panel-2); }
.capitulos .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.capitulos .txt b { color: inherit; }
.capitulos .tt { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.capitulos li.hecho .num { border-color: var(--brand); color: var(--brand); }
.capitulos li.actual button { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.capitulos li.actual .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.relacionados { margin-top: 36px; }
.relacionados h2 { font-size: 20px; margin-bottom: 12px; }

.pie { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 36px; }

.aviso-copiado { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 20; }

@media (max-width: 900px) {
  .rep-grid { grid-template-columns: 1fr; }
  .capitulos { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .heroe { padding-top: 28px; }
  .avance { min-width: 0; }
  .avance-barra { width: 90px; }
  .marca small { display: none; }
  .hit { grid-template-columns: 1fr; }
  .rep-acciones .btn span { display: none; }
  .rep-acciones #btnSiguiente span { display: inline; }
  .atajo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
