:root {
  --color-primary: #1e40af;
  --color-primary-dark: #1e3a8a;
  --color-primary-light: #3b82f6;
  --color-accent: #f59e0b;
  --color-bg: #f8fafc;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-card: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav a {
  color: rgba(255,255,255,0.9);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.nav a:hover, .nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin: 0 0 2rem;
  opacity: 0.95;
  font-weight: 400;
}

.hero-search {
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  background: transparent;
  color: var(--color-text);
  outline: none;
}

.hero-search button {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease;
}

.hero-search button:hover {
  background: #d97706;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin: 0 0 2.5rem;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--color-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
}

.card-link {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: #eff6ff;
  color: var(--color-primary);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.card-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
  flex: 1;
}

.card-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Category cards with colors */
.card[data-color="blue"] .card-icon { background: #eff6ff; color: #2563eb; }
.card[data-color="amber"] .card-icon { background: #fef3c7; color: #d97706; }
.card[data-color="emerald"] .card-icon { background: #ecfdf5; color: #059669; }
.card[data-color="stone"] .card-icon { background: #f5f5f4; color: #57534e; }
.card[data-color="purple"] .card-icon { background: #f5f3ff; color: #7c3aed; }
.card[data-color="pink"] .card-icon { background: #fdf2f8; color: #db2777; }
.card[data-color="orange"] .card-icon { background: #fff7ed; color: #ea580c; }
.card[data-color="green"] .card-icon { background: #f0fdf4; color: #16a34a; }
.card[data-color="red"] .card-icon { background: #fef2f2; color: #dc2626; }
.card[data-color="indigo"] .card-icon { background: #eef2ff; color: #4f46e5; }

/* Ordenanza list */
.filters-bar {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.filter-select {
  padding: 0.625rem 2rem 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.results-count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.ordenanza-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ordenanza-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.ordenanza-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.ordenanza-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.ordenanza-numero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #eff6ff;
  color: var(--color-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ordenanza-titulo {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.ordenanza-resumen {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.ordenanza-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #f1f5f9;
  color: var(--color-text-muted);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag.tag-primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag.tag-success {
  background: #d1fae5;
  color: #047857;
}

.tag.tag-warning {
  background: #fef3c7;
  color: #92400e;
}

.ordenanza-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary-light);
  background: #eff6ff;
}

.btn-accent {
  background: var(--color-accent);
  color: white;
}

.btn-accent:hover {
  background: #d97706;
  color: white;
}

/* Wizard */
.wizard {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  max-width: 800px;
  margin: 0 auto;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.wizard-progress-step {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.wizard-progress-step.active,
.wizard-progress-step.completed {
  background: var(--color-primary);
}

.wizard-question {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.wizard-hint {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.rubro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.rubro-option {
  padding: 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  background: white;
  transition: all 0.15s ease;
}

.rubro-option:hover {
  border-color: var(--color-primary-light);
  background: #f0f9ff;
}

.rubro-option.selected {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.rubro-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.rubro-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.wizard-result {
  text-align: left;
}

.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  counter-reset: steps;
}

.steps-list li {
  counter-increment: steps;
  padding: 1rem 1rem 1rem 3.5rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  position: relative;
  font-weight: 500;
}

.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Beneficios */
.beneficio-card {
  background: white;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.beneficio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.beneficio-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.beneficio-tipo {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.beneficio-tipo[data-tipo="programa"] { background: #dbeafe; color: #1e40af; }
.beneficio-tipo[data-tipo="exencion"] { background: #d1fae5; color: #047857; }
.beneficio-tipo[data-tipo="financiamiento"] { background: #fef3c7; color: #92400e; }
.beneficio-tipo[data-tipo="asesoramiento"] { background: #fce7f3; color: #be185d; }

.beneficio-titulo {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.beneficio-resumen {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.beneficio-section {
  margin: 1rem 0;
}

.beneficio-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.beneficio-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.beneficio-list li {
  padding: 0.375rem 0 0.375rem 1.5rem;
  position: relative;
  font-size: 0.95rem;
}

.beneficio-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: 700;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: white;
  font-size: 1rem;
  margin: 0 0 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Hero CTA buttons */
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-cta .btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
}

.hero-cta .btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  backdrop-filter: blur(10px);
}

.hero-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.25);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Highlight */
mark {
  background: #fef08a;
  padding: 0 2px;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    width: 100%;
    text-align: left;
  }
  .hero {
    padding: 3rem 1rem 4rem;
  }
  .section {
    padding: 3rem 0;
  }
  .wizard {
    padding: 1.5rem;
  }
  .ordenanza-header {
    flex-direction: column;
  }
}
