/* =========================
   Reset + variables
========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e6e8f0;
  --text: #121826;
  --muted: #5a6478;

  --primary: #e52d2d;
  --primary-700: #b61b1b;
  --primary-050: #fff1f1;
  --ink: #0b1220;

  --ring: rgba(229, 45, 45, .25);
  --radius: 14px;
  --shadow: 0 10px 28px rgba(13, 22, 44, .10);
  --shadow-soft: 0 6px 18px rgba(13, 22, 44, .08);
}

/* =========================
   Base
========================= */
body{
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 380px at 10% -10%, rgba(229,45,45,.10), transparent 60%),
    radial-gradient(700px 320px at 90% 0%, rgba(31,75,255,.08), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container{
  max-width: 980px;
  margin: clamp(16px, 4vw, 48px) auto;
  padding: 0 16px 48px;
}

.container::before{
  content: "";
  display: block;
  height: 6px;
  border-radius: 999px;
  margin: 18px 0 22px;
  background: linear-gradient(90deg, var(--primary), rgba(229,45,45,.35), rgba(31,75,255,.25));
}

/* =========================
   Título
========================= */
h1{
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  font-weight: 700;
  margin: 10px 0 18px;
  color: var(--ink);
}

h1::after{
  content: "";
  display: block;
  width: 90px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--primary);
}

/* =========================
   Acordeones
========================= */
details{
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin: 14px 0;
  overflow: clip;
  position: relative;
  transition: border-color .2s ease, box-shadow .2s ease;
}

details::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(229,45,45,.25);
  transition: background-color .2s ease, width .2s ease;
}

details:hover{
  border-color: rgba(229,45,45,.35);
  box-shadow: var(--shadow);
}

/* evita el “marco rojo” al hacer click */
details:focus-within{ outline: none; }

summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  transition: background-color .2s ease, color .15s ease;
}

summary::-webkit-details-marker{ display: none; }

summary::before{
  content: "▸";
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(11,18,32,.06);
  color: var(--ink);
  font-size: 1rem;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

details[open]{
  border-color: rgba(229,45,45,.35);
}
details[open]::before{
  background: var(--primary);
  width: 5px;
}
details[open] summary{
  background: rgba(229,45,45,.08);
}
details[open] summary::before{
  transform: rotate(90deg);
  background: var(--primary);
  color: #fff;
}

summary:hover{
  color: var(--primary);
}

/* focus accesible solo con teclado */
summary:focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 12px;
}

/* =========================
   Compatibilidad: summary con link dentro
   (cuando el título del acordeón es un <a>)
========================= */
summary > a{
  color: inherit;
  text-decoration: none;
  background: none;
  padding: 0;
  border-radius: 8px;
}
summary:hover > a{ color: var(--primary); }
summary > a:focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* =========================
   Contenido interno
========================= */
details > ul{
  list-style: none;
  margin: 0;
  padding: 10px 18px 16px 18px;
}

/* cada fila soporta:
   - solo <a>
   - <span> + botones badge
*/
li{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  flex-wrap: wrap;
}

li:hover{
  background: rgba(11,18,32,.03);
}

li span{
  flex: 1;
  min-width: 220px;
  color: var(--ink);
}

/* =========================
   Enlaces (normales)
========================= */
a{
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--primary), var(--primary)) 0 100% / 0% 2px no-repeat;
  transition: color .15s ease, background-size .2s ease;
  border-radius: 8px;
  padding: 2px;
}

a:hover{
  color: var(--primary);
  background-size: 100% 2px;
}

a:focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 8px;
}

/* =========================
   Badges DER / CRL / PEM (nuevo estilo)
========================= */
.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .2px;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .06s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.badge:active{ transform: translateY(1px); }
.badge:focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* DER (azul) */
.badge.der{
  background: rgba(31,75,255,.10);
  color: #1637c9;
  border-color: rgba(31,75,255,.22);
}
.badge.der:hover{
  background: #1f4bff;
  color: #fff;
  border-color: #1f4bff;
  box-shadow: 0 10px 18px rgba(31,75,255,.16);
}

/* CRL (ámbar) */
.badge.crl{
  background: rgba(197,106,0,.12);
  color: #8a4a00;
  border-color: rgba(197,106,0,.22);
}
.badge.crl:hover{
  background: #c56a00;
  color: #fff;
  border-color: #c56a00;
  box-shadow: 0 10px 18px rgba(197,106,0,.16);
}

/* PEM (verde) */
.badge.pem{
  background: rgba(0,143,79,.12);
  color: #006b3c;
  border-color: rgba(0,143,79,.22);
}
.badge.pem:hover{
  background: #008f4f;
  color: #fff;
  border-color: #008f4f;
  box-shadow: 0 10px 18px rgba(0,143,79,.16);
}

/* =========================
   Responsive
========================= */
@media (max-width: 560px){
  summary{ padding: 14px; }
  details > ul{ padding: 10px 14px 14px; }
  li span{ min-width: 0; }
  a{ display: inline-block; }
}
