/* ================================================================
   RAMALES NATURAL · Reporte de especies invasoras
   Identidad visual compartida con "Camina y Descubre"
   Verde #2d4a35 · Crema #f5ead8 · Lovelo · CanvaSans
   ================================================================ */

:root {
  --verde:         #2d4a35;
  --verde-oscuro:  #22392c;
  --verde-medio:   #3a5c43;
  --verde-suave:   #6b8368;
  --verde-claro:   #a7c0a0;
  --crema:         #f5ead8;
  --crema-suave:   rgba(245, 234, 216, 0.5);
  --borde:         rgba(45, 74, 53, 0.18);
  --bg:            #f5ead8;
  --card:          #fffdf8;
  --seleccion:     rgba(45, 74, 53, 0.07);
  --tierra:        #a8582a;
  --tierra-oscura: #8a481f;
  --text:          #2d4a35;
  --text-muted:    rgba(45, 74, 53, 0.62);
  --error:         #a8342a;
  --radio:         10px;
  --radio-grande:  16px;
  --radius-lg:     var(--radio-grande);
  --radius-md:     var(--radio);
  --radius-sm:     8px;
  --font-titulo:   'Lovelo', sans-serif;
  --font:          'CanvaSans', sans-serif;
  --shadow:        0 2px 14px rgba(45, 74, 53, 0.08);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* ─────────────────────────────────────────────
   FUENTES — idénticas a Camina y Descubre
───────────────────────────────────────────── */
@font-face {
  font-family: 'Lovelo';
  src: url('../fonts/Lovelo Black.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'CanvaSans';
  src: url('../fonts/CanvaSans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'CanvaSans';
  src: url('../fonts/CanvaSans-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'CanvaSans';
  src: url('../fonts/CanvaSans-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: var(--verde-oscuro); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Foco visible accesible en todos los elementos interactivos */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--tierra);
  outline-offset: 2px;
}

/* Los títulos reciben foco por programa (tabindex="-1", para lectores de
   pantalla) al cambiar de pantalla; no son controles interactivos, así
   que no necesitan el anillo de foco visible. */
[tabindex="-1"]:focus { outline: none; }

/* ================================================================
   CABECERA — estilo editorial (fondo verde, etiqueta + título)
   ================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--verde);
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(245, 234, 216, 0.12);
  transition: background-color 0.2s, border-color 0.2s;
}

.app-header__logo-btn {
  display: inline-block;
  flex-shrink: 0;
  background: none; border: none; padding: 0; margin: 0;
  line-height: 0; cursor: pointer; text-decoration: none;
  border-radius: 8px;
}
.app-header__logo-btn:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; }

.app-header__logo { height: 40px; width: auto; flex-shrink: 0; opacity: 0.95; }

.app-header__text { flex: 1; min-width: 0; }

.app-header__text h1 {
  font-family: var(--font-titulo);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--crema);
  line-height: 1.25;
  margin: 0;
}

.app-header__text p {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 234, 216, 0.5);
  margin: 0.25rem 0 0;
}

.app-header__back {
  background: none; border: none; cursor: pointer;
  color: var(--crema); font-size: 1.3rem; line-height: 1;
  padding: 0.4rem 0.5rem; margin-right: -0.2rem; border-radius: 50%;
  opacity: 0.85;
  transition: opacity 0.2s, background-color 0.2s;
}
.app-header__back:hover { opacity: 1; background: rgba(245,234,216,0.1); }

/* Botón de menú (hamburguesa) — pastilla de cristal, siempre visible */
.app-header__menu {
  flex-shrink: 0;
  margin-left: auto;
  width: 38px; height: 38px;
  border: 1px solid rgba(245,234,216,0.28);
  background: rgba(20,26,20,0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.app-header__menu:hover { background: rgba(20,26,20,0.42); }
.app-header__menu span {
  display: block; width: 16px; height: 1.5px;
  background: var(--crema); border-radius: 2px;
}

/* ================================================================
   MENÚ PRINCIPAL (overlay)
   ================================================================ */
.menu-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(20,26,20,0.5);
  display: flex; justify-content: flex-end;
  opacity: 0; transition: opacity 0.2s ease;
}
.menu-overlay[hidden] { display: none; }
.menu-overlay.is-open { opacity: 1; }

.menu-panel {
  width: min(340px, 84vw);
  height: 100%;
  overflow-y: auto;
  background: var(--verde);
  color: var(--crema);
  display: flex; flex-direction: column;
  padding: 1.2rem 1.4rem calc(1.4rem + var(--safe-bottom));
  transform: translateX(16px);
  transition: transform 0.22s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,0.18);
}
.menu-overlay.is-open .menu-panel { transform: translateX(0); }

.menu-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.6rem;
}
.menu-panel__logo { height: 34px; width: auto; }
.menu-close {
  background: none; border: none; color: var(--crema);
  font-size: 1.2rem; cursor: pointer; padding: 0.3rem; opacity: 0.75;
}
.menu-close:hover { opacity: 1; }

.menu-list { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.menu-list li { border-bottom: 1px solid rgba(245,234,216,0.1); }
.menu-list li:first-child { border-top: 1px solid rgba(245,234,216,0.1); }

.menu-link {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%;
  background: none; border: none; cursor: pointer;
  text-align: left; text-decoration: none;
  font-family: var(--font-titulo);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--crema);
  padding: 1rem 0.1rem;
}
.menu-link--disabled {
  color: rgba(245,234,216,0.4);
  cursor: default;
}
.menu-tag {
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,234,216,0.45);
  border: 1px solid rgba(245,234,216,0.25);
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
}

.menu-panel__cta { width: 100%; margin-top: auto; }
.menu-legal {
  margin: 0.9rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.9rem;
}
.menu-legal a {
  color: rgba(245,234,216,0.5);
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.menu-legal a:hover { color: var(--crema); }
.menu-panel__social {
  margin-top: 1rem;
  text-align: center;
  font-family: var(--font);
  font-size: 0.78rem;
  color: rgba(245,234,216,0.6);
}
.menu-panel__social a { color: var(--crema); }

/* Indicador de progreso discreto */
.progress-track {
  height: 3px; background: rgba(245,234,216,0.15);
}
.progress-fill {
  height: 100%; background: var(--tierra);
  transition: width 0.25s ease;
}
.progress-label {
  text-align: center;
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.7rem 0 0;
}
.progress-label:empty { display: none; padding: 0; margin: 0; }

/* ================================================================
   CONTENEDOR / PANTALLAS
   ================================================================ */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.4rem 1.2rem calc(96px + var(--safe-bottom));
}

.screen { display: none; }
.screen.is-active { display: block; animation: fade-in 0.25s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-question {
  font-family: var(--font-titulo);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0.2rem 0 0.4rem;
  line-height: 1.25;
}

.step-hint {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.4rem;
  line-height: 1.6;
}

/* ================================================================
   TARJETAS Y CAMPOS
   ================================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--verde);
  opacity: 0.75;
  margin-bottom: 0.5rem;
}

.label-optional {
  font-weight: 500; color: var(--text-muted); font-size: 0.7rem;
  text-transform: none; letter-spacing: 0.02em; opacity: 1;
}

input[type="text"], input[type="email"], input[type="date"],
select, textarea {
  width: 100%;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.85rem 0.9rem;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(45,74,53,0.1);
  background: #fff;
}

textarea { resize: vertical; min-height: 90px; }

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.error-text {
  font-family: var(--font);
  color: var(--error); font-size: 0.8rem; font-weight: 700;
  margin-top: 0.4rem; display: none;
}
.field.has-error input, .field.has-error select { border-color: var(--error); }
.field.has-error .error-text { display: block; }

/* ================================================================
   SELECCIÓN DE ESPECIE
   ================================================================ */
.species-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.species-btn {
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  cursor: pointer;
  background: var(--card);
  overflow: hidden;
  position: relative;
  text-align: left;
  padding: 0;
  font-family: var(--font);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.1s;
  min-height: 44px;
}

.species-btn:active { transform: scale(0.98); }

.species-btn__photo {
  width: 100%; height: 100px;
  background-size: cover; background-position: center;
  background-color: var(--seleccion);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  filter: saturate(0.9) brightness(0.96);
}

.species-btn__body { padding: 0.6rem 0.7rem 0.7rem; }

.species-btn__name {
  font-family: var(--font);
  font-size: 0.82rem; font-weight: 700; color: var(--verde);
  display: block; line-height: 1.3;
}

.species-btn__sci {
  font-family: var(--font);
  font-size: 0.68rem; color: var(--text-muted); font-style: italic;
  display: block; margin-top: 0.15rem;
}

.species-btn.selected {
  border-color: var(--verde);
  box-shadow: 0 0 0 1.5px var(--verde), var(--shadow);
}

.species-btn__check {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--verde); color: var(--crema);
  display: none; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.species-btn.selected .species-btn__check { display: flex; }

.species-btn--other {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.9rem;
  min-height: unset;
}
.species-btn--other .species-btn__icon { font-size: 1.5rem; }
.species-btn--other .species-btn__body { padding: 0; flex: 1; }
.species-btn--other .species-btn__check { position: static; margin-left: auto; }

.other-help {
  background: var(--seleccion);
  border-left: 2px solid var(--verde);
  border-radius: 0 var(--radio) var(--radio) 0;
  padding: 0.8rem 0.9rem;
  margin-top: 0.8rem;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--verde-medio);
  line-height: 1.55;
}
.other-help strong { color: var(--verde); }

/* ================================================================
   FOTOGRAFÍAS
   ================================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.photo-slot {
  aspect-ratio: 1 / 1;
  border-radius: var(--radio);
  border: 1.5px dashed var(--verde-claro);
  background: var(--card);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.photo-slot input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}

.photo-slot__icon { font-size: 1.35rem; color: var(--verde-suave); }

.photo-slot.has-photo {
  border-style: solid; border-color: var(--borde);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) brightness(0.96); }

.photo-slot__remove {
  position: absolute; top: 0.3rem; right: 0.3rem;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(34,57,44,0.85); color: var(--crema);
  border: none; font-size: 0.85rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.tip {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--seleccion);
  border-left: 2px solid var(--verde);
  border-radius: 0 var(--radio) var(--radio) 0;
  padding: 0.8rem 0.9rem;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--verde-medio);
  line-height: 1.55;
}
.tip__icon { flex-shrink: 0; }

/* ================================================================
   UBICACIÓN
   ================================================================ */
.loc-open-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 1rem;
  border: 1.5px solid var(--borde); border-radius: var(--radio);
  background: var(--card); cursor: pointer;
  font-size: 1rem; font-family: var(--font);
  color: var(--verde); font-weight: 700;
  box-shadow: var(--shadow);
}
.loc-open-btn:hover { border-color: var(--verde); }

.loc-status {
  font-family: var(--font);
  font-size: 0.85rem; margin-top: 0.6rem; color: var(--text-muted); min-height: 18px;
}
.loc-status.ok  { color: var(--verde); font-weight: 700; }
.loc-status.err { color: var(--error); font-weight: 600; }

#map-modal {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20,26,20,0.62);
  align-items: center; justify-content: center;
  padding: 0;
}
#map-modal.open { display: flex; }

#map-modal-inner {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  background: var(--card);
}

