:root {
  --bg: #f3f5ee;
  --surface: #ffffff;
  --ink: #102017;
  --muted: #4a5e52;
  --brand: #1f5f39;
  --brand-2: #adc66b;
  --line: #d8e2d5;
  --shadow: 0 12px 38px rgba(16, 32, 23, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(173, 198, 107, 0.45), transparent 40%),
    radial-gradient(circle at 92% 85%, rgba(31, 95, 57, 0.18), transparent 35%),
    var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(243, 245, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 6px rgba(173, 198, 107, 0.2);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.main-nav .btn {
  color: #fff !important;
}

.hero {
  padding: 4.2rem 0 3.2rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 380px;
  background: linear-gradient(150deg, rgba(31, 95, 57, 0.16), rgba(173, 198, 107, 0.13));
  transform: rotate(-3deg);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.hero-grid > div:first-child {
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #e7efcf;
  color: #355e2d;
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", Times, serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  margin: 1rem 0;
}

h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 58ch;
}

.hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0.7rem;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.hero-points {
  padding-left: 0;
  margin-top: 1rem;
  list-style-position: inside;
  text-align: center;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.1rem;
  justify-content: center;
}

.cta-actions-centered {
  justify-content: center;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(130deg, var(--brand), #163f28);
  color: #fff;
  padding: 0.8rem 1.1rem;
  font-weight: 700;
  gap: 0.5rem;
}

.btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: #2b573f;
  color: #1f5f39;
}

.btn-small {
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
}

.section {
  padding: 4rem 0;
}

.section .container {
  text-align: center;
}

.section .hero-cta {
  justify-content: center;
}

.section-intro {
  margin-top: -0.4rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  box-shadow: 0 8px 20px rgba(16, 32, 23, 0.07);
}

.card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card h3 {
  margin: 0.9rem 0 0.3rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card-image-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  border: 2px dashed #c8d3c6;
  background: repeating-linear-gradient(
    45deg,
    #f6f8f2,
    #f6f8f2 10px,
    #edf2e8 10px,
    #edf2e8 20px
  );
}

.accent {
  background: linear-gradient(180deg, rgba(173, 198, 107, 0.22), rgba(173, 198, 107, 0.08));
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: center;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1.2rem auto 0;
  max-width: 48rem;
}

.checklist li {
  position: relative;
  padding-left: 0;
  margin-bottom: 0.55rem;
}

.checklist li::before {
  content: "- ";
  position: static;
  color: var(--brand);
  font-weight: 700;
}

.image-frame {
  margin: 0;
  padding: 0.7rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.gallery img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: left;
  box-shadow: 0 8px 20px rgba(16, 32, 23, 0.07);
}

.blog-card h3 {
  margin: 0.45rem 0 0.5rem;
  font-size: 1.35rem;
}

.blog-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.blog-card h3 a:hover {
  text-decoration: underline;
}

.blog-card p {
  margin: 0;
  color: var(--muted);
}

.blog-card-read {
  margin-top: 0.7rem;
}

.blog-card-read a {
  color: #1e5237;
  font-weight: 700;
}

.blog-card-image {
  margin: -1.2rem -1.2rem 0.9rem -1.2rem;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.blog-card-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.blog-card-meta {
  margin: 0;
  color: #2c6042;
  font-size: 0.92rem;
  font-weight: 700;
}

.blog-admin-cta {
  margin-top: 1.2rem;
}

.blog-form-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  align-items: start;
}

.municipality-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.municipality-grid .card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.municipality-grid .card h3 a:hover {
  text-decoration: underline;
}

.local-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 0.9rem;
  box-shadow: 0 8px 20px rgba(16, 32, 23, 0.07);
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  font-family: Georgia, "Times New Roman", Times, serif;
}

.stat-card span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.blog-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.blog-form label {
  font-weight: 600;
  color: #20382b;
}

.blog-form input,
.blog-form textarea {
  width: 100%;
  border: 1px solid #b6c8b4;
  background: #fbfdf8;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  font: inherit;
  color: var(--ink);
}

.blog-form input:focus,
.blog-form textarea:focus {
  outline: 2px solid rgba(31, 95, 57, 0.2);
  border-color: #2f6a48;
}

.blog-checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.blog-checkbox input {
  width: auto;
}

.blog-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.blog-feedback {
  margin: 1rem auto 0;
  max-width: 760px;
  text-align: center;
  font-weight: 600;
  color: #1f5f39;
}

.blog-feedback.is-error {
  color: #8f2626;
}

.breadcrumbs {
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: #254f36;
}

.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.article-wrap h1 {
  margin-bottom: 0.7rem;
}

.article-meta {
  margin: 0 0 1.3rem;
  color: #2c6042;
  font-weight: 600;
}

.article-cover {
  margin: 0 0 1.5rem;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-wrap p,
.article-wrap li {
  color: #29382f;
}

.article-wrap ul,
.article-wrap ol {
  padding-left: 1.15rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "- ";
}

.faq details p {
  margin-left: auto;
  margin-right: auto;
  max-width: 65ch;
}

.faq-highlight {
  background: linear-gradient(135deg, rgba(173, 198, 107, 0.18), rgba(31, 95, 57, 0.08));
  border-left: 4px solid var(--brand);
  padding: 0.9rem 1.1rem;
  border-radius: 0 12px 12px 0;
  margin: 0.8rem auto;
  max-width: 65ch;
  text-align: left;
  font-weight: 600;
  color: #1d3a28;
  line-height: 1.55;
}

.compare-table-wrap {
  overflow-x: auto;
  margin: 1.4rem auto;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(16, 32, 23, 0.07);
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  text-align: left;
}

.compare-table thead th {
  background: linear-gradient(130deg, var(--brand), #163f28);
  color: #fff;
  padding: 0.9rem 1rem;
  font-weight: 700;
  border-bottom: 2px solid #143a24;
}

.compare-table thead th:first-child {
  border-radius: var(--radius) 0 0 0;
}

.compare-table thead th:last-child {
  border-radius: 0 var(--radius) 0 0;
}

.compare-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  vertical-align: top;
}

.compare-table tbody tr:nth-child(even) td {
  background: #f7faf3;
}

.compare-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius);
}

