@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --anac-bg: #f4f1ea;
  --anac-surface: #fffdf8;
  --anac-ink: #1b1f2a;
  --anac-muted: #5c6477;
  --anac-line: #dfd9cb;
  --anac-brand-deep: #0d2a4a;
  --anac-brand-cyan: #2c7da0;
  --anac-brand-teal: #2d8f85;
  --anac-brand-sun: #f59f00;
  --anac-brand-coral: #d94841;
  --anac-shadow: 0 14px 34px rgba(13, 42, 74, 0.12);
  --anac-radius: 20px;
}

* {
  box-sizing: border-box;
}

body.is-anac-radar,
body.is-aerodromos-map {
  background:
    radial-gradient(circle at 50% -10%, rgba(201, 232, 255, 0.1), transparent 22%),
    radial-gradient(circle at top right, rgba(92, 173, 255, 0.18), transparent 26%),
    radial-gradient(circle at left 20%, rgba(25, 98, 179, 0.18), transparent 28%),
    linear-gradient(180deg, #04101b 0%, #071423 45%, #08111d 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
}

.bg-shape--one {
  width: 42rem;
  height: 42rem;
  right: -16rem;
  top: -12rem;
  background: radial-gradient(circle at center, rgba(44, 125, 160, 0.3), rgba(44, 125, 160, 0));
}

.bg-shape--two {
  width: 28rem;
  height: 28rem;
  left: -10rem;
  top: 28rem;
  background: radial-gradient(circle at center, rgba(245, 159, 0, 0.25), rgba(245, 159, 0, 0));
}

.hero {
  font-family: "Sora", "Segoe UI", sans-serif;
  max-width: 1180px;
  margin: 2rem auto 1.5rem;
  padding: clamp(1.3rem, 2.4vw, 2rem);
  border-radius: calc(var(--anac-radius) + 6px);
  background:
    linear-gradient(140deg, rgba(13, 42, 74, 0.95), rgba(20, 76, 121, 0.9)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.04) 12px,
      rgba(255, 255, 255, 0) 12px,
      rgba(255, 255, 255, 0) 24px
    );
  color: #f5f8ff;
  box-shadow: var(--anac-shadow);
}

.is-anac-radar .hero,
.is-aerodromos-map .hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: clamp(1.2rem, 2vw, 1.8rem);
}

.is-anac-radar .hero::before,
.is-aerodromos-map .hero::before {
  content: none;
}

.hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  color: rgba(245, 248, 255, 0.75);
}

.hero h1 {
  margin: 0;
  line-height: 1.05;
  font-size: clamp(1.8rem, 4vw, 3rem);
  max-width: 16ch;
}

.hero__lead {
  margin: 0.85rem 0 0;
  max-width: 72ch;
  color: rgba(245, 248, 255, 0.9);
  line-height: 1.55;
}

.hero__meta {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.hero__meta span {
  font-size: 0.9rem;
  color: rgba(245, 248, 255, 0.84);
}

.hero__cta {
  text-decoration: none;
  color: #0d2a4a;
  background: #ffe7ad;
  border: 1px solid #ffd36b;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  background: #ffd36b;
}

.layout {
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--anac-ink);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0.75rem 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--anac-surface);
  border: 1px solid var(--anac-line);
  border-radius: var(--anac-radius);
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(13, 42, 74, 0.06);
}

.panel__header h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.panel__header p {
  margin: 0.4rem 0 0;
  color: var(--anac-muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.panel__header--split {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(140px, 190px) auto minmax(100px, 140px) auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--anac-muted);
}

.controls select,
.controls input[type="range"],
.controls input[type="text"] {
  width: 100%;
}

.controls select {
  border: 1px solid #c5bbab;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  color: var(--anac-ink);
}

.controls input[type="text"] {
  border: 1px solid #c5bbab;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.42rem 0.55rem;
  font-family: inherit;
  color: var(--anac-ink);
}

.controls output {
  min-width: 2ch;
  font-family: "IBM Plex Mono", monospace;
  color: var(--anac-brand-deep);
  font-weight: 600;
}

.kpi-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
}