@media (min-width: 560px) {
  #map-modal { padding: 1.25rem; }
  #map-modal-inner {
    max-width: 520px; height: min(90vh, 620px);
    border-radius: var(--radio-grande); overflow: hidden;
  }
}

#map-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: var(--verde);
  color: var(--crema);
  font-family: var(--font);
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
#map-modal-close {
  background: none; border: none; color: var(--crema);
  font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0.25rem 0.4rem;
}

#map { flex: 1; min-height: 0; }

#map-modal-footer {
  padding: 0.75rem 1rem calc(1rem + var(--safe-bottom));
  background: var(--bg);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 0.6rem;
  box-shadow: 0 -2px 10px rgba(45,74,53,0.1);
}

#map-hint {
  font-family: var(--font);
  font-size: 0.85rem; color: var(--text-muted);
  text-align: center; line-height: 1.4;
}
#map-hint.ok  { color: var(--verde); font-weight: 700; }
#map-hint.err { color: var(--error); font-weight: 600; }

/* Marcador y popup del mapa — estilo editorial */
.leaflet-popup-content-wrapper {
  background-color: var(--verde) !important;
  color: var(--crema) !important;
  font-family: var(--font);
  border-radius: var(--radio) !important;
}
.leaflet-popup-tip { background-color: var(--verde) !important; }