.compare-table tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--radius) 0;
}

.compare-table td strong {
  color: var(--brand);
}

.step-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 1.3rem auto;
  max-width: 760px;
  text-align: left;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3.6rem;
  margin-bottom: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(16, 32, 23, 0.05);
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: linear-gradient(130deg, var(--brand), #163f28);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.step-list li strong {
  display: block;
  color: var(--brand);
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
}

.step-list li p {
  margin: 0;
  color: var(--muted);
}

.cta-box {
  border-radius: 22px;
  border: 1px solid #29523c;
  background: linear-gradient(150deg, #1f5f39, #163f28);
  color: #fff;
  text-align: center;
  padding: 2.2rem;
  box-shadow: var(--shadow);
}

.cta-box p {
  color: #e8f2ea;
}

.cta-box .btn {
  background: #ffffff;
  color: #173825;
}

.cta-box .btn-ghost {
  border-color: #dcefe1;
  color: #e8f2ea;
}

.footer {
  padding: 1.7rem 0 2.3rem;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer a {
  color: #254f36;
}

@media (max-width: 900px) {
  .main-nav {
    gap: 0.7rem;
    font-size: 0.95rem;
  }

  .hero-grid,
  .split,
  .cards,
  .blog-grid,
  .local-stats {
    grid-template-columns: 1fr;
  }

  .hero-card {
    transform: none;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 3.2rem 0 2.4rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero-bg {
    height: 300px;
    transform: rotate(-2deg);
  }

  .topbar-inner {
    min-height: 64px;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }

  .lead {
    font-size: 1rem;
  }

  .main-nav a:not(.btn-small) {
    display: none;
  }

  .hero-cta {
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-card,
  .card,
  .image-frame {
    padding: 0.65rem;
  }

  .cta-box {
    padding: 1.4rem;
  }

  .footer-grid {
    justify-content: center;
    text-align: center;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery img {
    margin: 0 auto;
  }

  .blog-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Banner de cookies - Cumplimiento RGPD / LOPDGDD / LSSI-CE
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, 94vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(16, 32, 23, 0.22);
  padding: 1.2rem 1.4rem;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  animation: cookieSlideIn 0.45s ease-out both;
}

@keyframes cookieSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, 40px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.cookie-banner-text {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.cookie-banner-text strong {
  color: var(--brand);
}

.cookie-banner-text a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.cookie-banner .btn {
  padding: 0.65rem 0.95rem;
  font-size: 0.92rem;
  border-radius: 10px;
  white-space: nowrap;
}

.cookie-banner .btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.cookie-banner .btn-ghost:hover {
  background: #e7efcf;
}

.cookie-settings-trigger {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 990;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(16, 32, 23, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brand);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}

.cookie-settings-trigger:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(16, 32, 23, 0.24);
}

.cookie-settings-trigger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 14, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.cookie-modal[hidden] {
  display: none;
}

.cookie-modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  padding: 1.8rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}

.cookie-modal-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cookie-modal-panel header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.cookie-modal-close:hover {
  background: #e7efcf;
  color: var(--ink);
}

.cookie-category {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-top: 0.9rem;
}

.cookie-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-category-row h3 {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cookie-category-row .cookie-required-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #e7efcf;
  color: #2c5a28;
  font-weight: 700;
  margin-left: 0.5rem;
}

.cookie-category p {
  margin: 0.55rem 0 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.cookie-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd9c7;
  border-radius: 999px;
  transition: background-color 0.22s ease;
}

.cookie-switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-switch-slider {
  background-color: var(--brand);
}

.cookie-switch input:checked + .cookie-switch-slider::before {
  transform: translateX(20px);
}

.cookie-switch input:disabled + .cookie-switch-slider {
  background-color: var(--brand);
  opacity: 0.55;
  cursor: not-allowed;
}

.cookie-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.cookie-modal-footer .btn {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    bottom: 0.6rem;
    width: 96vw;
    padding: 1rem;
  }

  .cookie-banner-actions {
    justify-content: stretch;
  }

  .cookie-banner .btn {
    flex: 1;
    justify-content: center;
  }

  .cookie-modal-panel {
    padding: 1.2rem;
    border-radius: 16px;
  }

  .cookie-modal-footer {
    justify-content: stretch;
  }

  .cookie-modal-footer .btn {
    flex: 1;
    justify-content: center;
  }
}
