:root{
  --bg:#0b1b3a;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#111827;
  --brand:#0b4aa2;
  --accent:#f4b400;
  --shadow: 0 18px 45px rgba(0,0,0,.18);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:#f4f6fb;
}

/* Topbar */
.topbar{
  background:linear-gradient(135deg, #0b1b3a, #0b4aa2);
  color:#fff;
  padding:14px 18px;
}
.topbar .wrap{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
}
.brand{font-weight:700; letter-spacing:.2px}
.brand small{display:block; font-weight:500; opacity:.85}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  color:#fff; text-decoration:none;
  background:rgba(255,255,255,.08);
}
.btn:hover{background:rgba(255,255,255,.14)}

/* Layout */
.container{max-width:1100px; margin:26px auto; padding:0 16px;}

.hero{
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(11,74,162,.18), transparent 60%),
    radial-gradient(1000px 400px at 80% 10%, rgba(244,180,0,.12), transparent 55%),
    #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:26px;
  display:grid;
  grid-template-columns: 1.3fr .7fr;
  gap:18px;
}

.hero h1{margin:0 0 8px; font-size:32px}
.hero p{margin:0; color:var(--muted); line-height:1.55}

.badges{margin-top:14px; display:flex; flex-wrap:wrap; gap:10px}
.badge{
  padding:8px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#1f2a44;
  font-size:13px;
  border:1px solid #e5e7eb;
}

.tip{
  margin-top:14px;
  color:#4b5563;
  font-size:14px;
}
code{background:#f3f4f6; padding:2px 6px; border-radius:8px}

.card{
  background:var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:22px;
  margin-top:18px;
}
.card h2{margin:0 0 10px}
.card p{color:#374151; line-height:1.7}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.col-7{grid-column: span 7;}
.col-5{grid-column: span 5;}

.media{
  border-radius: 16px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  background:#fff;
}
.media img{width:100%; height:320px; object-fit:cover; display:block;}

.footer{
  margin:26px 0 40px;
  color:var(--muted);
  text-align:center;
  font-size:13px;
}

/* Quicklinks */
.quicklinks{display:flex; flex-wrap:wrap; gap:10px}
.ql{
  display:inline-flex;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#f3f4f6;
  color:#111827;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
}
.ql:hover{background:#eef2ff}

/* Modal */
.no-scroll{overflow:hidden}
.overlay{
  position:fixed; inset:0;
  background:rgba(15,23,42,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  z-index:9999;
}
.modal{
  width:min(980px, 96vw);
  background:#fff;
  border-radius:18px;
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
}
.modal-head{
  background:linear-gradient(135deg, #0b1b3a, #0b4aa2);
  color:#fff;
  padding:16px 18px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.modal-title{font-size:20px; font-weight:900; line-height:1.2}
.modal-sub{opacity:.9; font-size:13px; margin-top:2px}
.modal-close{
  width:40px; height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.modal-close:hover{background:rgba(255,255,255,.16)}
.modal-body{
  padding:20px 22px;
  max-height:min(70vh, 560px);
  overflow:auto;
}
.modal-foot{
  padding:14px 18px;
  border-top:1px solid #e5e7eb;
  display:flex;
  justify-content:flex-end;
}
.modal-link{
  display:inline-flex;
  padding:10px 12px;
  border-radius:12px;
  background:#0b4aa2;
  color:#fff;
  text-decoration:none;
  font-weight:800;
}
.modal-link:hover{filter:brightness(1.05)}
.muted{color:var(--muted)}

/* Estilo para el contenido cargado */
.modal-body h2{margin:0 0 10px; font-size:24px}
.modal-body p{line-height:1.7; color:#111827}
.modal-body ul, .modal-body ol{line-height:1.8; padding-left:18px}
.modal-body li{margin:6px 0}
.modal-body a{color:#0b4aa2; font-weight:800}

/* Responsive */
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
  .col-7, .col-5{grid-column: span 12;}
  .media img{height:240px;}
}
/* Oculta la página de fondo cuando se abre un modal por hash */
.only-modal #pageContent{
  display:none !important;
}
/* IMPORTANTE: para que hidden funcione aunque .overlay tenga display:flex */
.overlay[hidden]{
  display:none !important;
}