.kpi-card {
  border-radius: 14px;
  border: 1px solid #ddd3c2;
  background: linear-gradient(180deg, #fff, #fcf8f0);
  padding: 0.7rem;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card__label {
  color: #6a7284;
  font-size: 0.74rem;
  line-height: 1.35;
}

.kpi-card__value {
  font-weight: 800;
  color: var(--anac-brand-deep);
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  line-height: 1;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel--compact {
  min-height: 100%;
}

.panel--map {
  padding: 0.75rem;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d8cfbd;
  background: #fcf7ec;
  color: #3b4357;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
}

.map-toggle input {
  margin: 0;
}

.map-fit-btn {
  border: 1px solid #7a97b3;
  border-radius: 999px;
  background: #e7f0fb;
  color: #24476a;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.4rem 0.72rem;
  cursor: pointer;
}

.map-fit-btn:hover,
.map-fit-btn:focus-visible {
  background: #cfe3fb;
}

.map-status {
  margin: 0.1rem 0 0.55rem;
  color: #5f6b80;
  font-size: 0.79rem;
}

.map-city-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: transparent;
  border: 0;
  transform: translate(-50%, -50%);
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  pointer-events: none;
}

.map-canvas {
  width: 100%;
  height: clamp(360px, 58vh, 680px);
  border-radius: 14px;
  border: 1px solid #d8d0c0;
  overflow: hidden;
}

.controls--aero {
  grid-template-columns: auto minmax(200px, 260px) auto minmax(90px, 120px) auto minmax(110px, 130px) auto minmax(120px, 150px);
}

.aero-ranking {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.aero-item {
  border: 1px solid #d7cfbe;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffefa, #f9f4ea);
  padding: 0.62rem 0.68rem;
}

.aero-item__head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.aero-item__name {
  margin: 0;
  font-size: 0.9rem;
  color: #1f2b3f;
  font-weight: 700;
}

.aero-item__score {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: #0d2a4a;
  font-weight: 700;
}

.aero-item__meta {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #4b556b;
  line-height: 1.45;
}

.aero-item__btn {
  margin-top: 0.45rem;
  border: 1px solid #c7bba8;
  border-radius: 999px;
  background: #f6ecda;
  color: #553206;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.58rem;
  cursor: pointer;
}

.aero-item__btn:hover,
.aero-item__btn:focus-visible {
  background: #ffe0a4;
}

.bars {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.bars--compact {
  gap: 0.5rem;
}

.filter-strip {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #b7c6d7;
  border-radius: 999px;
  background: #eaf1f8;
  color: #25456a;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
}

.clear-btn {
  border: 1px solid #d2c6b4;
  border-radius: 999px;
  background: #fff6e6;
  color: #734300;
  padding: 0.35rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.clear-btn:hover,
.clear-btn:focus-visible {
  background: #ffe4ad;
}

.clear-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.recorte-info {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: #54607a;
}

.bar-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(160px, 4.8fr) minmax(90px, 1.2fr);
  gap: 0.6rem;
  align-items: center;
  border: 1px solid #ece2d1;
  border-radius: 11px;
  background: #fffefb;
  padding: 0.4rem 0.5rem;
  text-align: left;
  cursor: default;
}

.bars button.bar-row {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.bars button.bar-row:hover {
  background: #f8f2e8;
  border-color: #dcc9ac;
}

.bars button.bar-row.is-selected {
  background: #e8f1fc;
  border-color: #86a8ce;
}

.bar-label {
  font-size: 0.78rem;
  color: #2f3341;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  display: block;
  height: 12px;
  background: #e6dfd2;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(13, 42, 74, 0.08);
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
}

.bar-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-align: right;
  color: #2b3956;
  white-space: nowrap;
}

.insights-list {
  margin: 0.85rem 0 0;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: 0.5rem;
  color: #2f3341;
}

.insights-list li {
  line-height: 1.45;
  font-size: 0.9rem;
}

.file-links {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.file-links a {
  color: #0b4f6c;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-size: 0.86rem;
}

.footer {
  font-family: "Sora", "Segoe UI", sans-serif;
  max-width: 1180px;
  margin: 0 auto 2rem;
  padding: 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: space-between;
  color: #5c6477;
  font-size: 0.82rem;
}

body.is-anac-radar .bg-shape,
body.is-aerodromos-map .bg-shape {
  display: none;
}

.empty-state {
  border-radius: 12px;
  border: 1px dashed #cabfae;
  background: #fbf9f4;
  color: #6a7284;
  padding: 0.9rem;
  font-size: 0.9rem;
}

select:focus-visible,
input[type="range"]:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid #0d2a4a;
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .panel__header--split {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    grid-template-columns: auto minmax(130px, 1fr) auto minmax(120px, 1fr) auto;
  }

  .controls--aero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-canvas {
    height: clamp(320px, 50vh, 520px);
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 0 0.45rem 1.5rem;
    gap: 0.7rem;
  }

  .hero {
    margin: 0.7rem auto 0.8rem;
    padding: 1rem;
  }

  .hero__lead {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    border-radius: 14px;
    padding: 0.82rem;
  }

  .controls--aero {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .controls label {
    font-size: 0.76rem;
    margin-top: 0.2rem;
  }

  .map-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .map-toggle {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.72rem;
  }

  .map-fit-btn {
    width: 100%;
    padding: 0.52rem 0.7rem;
  }

  .map-canvas {
    height: min(56vh, 440px);
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .bar-label,
  .bar-value {
    text-align: left;
  }

  .bar-value {
    margin-top: -1px;
  }

  .aero-item__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .aero-item__name {
    font-size: 0.88rem;
  }

  .aero-item__meta {
    font-size: 0.76rem;
  }
}