/* ================================================================
   OPCIONES VISUALES GRANDES (cantidad)
   ================================================================ */
.option-grid {
  display: grid;
  gap: 0.65rem;
}

.option-card {
  display: flex; align-items: center; gap: 0.9rem;
  border: 1.5px solid var(--borde); border-radius: var(--radio);
  background: var(--card);
  padding: 0.9rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  box-shadow: var(--shadow);
  width: 100%;
  transition: border-color 0.15s, background-color 0.15s;
}

.option-card__icon { font-size: 1.5rem; flex-shrink: 0; }
.option-card__title { font-size: 0.92rem; font-weight: 700; color: var(--verde); display: block; }
.option-card__sub { font-size: 0.78rem; color: var(--text-muted); display: block; margin-top: 0.1rem; }

.option-card.selected {
  border-color: var(--verde);
  background: var(--seleccion);
}

/* ================================================================
   BOTONES DE NAVEGACIÓN DEL ASISTENTE
   ================================================================ */
.wizard-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, var(--bg) 65%, rgba(245,234,216,0));
  padding: 1.1rem 1.2rem calc(1.1rem + var(--safe-bottom));
  z-index: 50;
}

.wizard-nav__inner {
  max-width: 640px; margin: 0 auto;
  display: flex; gap: 0.6rem;
}

.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 30px;
  padding: 0.95rem 1.3rem;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  min-height: 52px;
  box-sizing: border-box;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  flex: 1;
  background: var(--verde);
  color: var(--crema);
  border: 1px solid rgba(245,234,216,0.15);
}
.btn-primary:hover { background: var(--verde-medio); }
.btn-primary:disabled { background: var(--verde-claro); border-color: transparent; cursor: not-allowed; }

.btn-secondary {
  background: var(--card);
  color: var(--verde);
  border: 1.5px solid var(--borde);
}

.btn-ghost {
  background: none;
  color: var(--verde);
  text-decoration: underline;
  padding: 0.95rem 0.6rem;
}

.btn-accent {
  background: var(--tierra);
  color: var(--crema);
}
.btn-accent:hover { background: var(--tierra-oscura); }

/* ================================================================
   PORTADA — foto a sangre + cuerpo editorial + tarjeta CTA
   ================================================================ */
.home {
  text-align: center;
  padding: 0 0 0.6rem;
  margin: -1.4rem -1.2rem 0;
}

.home-hero {
  position: relative;
  z-index: 1;
  height: clamp(320px, 56vh, 480px);
  overflow: hidden;
  margin-top: -74px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 2.75rem;
}
.home-hero__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.9);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 88%, transparent 100%);
}
.home-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(20,26,20,0.32) 0%,
    rgba(20,26,20,0.05) 20%,
    rgba(20,26,20,0.05) 36%,
    rgba(20,26,20,0.5) 58%,
    rgba(20,26,20,0.55) 88%,
    transparent 100%);
}

/* Texto del hero, superpuesto sobre la fotografía (no debajo de ella) */
.home-hero__text {
  position: relative;
  z-index: 1;
  padding: 0 1.2rem;
}
.home .home-hero__text h1 {
  color: var(--crema);
}
.home .home-hero__text p {
  color: rgba(245,234,216,0.92);
}
.home-hero__text .home__label {
  color: var(--crema);
  opacity: 0.8;
}

.home-body { padding: 0.6rem 1.2rem 0; position: relative; z-index: 1; }

.home__art { display: none; }

.home h1 {
  font-family: var(--font-titulo);
  font-size: 1.55rem; font-weight: 400; letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0 0 0.7rem; line-height: 1.28;
}

.home p {
  font-family: var(--font);
  font-size: 1rem; color: var(--text-muted); line-height: 1.65;
  max-width: 440px; margin: 0 auto 0.9rem;
}

.home__secondary {
  margin-top: 1.75rem;
}
.home__secondary a {
  font-size: 0.85rem; color: var(--text-muted); text-decoration: underline;
}

/* Etiqueta editorial "RAMALES NATURAL · INVASORAS" sobre el título de portada */
.home__label {
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--verde);
  opacity: 0.5;
  margin: 0 0 0.9rem;
}

/* Cabecera transparente superpuesta a la foto de portada.
   body.pagina-inicio se pone solo en index.html (ver esa página). */
body.pagina-inicio .app-header {
  background: rgba(20,26,20,0.3);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border-bottom: none;
}
body.pagina-inicio .app-header__text { display: none; }
body.pagina-inicio .app-header__menu {
  background: rgba(245,234,216,0.16);
}
/* El padding inferior de .container reserva sitio para la barra fija
   del asistente (wizard-nav), que no existe en la portada — sin este
   ajuste queda un hueco grande entre la silueta y el pie de página.
   .home también añade su propio padding inferior, así que hay que
   quitar los dos para que la silueta quede pegada al pie. */
body.pagina-inicio .container {
  padding-bottom: 0;
}
body.pagina-inicio .home {
  padding-bottom: 0;
}

/* Contenedor de las dos tarjetas principales */
.home-cards { display: flex; flex-direction: column; }

/* Tarjeta principal "¿Qué planta es?" — identificación por foto.
   La proporción de captura.svg manda: la imagen se muestra a su tamaño
   natural (sin recortarla ni encogerla para que quepa texto) y el
   contenido de la derecha se simplifica y ajusta al hueco resultante,
   fundiéndose con degradado en vez de una línea vertical. */
