:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --warn: #fb923c;
  --border: #334155;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #1e293b, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
}

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

/* ---------- Encabezado y menu ---------- */
.encabezado {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, .85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.encabezado .contenedor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 24px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.marca { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; }
.menu a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .95rem;
}
.menu a:hover { color: var(--text); background: rgba(148, 163, 184, .12); }
.menu a[aria-current="page"] { color: var(--accent); background: rgba(56, 189, 248, .12); }

/* ---------- Estructura ---------- */
.contenedor { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; padding: 48px 0 64px; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.4rem; margin: 40px 0 8px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
.intro { color: var(--muted); font-size: 1.1rem; max-width: 62ch; margin: 0 0 28px; }
p { margin: 0 0 14px; }
.migas { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.migas a { color: var(--muted); }

.boton {
  display: inline-block;
  background: var(--accent);
  color: #082f49;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
}
.boton:hover { filter: brightness(1.1); }
.boton.sec { background: transparent; color: var(--text); border: 1px solid #475569; }
.boton[disabled] { opacity: .4; cursor: default; filter: none; }

/* ---------- Tarjetas ---------- */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.tarjeta {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.tarjeta p { margin: 0; color: var(--muted); font-size: .96rem; }
.tarjeta .icono { font-size: 1.8rem; display: block; margin-bottom: 8px; }
a.tarjeta { text-decoration: none; color: inherit; display: block; }
a.tarjeta:hover { border-color: var(--accent); }
.etiqueta {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, .12);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
}

.nota {
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .35);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 24px 0;
  color: var(--text);
}
.nota.alerta { background: rgba(251, 146, 60, .08); border-color: rgba(251, 146, 60, .45); }
.nota strong { color: var(--accent); }
.nota.alerta strong { color: var(--warn); }

/* ---------- Tabla ---------- */
.tabla-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 620px; background: var(--card); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .95rem; }
th { color: var(--accent); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }
td { color: var(--muted); }
td:first-child { color: var(--text); }

/* ---------- Desplegables ---------- */
details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  padding: 0 18px;
}
summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style-position: inside; }
details[open] summary { color: var(--accent); }
details p { color: var(--muted); }

/* ---------- Ciclo de 4 tiempos ---------- */
.ciclo { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: center; margin-top: 24px; }
.ciclo svg { width: 100%; height: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.pasos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pasos button {
  cursor: pointer;
  border: 1px solid #475569;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: .9rem;
}
.pasos button[aria-pressed="true"] { background: var(--accent); color: #082f49; border-color: var(--accent); }
.ciclo .texto h2 { margin-top: 0; }
.ciclo .texto p { color: var(--muted); }
.controles { display: flex; gap: 10px; margin-top: 10px; }

/* ---------- Lista de chequeo ---------- */
.checklist { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 20px; margin-top: 16px; }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.checklist label:last-of-type { border-bottom: 0; }
.checklist input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.progreso { margin: 12px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: .88rem; text-align: center; }

@media (max-width: 640px) {
  main { padding-top: 32px; }
  .ciclo { grid-template-columns: 1fr; }
  .ciclo svg { max-width: 260px; margin: 0 auto; }
}
@media (max-width: 520px) {
  .menu a { padding: 8px 9px; font-size: .9rem; }
}
