@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Playfair+Display:wght@400;700;900&family=Source+Sans+3:wght@400;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Utils */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.text-center { text-align: center; }

/* Warning Banner */
.warning-banner {
  background-color: var(--warning);
  color: var(--text-dark);
  text-align: center;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
  position: relative;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 999;
  border-bottom: 1px solid var(--border-color);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--primary);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-dark);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  font-weight: 700;
}
.btn-accent:hover {
  background-color: var(--secondary);
  color: var(--white);
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background-color: var(--accent);
  width: 0%;
  z-index: 1001;
}

/* Hero Section */
.hero {
  background-color: var(--bg-dark);
  color: var(--white);
  padding: var(--spacing-3xl) 0;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

/* Footer */
footer {
  background-color: var(--bg-dark);
  color: var(--white);
  padding: var(--spacing-3xl) 0 var(--spacing-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xl);
}

.footer-col h4 {
  color: var(--accent);
  font-family: var(--font-text);
  margin-bottom: var(--spacing-md);
}

.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: var(--spacing-sm);
}
.footer-col ul li a {
  color: var(--text-light);
  opacity: 0.8;
}
.footer-col ul li a:hover {
  opacity: 1;
}

/* Layout alternating */
.section-light {
  background-color: var(--bg-light);
  padding: var(--spacing-3xl) 0;
}

.section-white {
  background-color: var(--white);
  padding: var(--spacing-3xl) 0;
}

#progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--secondary); z-index: 9999; width: 0; }
#btn-top { position: fixed; bottom: 2rem; right: 2rem; background: var(--primary); color: #fff; border: none; border-radius: 50%; width: 48px; height: 48px; font-size: 1.25rem; cursor: pointer; opacity: 0; transform: translateY(10px); transition: all 0.3s; z-index: 1000; display: flex; align-items: center; justify-content: center; }
#btn-top.visible { opacity: 1; transform: translateY(0); }
.breadcrumb { padding: 0.75rem 0; font-size: 0.875rem; color: #666; }
.breadcrumb a { color: var(--primary-light); }
.breadcrumb span { margin: 0 0.5rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.card { background: #fff; border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-md); border-left: 4px solid var(--primary); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: 0.5rem; }
.card-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.card a.card-link { display: inline-block; margin-top: 1rem; color: var(--primary-light); font-weight: 700; }
.hero { background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%); color: #fff; padding: 5rem 0 6rem; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: #fff; margin-bottom: 1rem; }
.hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 3rem; }
.stat-box { text-align: center; background: rgba(255,255,255,0.1); border-radius: var(--radius-md); padding: 1.25rem; }
.stat-number { font-size: 2rem; font-weight: 900; font-family: var(--font-mono); color: var(--accent); display: block; }
.stat-label { font-size: 0.85rem; opacity: 0.85; margin-top: 0.25rem; }
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-light); }
.section-dark { background: var(--bg-dark); color: #fff; }
.section-dark h2 { color: var(--accent); }
.section-title { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.5rem; }
.section-subtitle { color: #666; font-size: 1.1rem; margin-bottom: 2.5rem; }
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--primary); color: #fff; padding: 0.75rem 1rem; text-align: left; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
tr:hover td { background: var(--bg-light); }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 700; }
.badge-subsidio { background: #d1fae5; color: #065f46; }
.badge-contribucion { background: #fee2e2; color: #991b1b; }
.faq-section { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-question { width: 100%; text-align: left; padding: 1.25rem 0; background: none; border: none; font-size: 1rem; font-family: var(--font-text); color: var(--text-dark); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--primary); transition: transform 0.3s; flex-shrink: 0; }
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-answer p { padding-bottom: 1.25rem; color: #555; line-height: 1.8; }
.faq-item.open .faq-answer { max-height: 500px; }
.callout { border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-left: 5px solid; }
.callout-info { background: #e0f2fe; border-color: var(--primary-light); }
.callout-warning { background: #fff8ed; border-color: var(--warning); }
.callout-success { background: #dcfce7; border-color: var(--success); }
.callout-danger { background: #fee2e2; border-color: #ef4444; }
.callout strong { display: block; margin-bottom: 0.5rem; }
footer { background: var(--bg-dark); color: rgba(255,255,255,0.75); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; font-family: var(--font-text); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { color: rgba(255,255,255,0.65); font-size: 0.9rem; }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2rem; padding-top: 1.5rem; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
input[type=text], input[type=email], select, textarea { width: 100%; padding: 0.75rem 1rem; border: 2px solid var(--border-color); border-radius: var(--radius-md); font-family: var(--font-text); font-size: 1rem; transition: border-color 0.2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-light); }
input.error, select.error, textarea.error { border-color: #ef4444; }
input.valid, select.valid, textarea.valid { border-color: var(--success); }
.field-error { color: #ef4444; font-size: 0.8rem; margin-top: 0.25rem; }
.btn { display: inline-block; padding: 0.85rem 2rem; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; border: none; font-size: 1rem; font-family: var(--font-text); transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-accent { background: var(--secondary); color: #fff; }
.btn-accent:hover { background: var(--accent); color: var(--text-dark); }
.skip-nav { position: absolute; top: -100px; left: 1rem; background: var(--primary); color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 var(--radius-md) var(--radius-md); z-index: 9999; font-weight: 700; }
.skip-nav:focus { top: 0; }
.article-layout { display: grid; grid-template-columns: 1fr 260px; gap: 3rem; align-items: start; }
.toc-sidebar { position: sticky; top: 100px; background: var(--bg-light); border-radius: var(--radius-md); padding: 1.25rem; border-left: 3px solid var(--primary); }
.toc-sidebar h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); margin-bottom: 1rem; }
.toc-sidebar ul { list-style: none; }
.toc-sidebar li { margin-bottom: 0.5rem; }
.toc-sidebar a { font-size: 0.875rem; color: #555; padding-left: 0.5rem; border-left: 2px solid transparent; display: block; }
.toc-sidebar a:hover, .toc-sidebar a.active { color: var(--primary); border-color: var(--primary); }
.dato-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 2rem 0; }
.dato-card { background: #fff; border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); border-top: 4px solid var(--secondary); }
.dato-number { font-size: 2.5rem; font-family: var(--font-mono); color: var(--primary); font-weight: 900; }
#cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-dark); color: #fff; padding: 1.25rem 1.5rem; z-index: 9999; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
#cookie-banner p { font-size: 0.9rem; margin: 0; flex: 1; min-width: 200px; }
.cookie-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cookie-actions button { padding: 0.5rem 1.25rem; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; font-size: 0.875rem; border: 2px solid; }
#cookie-accept-all { background: var(--success); color: #fff; border-color: var(--success); }
#cookie-accept-required { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: var(--radius-md); }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ciclo-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; text-align: center; margin: 2rem 0; }
.ciclo-step { background: #fff; border-radius: var(--radius-md); padding: 1rem 0.5rem; box-shadow: var(--shadow-sm); position: relative; }
.ciclo-step:not(:last-child)::after { content: '►'; position: absolute; right: -0.6rem; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 0.75rem; z-index: 1; }
.ciclo-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.ciclo-step h4 { font-size: 0.7rem; color: var(--primary); margin: 0; }
header { background: #fff; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
.navbar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--font-title); font-size: 1.15rem; color: var(--primary); font-weight: 700; display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.nav-links { display: flex; list-style: none; gap: 0.25rem; align-items: center; }
.nav-links > li > a { padding: 0.45rem 0.75rem; border-radius: var(--radius-md); font-size: 0.9rem; color: var(--text-dark); font-weight: 600; transition: all 0.2s; display: block; }
.nav-links > li > a:hover { background: var(--bg-light); color: var(--primary); }
.nav-links .btn-accent { background: var(--secondary); color: #fff; border-radius: var(--radius-md); }
.nav-links .btn-accent:hover { background: var(--primary); color: #fff; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: calc(100% + 0.5rem); left: 0; background: #fff; box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 0.5rem; min-width: 220px; z-index: 200; list-style: none; }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 0.5rem 1rem; border-radius: var(--radius-sm); color: var(--text-dark); font-size: 0.9rem; }
.dropdown-menu li a:hover { background: var(--bg-light); color: var(--primary); }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 25px; height: 2px; background: var(--text-dark); border-radius: 2px; transition: all 0.3s; }
.derechos-lista { list-style: none; counter-reset: derechos; }
.derechos-lista li { counter-increment: derechos; padding: 1rem 1rem 1rem 4rem; margin-bottom: 1rem; background: var(--bg-light); border-radius: var(--radius-md); position: relative; border-left: 4px solid var(--primary); }
.derechos-lista li::before { content: counter(derechos); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); background: var(--primary); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.875rem; }
.glosario-entry { padding: 1rem 0; border-bottom: 1px solid var(--border-color); }
.glosario-entry dt { font-weight: 700; color: var(--primary); font-size: 1.05rem; margin-bottom: 0.35rem; }
.glosario-entry dd { color: #555; line-height: 1.7; margin: 0; }
.alpha-index { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.alpha-index a { display: inline-block; width: 36px; height: 36px; background: var(--bg-light); border-radius: var(--radius-sm); text-align: center; line-height: 36px; font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.alpha-index a:hover { background: var(--primary); color: #fff; }
.paso-lista { list-style: none; counter-reset: pasos; }
.paso-lista li { counter-increment: pasos; padding: 1rem 1rem 1rem 4.5rem; margin-bottom: 1.25rem; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); position: relative; }
.paso-lista li::before { content: counter(pasos); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); background: var(--secondary); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.9rem; }