.id-card {
  margin: 0.4rem 0 0.7rem;
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  text-align: left;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.id-card__visual {
  position: relative;
  flex: 0 0 46%;
  overflow: hidden;
}
.id-card__captura {
  display: block;
  width: 100%;
  height: auto;
}
.id-card__visual-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to right, transparent 45%, var(--card) 96%);
}
.id-card__contenido {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 0.9rem 1rem 0.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.id-card__eyebrow {
  font-family: var(--font-titulo);
  font-size: 1.1rem; font-weight: 400; letter-spacing: 0.01em;
  color: var(--verde);
  line-height: 1.15;
  margin: 0 0 0.55rem;
}
.id-card__ventajas {
  display: flex;
  gap: 0.2rem;
  margin: 0 0 0.7rem;
}
.id-card__ventaja {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  text-align: center;
}
.id-card__ventaja-icono { width: 18px; height: 18px; flex-shrink: 0; }
.id-card__ventaja span:last-child {
  font-family: var(--font);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--verde-medio);
  line-height: 1.15;
}
.id-card__btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  padding: 0.6rem 0.7rem;
  font-size: 0.82rem;
  min-height: auto;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}
.id-card__btn-icono { width: 15px; height: 15px; flex-shrink: 0; }
.id-card .id-card__nota {
  margin: 0;
  text-align: center;
  font-family: var(--font);
  font-size: 0.58rem;
  color: var(--verde-suave);
  font-weight: 700;
  max-width: none;
}

/* Tarjeta secundaria "¿Ya sabes qué es?" — reporte directo */
.report-card {
  margin: 0 0 0.9rem;
  padding: 1.3rem 1.3rem 1.4rem;
  background: var(--seleccion);
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  text-align: left;
}
.report-card__eyebrow {
  font-family: var(--font-titulo);
  font-size: 1.05rem; font-weight: 400;
  color: var(--verde);
  margin: 0 0 0.4rem;
}
.report-card__texto {
  font-family: var(--font);
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.5;
  max-width: none;
  margin: 0 0 1rem;
}
.report-card__btn { width: 100%; display: block; }

/* Enlaces secundarios de portada — fila compacta de 3 accesos */
.home-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0 0 1rem;
}
.home-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio-grande);
  padding: 0.75rem 0.4rem;
  cursor: pointer; text-decoration: none;
  font-family: var(--font);
  text-align: center;
}
.home-link__icon { font-size: 1.2rem; }
.home-link__titulo {
  font-family: var(--font-titulo);
  font-size: 0.7rem; font-weight: 400; letter-spacing: 0.01em;
  color: var(--verde);
  line-height: 1.25;
}
.home-link__titulo .menu-tag {
  display: block;
  margin: 0.3rem auto 0;
  width: fit-content;
  font-size: 0.5rem;
  padding: 0.1rem 0.4rem;
}
.home-link__texto {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  /* Visible también en móvil (antes solo se veía a partir de 640px):
     esta regla, al ir después de .visually-hidden en la hoja de
     estilos, gana el empate de especificidad y anula su ocultación. */
  position: static; width: auto; height: auto; padding: 0; margin: 0;
  overflow: visible; clip: auto; white-space: normal;
}
.home-link--disabled {
  cursor: default;
  opacity: 0.65;
}
.home-link--disabled .home-link__titulo .menu-tag {
  color: var(--tierra);
  border-color: rgba(168,88,42,0.35);
}

@media (min-width: 640px) {
  .home-link { padding: 1rem 0.8rem; }
  .home-link__icon { font-size: 1.5rem; }
  .home-link__titulo { font-size: 0.85rem; }
}

/* Silueta decorativa de montañas al pie de la portada */
.home-silueta {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: cover;
  object-position: bottom;
  margin-top: -0.6rem;
}

/* ================================================================
   PÁGINAS DE CONTENIDO (Sobre el proyecto / Especies / Cómo reportar)
   ================================================================ */
.content-page { padding-top: 0.3rem; }

.content-label {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--verde);
  opacity: 0.5;
  margin: 0 0 0.5rem;
}

.content-titulo {
  font-family: var(--font-titulo);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  line-height: 1.2;
  margin: 0 0 0.9rem;
}

.content-lead {
  font-family: var(--font);
  font-size: 0.96rem;
  line-height: 1.68;
  color: var(--text);
  margin: 0 0 1.6rem;
}

.content-photo {
  border-radius: var(--radio-grande);
  overflow: hidden;
  margin-bottom: 1.6rem;
  aspect-ratio: 4 / 3;
}
.content-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9) brightness(0.94);
}

.content-block { margin-bottom: 1.6rem; }
.content-block h2 {
  font-family: var(--font-titulo);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0 0 0.6rem;
}
.content-block p {
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--text-muted);
  margin: 0;
}

.content-highlight {
  text-align: center;
  padding: 1.8rem 1rem;
  margin: 0.4rem 0 0.6rem;
  border-top: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
}
.content-highlight__leaf {
  display: inline-flex; width: 30px; height: 30px;
  color: var(--verde); opacity: 0.7;
  margin-bottom: 0.7rem;
}
.content-highlight__leaf svg { width: 100%; height: 100%; }
.content-highlight__text {
  font-family: var(--font-titulo);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  line-height: 1.35;
  margin: 0;
}

/* Silueta de montañas — decoración de cierre de pantalla */
.paisaje-montanas {
  width: calc(100% + 2.4rem);
  margin: 1.6rem -1.2rem -1.4rem;
  height: 96px;
  overflow: hidden;
}
.paisaje-montanas svg { width: 100%; height: 100%; display: block; }

/* ================================================================
   CATÁLOGO DE ESPECIES INVASORAS (CEEEI · MITECO)
   ================================================================ */

/* ── Buscador ── */
.catalogo-buscador {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card);
  border: 1.5px solid var(--borde);
  border-radius: 30px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.catalogo-buscador__icon { font-size: 1rem; flex-shrink: 0; opacity: 0.7; }
.catalogo-buscador input {
  border: none; background: none; padding: 0; width: 100%;
  font-family: var(--font); font-size: 0.95rem; color: var(--text);
}
.catalogo-buscador input:focus { outline: none; box-shadow: none; background: none; }

/* ── Secciones ── */
.catalogo-seccion { margin-bottom: 2.2rem; }
.catalogo-seccion__titulo {
  font-family: var(--font-titulo);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0 0 1rem;
}
.catalogo-fuente {
  font-family: var(--font);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: -0.4rem 0 0.9rem;
}
.catalogo-fuente a { color: var(--verde); }
.catalogo-resultados {
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--verde);
  opacity: 0.55;
  margin: 0 0 0.8rem;
}
.catalogo-vacio {
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}
.catalogo-cargar-mas { width: 100%; max-width: 320px; margin: 0.4rem auto 0; }
.catalogo-cargar-mas:not([hidden]) { display: block; }

/* ── Filtros ── */
.catalogo-filtros {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 2.2rem;
}
.catalogo-filtro {
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--verde);
  background: var(--card);
  border: 1.5px solid var(--borde);
  border-radius: 20px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
}
.catalogo-filtro.is-active { background: var(--verde); color: var(--crema); border-color: var(--verde); }

/* ── Tarjetas de especie ── */
.catalogo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.especie-card {
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.1s;
}
.especie-card:active { transform: scale(0.98); }

.especie-card__foto {
  width: 100%; height: 108px;
  background-size: cover; background-position: center;
  filter: saturate(0.9) brightness(0.96);
  flex-shrink: 0;
}
.especie-card__foto--neutra,
.especie-card--neutra .especie-card__foto {
  background-color: var(--seleccion);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  filter: none;
}

.especie-card__cuerpo {
  padding: 0.65rem 0.75rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  flex: 1;
}
.especie-card__comun {
  font-size: 0.85rem; font-weight: 700; color: var(--verde);
  line-height: 1.25;
}
.especie-card__cientifico {
  font-size: 0.72rem; font-style: italic; color: var(--text-muted);
}
.especie-card__badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  width: fit-content;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  color: #a8342a; background: rgba(168,52,42,0.12);
  padding: 0.15rem 0.5rem; border-radius: 20px;
  margin-top: 0.25rem;
}

/* ================================================================
   FICHA DE ESPECIE (overlay)
   ================================================================ */
.ficha-overlay {
  position: fixed; inset: 0; z-index: 9997;
  background: rgba(20,26,20,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.ficha-overlay[hidden] { display: none; }
.ficha-overlay.is-open { opacity: 1; }

.ficha-panel {
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.22s ease;
}
.ficha-overlay.is-open .ficha-panel { transform: translateY(0); }

@media (min-width: 640px) {
  .ficha-overlay { align-items: center; padding: 1.5rem; }
  .ficha-panel { max-width: 460px; border-radius: 20px; max-height: 85vh; }
}

.ficha-cerrar {
  position: absolute; top: 0.7rem; right: 0.7rem; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(34,57,44,0.65); color: var(--crema);
  border: none; cursor: pointer; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── Carrusel de fotografías ── */
.ficha-carrusel {
  width: 100%; height: 240px;
  background: var(--seleccion);
  overflow: hidden;
  position: relative;
}
.ficha-carrusel__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  cursor: zoom-in;
}
.ficha-carrusel__flecha {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(20,26,20,0.55); color: #fff;
  border: none; cursor: pointer; font-size: 1rem;
  align-items: center; justify-content: center;
}
.ficha-carrusel__flecha:not([hidden]) { display: flex; }
.ficha-carrusel__flecha--prev { left: 0.6rem; }
.ficha-carrusel__flecha--next { right: 0.6rem; }
.ficha-carrusel__flecha:hover { background: rgba(20,26,20,0.75); }
.ficha-carrusel__contador {
  position: absolute; top: 0.6rem; right: 0.7rem;
  background: rgba(20,26,20,0.55); color: #fff;
  font-family: var(--font); font-size: 0.68rem; font-weight: 700;
  padding: 0.2rem 0.55rem; border-radius: 20px;
}
.ficha-carrusel__credito {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(20,26,20,0.75), transparent);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 0.62rem;
  line-height: 1.4;
  padding: 1.1rem 0.7rem 0.4rem;
  text-decoration: none;
}
.ficha-carrusel__credito:hover { color: #fff; text-decoration: underline; }

/* ── Miniaturas de la galería (debajo de la foto principal) ── */
.ficha-miniaturas {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.6rem 1.1rem;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ficha-miniaturas::-webkit-scrollbar { display: none; }
.ficha-miniaturas[hidden] { display: none; }
.ficha-miniatura-btn {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 8px;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}
.ficha-miniatura-btn.is-activa {
  opacity: 1;
  border-color: var(--verde);
}

.ficha-cuerpo { padding: 1.4rem 1.4rem calc(1.6rem + var(--safe-bottom)); }

.ficha-comun {
  font-family: var(--font-titulo);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0 0 0.2rem;
}
.ficha-cientifico {
  font-family: var(--font);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.ficha-estatus:not([hidden]) {
  display: inline-block;
}
.ficha-estatus {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin: 0 0 0.9rem;
}
.ficha-estatus--invasora { background: rgba(168,52,42,0.12); color: #a8342a; }
.ficha-estatus--autoctona { background: rgba(45,106,45,0.12); color: #2d6a2d; }
.ficha-estatus--exotica { background: rgba(180,140,30,0.14); color: #8a6a10; }

/* ── Secciones de la ficha (Cómo reconocerla, Características...) ──
   Como ahora hay más secciones opcionales y varían según la especie,
   el borde superior se aplica solo a partir de la segunda sección
   REALMENTE visible (no de la primera del DOM, que puede estar oculta
   por falta de datos) mediante el combinador de hermanos generales. */
.ficha-seccion {
  padding: 0;
}
.ficha-seccion:not([hidden]) ~ .ficha-seccion:not([hidden]) {
  padding: 0.9rem 0;
  border-top: 1px solid var(--borde);
}
.ficha-seccion h3 {
  font-family: var(--font-titulo);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0 0 0.5rem;
}
.ficha-seccion p {
  font-family: var(--font);
  font-size: 0.87rem;
  line-height: 1.62;
  color: var(--text);
  margin: 0;
}
.ficha-caracteristicas {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.ficha-caracteristicas li {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
}
.ficha-caracteristicas strong { color: var(--verde); }

.ficha-fuentes {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.ficha-fuentes li {
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.ficha-fuentes a { color: var(--verde); }

.ficha-acciones {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin-top: 1.4rem;
}
.ficha-acciones .btn { width: 100%; text-align: center; text-decoration: none; }

/* ── Zoom de fotografía ── */
.zoom-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,14,10,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
  opacity: 0; transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.zoom-overlay[hidden] { display: none; }
.zoom-overlay.is-open { opacity: 1; }
.zoom-overlay__img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ================================================================
   IDENTIFICAR PLANTA (Pl@ntNet)
   ================================================================ */
.identificar-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(20,26,20,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.identificar-overlay[hidden] { display: none; }
.identificar-overlay.is-open { opacity: 1; }

.identificar-panel {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  position: relative;
  padding: 1.6rem 1.4rem calc(1.8rem + var(--safe-bottom));
  text-align: center;
  transform: translateY(16px);
  transition: transform 0.22s ease;
}
.identificar-overlay.is-open .identificar-panel { transform: translateY(0); }

@media (min-width: 640px) {
  .identificar-overlay { align-items: center; padding: 1.5rem; }
  .identificar-panel { max-width: 480px; border-radius: 20px; max-height: 88vh; }
}

/* En identificar.html la identificación ya no es un modal flotante sobre
   otra pantalla: es el contenido normal de la página. Se reutiliza el
   mismo HTML/JS (identificar.js no cambia), solo se anula aquí el
   envoltorio de modal (fijo, con fondo oscuro) para que se vea como una
   sección más de la página. */
.identificar-overlay--pagina {
  position: static;
  inset: auto;
  z-index: auto;
  background: none;
  opacity: 1;
  display: block;
  padding: 0;
}
.identificar-overlay--pagina .identificar-panel {
  width: auto;
  max-width: none;
  max-height: none;
  overflow: visible;
  background: none;
  border-radius: 0;
  padding: 0;
  transform: none;
}
.identificar-overlay--pagina .ficha-cerrar { display: none; }

.identificar-estado h2 {
  font-family: var(--font-titulo);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--verde);
  margin: 0.3rem 0 0.6rem;
}
.identificar-estado > p {
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1.2rem;
}
.identificar-icono { font-size: 2.2rem; }

.identificar-input-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-bottom: 0.7rem;
  cursor: pointer;
  position: relative;
}
.identificar-input-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.identificar-credito {
  margin-top: 1rem !important;
  font-size: 0.7rem !important;
}
.identificar-credito a { color: var(--verde); }

.identificar-error-tecnico {
  margin-top: 0.8rem !important;
  font-size: 0.68rem !important;
  color: var(--text-muted);
  opacity: 0.7;
  word-break: break-word;
}

.identificar-miniaturas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.identificar-miniatura {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radio-sm, 8px);
  overflow: hidden;
  border: 1px solid var(--borde);
}
.identificar-miniatura img { width: 100%; height: 100%; object-fit: cover; }
.identificar-miniatura__quitar {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20,26,20,0.7); color: #fff;
  border: none; font-size: 0.7rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.identificar-btn-analizar {
  width: 100%; margin: 0.3rem 0 0.9rem;
}
.identificar-btn-analizar:disabled { opacity: 0.5; cursor: not-allowed; }

.identificar-spinner {
  display: inline-block;
  width: 34px; height: 34px;
  border: 3px solid var(--borde);
  border-top-color: var(--verde);
  border-radius: 50%;
  margin-bottom: 0.5rem;
  animation: identificar-girar 0.8s linear infinite;
}
@keyframes identificar-girar { to { transform: rotate(360deg); } }

.identificar-foto-enviada {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radio-grande);
  margin-bottom: 1.1rem;
}

.identificar-resultados-lista {
  display: flex; flex-direction: column; gap: 0.8rem;
  margin-bottom: 1rem;
}
.identificar-resultado {
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  text-align: left;
}
.identificar-resultado__comun {
  font-family: var(--font-titulo);
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--verde);
  margin: 0 0 0.1rem;
}
.identificar-resultado__cientifico {
  font-family: var(--font);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.identificar-resultado__score {
  font-family: var(--font);
  font-size: 0.76rem;
  color: var(--text);
  margin: 0 0 0.4rem;
}
.identificar-resultado__estado {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.identificar-resultado__estado--invasora { color: #a8342a; }
.identificar-resultado__estado--autoctona { color: #2d6a2d; }
.identificar-resultado__estado--exotica { color: #8a6a10; }
.identificar-resultado__no-incluida {
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.identificar-resultado__acciones {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-top: 0.7rem;
}
.identificar-resultado__acciones .btn {
  width: 100%; padding: 0.7rem 1rem; font-size: 0.85rem; min-height: 44px;
}

.identificar-duda {
  background: var(--seleccion);
  border-left: 2px solid var(--tierra);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  text-align: left;
}
.identificar-duda p {
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 0.7rem;
}
.identificar-duda .btn { width: 100%; }

.identificar-otra-foto { width: 100%; }

/* ── CTA "¿No sabes qué planta es?" ── */
.identificar-cta {
  text-align: center;
  background: var(--verde);
  border-radius: var(--radio-grande);
  padding: 2rem 1.4rem;
  margin-bottom: 2.2rem;
}
.identificar-cta__icon { font-size: 1.8rem; display: block; margin-bottom: 0.6rem; }
.identificar-cta__titulo {
  font-family: var(--font-titulo);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--crema);
  margin: 0 0 0.5rem;
}
.identificar-cta__texto {
  font-family: var(--font);
  font-size: 0.88rem;
  color: rgba(245,234,216,0.75);
  margin: 0 0 1.3rem;
  line-height: 1.5;
}
.identificar-cta__btn { width: 100%; max-width: 320px; }

/* ── "Ver la especie →" en las tarjetas ── */
.especie-card__ver {
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--tierra);
  margin-top: 0.3rem;
}

/* ── Cómo hacer un buen reporte ── */
.steps-list { list-style: none; margin: 0 0 1.8rem; padding: 0; }
.steps-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--borde);
}
.steps-item:first-child { border-top: 1px solid var(--borde); }
.steps-num {
  font-family: var(--font-titulo);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--verde);
  opacity: 0.35;
  line-height: 1;
  flex-shrink: 0;
  min-width: 2ch;
}
.steps-item p {
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0.1rem 0 0;
}
.steps-cta { width: 100%; max-width: 360px; margin: 0 auto; display: block; }

/* ================================================================
   REVISIÓN
   ================================================================ */
.review-section {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.8rem; padding: 0.8rem 0; border-bottom: 1px solid var(--borde);
}
.review-section:last-child { border-bottom: none; }
.review-section__label {
  font-family: var(--font);
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--verde); opacity: 0.55; font-weight: 700; margin-bottom: 0.25rem;
}
.review-section__value { font-family: var(--font); font-size: 0.9rem; color: var(--text); line-height: 1.4; }
.review-section__edit {
  background: none; border: none; color: var(--verde); font-weight: 700;
  font-family: var(--font);
  font-size: 0.78rem; letter-spacing: 0.04em; text-decoration: underline;
  cursor: pointer; flex-shrink: 0; padding: 0.2rem;
}

.review-photos { display: flex; gap: 0.5rem; margin-top: 0.3rem; }
.review-photos img { width: 54px; height: 54px; object-fit: cover; border-radius: var(--radio); }

/* ================================================================
   ÉXITO
   ================================================================ */
.success {
  text-align: center; padding: 2.6rem 0.7rem 0.6rem;
}
.success__icon {
  width: 72px; height: 72px; margin: 0 auto 1.2rem;
  border-radius: 50%; background: var(--seleccion);
  border: 1px solid var(--borde);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--verde);
}
.success h2 {
  font-family: var(--font-titulo);
  font-size: 1.35rem; font-weight: 400; letter-spacing: 0.02em;
  color: var(--verde); margin: 0 0 0.6rem;
}
.success p { font-family: var(--font); font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0 auto 0.4rem; max-width: 420px; }
.success__actions { margin-top: 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.success__actions .btn { width: 100%; max-width: 320px; }

/* ================================================================
   MAPA PÚBLICO — editorial, natural, mapa como protagonista
   ================================================================ */
.map-page { padding-top: 0.3rem; }

/* Buscador y chips en una sola fila, misma altura, sin scroll — se
   encogen si hace falta. Solo en el mapa; no se tocan las reglas base de
   .catalogo-buscador/.catalogo-filtro que también usa la guía botánica. */
.map-controles {
  display: flex; align-items: stretch; flex-wrap: nowrap;
  gap: 0.3rem;
  margin-bottom: 2rem;
}
.map-controles .catalogo-buscador {
  flex: 0 1 34px; min-width: 34px;
  height: 40px; padding: 0 0.55rem;
  margin-bottom: 0;
  gap: 0.3rem;
  transition: flex-basis 0.15s ease;
}
.map-controles .catalogo-buscador.is-activo { flex-basis: 130px; }
.map-controles .catalogo-buscador input {
  font-size: 0.78rem; min-width: 0;
  opacity: 0; transition: opacity 0.1s ease;
}
.map-controles .catalogo-buscador.is-activo input,
.map-controles .catalogo-buscador input:not(:placeholder-shown) { opacity: 1; }
.map-controles .catalogo-buscador__icon { font-size: 0.82rem; }
.map-controles .catalogo-filtros {
  flex: 1 1 auto; flex-wrap: nowrap;
  min-width: 0;
  margin-bottom: 0;
  gap: 0.28rem;
}
.map-controles .catalogo-filtro {
  flex: 1 1 auto; min-width: 0;
  height: 40px; padding: 0 0.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.66rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.map-hero {
  position: relative;
  text-align: center;
  margin-bottom: 1.6rem;
  overflow: hidden;
}
.map-hero__botanico {
  position: absolute; top: -1.2rem; right: -1.4rem;
  width: 110px; height: 110px;
  opacity: 0.06; pointer-events: none;
  transform: rotate(12deg);
}
.map-hero .content-label,
.map-hero .content-titulo { position: relative; }
.map-hero__subtitulo {
  position: relative;
  font-family: var(--font); font-size: 0.94rem; line-height: 1.6;
  color: var(--text-muted); max-width: 420px; margin: 0 auto;
}
.map-hero__decor {
  position: relative;
  font-family: var(--font); font-style: italic; font-size: 0.78rem; line-height: 1.55;
  color: var(--text-muted); opacity: 0.75;
  max-width: 260px; margin: 1.1rem auto 0;
}

.map-card {
  position: relative;
  z-index: 1; /* aísla el stacking context de Leaflet (controles/popups
    llegan a z-index 1000) para que nunca compita con .app-header (z-index
    40) al hacer scroll — sin esto, el mapa podía pintarse por encima. */
  border-radius: var(--radio-grande);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--borde);
  margin-bottom: 1rem;
}
/* Atribución de Leaflet/OSM: se oculta visualmente solo en el mapa
   público (no afecta al mapa del selector de ubicación de reportar.html,
   que sigue mostrándola igual). No se toca la fuente de los tiles. */
.public-map-page .leaflet-control-attribution { display: none; }
.map-card #public-map { height: clamp(360px, 62vh, 560px); }

/* Mensaje "esperando observaciones" — tarjeta flotante que deja ver el
   mapa detrás, no un panel que lo tapa. */
.map-vacio {
  position: absolute; left: 50%; bottom: 1rem; z-index: 500;
  transform: translateX(-50%);
  width: calc(100% - 2rem); max-width: 320px;
  display: flex; flex-direction: column; gap: 0.35rem;
  text-align: center; padding: 1rem 1.2rem;
  background: rgba(255, 253, 248, 0.94);
  border-radius: var(--radio-grande);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.map-vacio__titulo {
  font-family: var(--font-titulo); font-weight: 400; letter-spacing: 0.02em;
  font-size: 0.95rem; color: var(--verde); margin: 0;
}
.map-vacio__texto {
  font-family: var(--font); font-size: 0.8rem; line-height: 1.5;
  color: var(--text-muted); margin: 0;
}
.map-vacio[hidden] { display: none; }

.map-popup { font-family: var(--font); line-height: 1.5; min-width: 140px; }
.map-popup__foto { display: block; width: 100%; max-width: 200px; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 0.4rem; }
.map-popup__comun { display: block; font-size: 0.95rem; margin-bottom: 0.1rem; }
.map-popup__cientifico { display: block; font-style: italic; opacity: 0.9; font-size: 0.85rem; margin-bottom: 0.4rem; }
.map-popup__ficha { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--crema); text-decoration: underline; }

/* Puntos y agrupaciones del mapa por especie — divIcons coloreados a mano */
.map-marker-dot {
  border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.map-cluster-icon {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  color: #fff; font-family: var(--font); font-weight: 700; font-size: 0.78rem;
}

/* Control para mostrar/ocultar la capa histórica de QGIS, oculta por
   defecto — el mapa se centra en los reportes ciudadanos. */
.map-historico {
  text-align: center;
  margin: 0 0 1.8rem;
}
.map-historico__btn {
  font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  color: var(--verde); background: var(--card);
  border: 1.5px solid var(--borde); border-radius: 999px;
  padding: 0.55rem 1.2rem; cursor: pointer;
}
.map-historico__btn.is-active { background: var(--verde); color: var(--crema); border-color: var(--verde); }
.map-historico__nota {
  font-family: var(--font); font-size: 0.72rem; color: var(--text-muted);
  margin: 0.55rem 0 0;
}

/* Bloque participativo */
.map-participa {
  background: rgba(167, 192, 160, 0.22);
  border-radius: var(--radio-grande);
  padding: 1.9rem 1.4rem;
  margin-bottom: 1.6rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.map-participa__titulo {
  font-family: var(--font-titulo); font-size: 1.05rem; font-weight: 400;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--verde); margin: 0 0 0.6rem;
}
.map-participa__texto p {
  font-family: var(--font); font-size: 0.9rem; line-height: 1.6;
  color: var(--text); margin: 0 0 1.1rem; max-width: 420px;
}
.map-participa__btn { display: inline-flex; }
.map-participa__nota {
  font-family: var(--font); font-size: 0.74rem; color: var(--text-muted);
  margin: 0.9rem 0 0;
}
.map-pasos { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.map-paso { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.map-paso img { width: 26px; height: 26px; }
.map-paso span {
  font-family: var(--font); font-size: 0.7rem; font-weight: 700;
  color: var(--verde); text-align: center; max-width: 74px;
}
.map-paso__flecha { color: var(--text-muted); font-size: 1.1rem; }
@media (min-width: 700px) {
  .map-participa { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ================================================================
   PIE DE PÁGINA — estilo editorial (Camina y Descubre)
   ================================================================ */
.app-footer {
  background: var(--verde);
  color: var(--crema);
  padding: 1.9rem 1.4rem calc(1.7rem + var(--safe-bottom));
  text-align: center;
  border-top: 1px solid rgba(245,234,216,0.12);
}
.app-footer a { color: var(--crema); text-decoration: none; font-weight: 700; }
.app-footer a:hover { text-decoration: underline; }

.app-footer__logo { height: 42px; width: auto; margin: 0 auto 1.1rem; opacity: 0.92; }

.app-footer__brand {
  font-family: var(--font-titulo);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--crema);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.app-footer p {
  font-family: var(--font);
  font-size: 0.72rem;
  color: rgba(245,234,216,0.55);
  margin: 0.2rem 0;
}
.app-footer p a { color: rgba(245,234,216,0.75); font-weight: 600; }

.app-footer__legal {
  margin: 0.9rem 0 0.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem;
}
.app-footer__legal a {
  color: rgba(245,234,216,0.55);
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.app-footer__legal a:hover { color: var(--crema); text-decoration: none; }

.app-footer__credit {
  margin-top: 0.7rem; font-size: 0.6rem; color: rgba(245,234,216,0.38);
}

/* ================================================================
   PÁGINAS LEGALES
   ================================================================ */
.legal-page .container { padding-top: 1.6rem; padding-bottom: 3.5rem; }
.legal-page h1 {
  font-family: var(--font-titulo);
  font-size: 1.5rem; font-weight: 400; letter-spacing: 0.02em;
  color: var(--verde); margin-bottom: 0.35rem;
}
.legal-page .legal-updated { font-family: var(--font); font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.6rem; }
.legal-page h2 {
  font-family: var(--font-titulo);
  font-size: 0.95rem; font-weight: 400; letter-spacing: 0.03em;
  color: var(--verde); margin: 1.8rem 0 0.6rem;
}
.legal-page p, .legal-page li { font-family: var(--font); font-size: 0.9rem; color: var(--text); line-height: 1.72; }
.legal-page ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.legal-page .pending {
  background: rgba(168,88,42,0.12); color: var(--tierra-oscura); font-weight: 700;
  border-radius: 6px; padding: 0.05rem 0.4rem; font-size: 0.85em;
}
.legal-page a.back-link {
  display: inline-block; margin-bottom: 1.4rem; font-weight: 700;
  font-family: var(--font);
  font-size: 0.85rem;
}

/* ================================================================
   RESPONSIVE / DESKTOP
   ================================================================ */
@media (min-width: 720px) {
  .container { padding-top: 2rem; }
  .step-question { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
}
