/* ── Design tokens ── */
:root {
  --green: #178a68;
  --green-dark: #0f5f48;
  --bg: #f4f7f5;
  --card: #ffffff;
  --border: #dce5e0;
  --text: #1f2937;
  --muted: #6b7280;
}

/* ── Base ── */
body {
  margin: 0;
  background: var(--bg);
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
}

button {
  border: none;
  background: var(--green);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  font-weight: 500;
  cursor: pointer;
}

label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

small {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.form-control,
.form-range {
  border-radius: 12px;
  border-color: var(--border);
  padding: 0.85rem 1rem;
}

/* ── Layout ── */
.app-shell {
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.main-container {
  max-width: 1200px;
  margin: auto;
}

/* ── Hero ── */
.hero {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}

/* ── Stepper ── */
.stepper {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.step-card {
  flex: 1;
  min-width: 220px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.step-card.active {
  border-color: var(--green);
  background: #f6fffb;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e9f6f1;
  color: var(--green-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-card.active .step-circle {
  background: var(--green);
  color: white;
}

.step-title { font-weight: 700; }

.step-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Section cards ── */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.section-title {
  color: var(--green-dark);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

/* ── Label with info icon ── */
.label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.label-row label {
  margin: 0;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}

.info-icon:hover {
  background: var(--green-dark);
}

.tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.65;
  width: 270px;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.info-tooltip:hover .tooltip-text,
.info-tooltip.open .tooltip-text {
  display: block;
}

/* ── Toggle buttons ── */
.toggle-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.toggle-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: white;
  border-radius: 12px;
  padding: 0.8rem;
  color: black;
  font-weight: 600;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.primary-btn {
  border: none;
  background: var(--green);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Wizard ── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

/* ── Results ── */
.result-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  margin-top: 1.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card {
  background: #f7faf8;
  border-radius: 18px;
  padding: 1.5rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
}

/* ── Breakdown table ── */
.breakdown-card {
  background: #f7faf8;
  border-radius: 18px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.breakdown-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.breakdown-row:last-child {
  border: none;
  font-weight: 700;
  color: var(--green-dark);
  padding-top: 0.75rem;
  font-size: 1rem;
}

.breakdown-row--3col {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1.5rem;
}

.breakdown-row--3col span:nth-child(2),
.breakdown-row--3col span:nth-child(3) {
  min-width: 80px;
  text-align: right;
}

.breakdown-row--header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 0.75rem;
}

.breakdown-row--header:last-child {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Summary narrative ── */
.summary-card {
  background: #f0faf5;
  border: 1px solid #a7d7c0;
  border-radius: 18px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  line-height: 1.8;
  font-size: 0.97rem;
  color: var(--text);
}

/* ── Warning card ── */
.warning-card {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: none;
  gap: 1rem;
  align-items: flex-start;
}

.warning-card.visible { display: flex; }

.warning-text strong {
  color: #92400e;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.warning-text p {
  color: #78350f;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ── Map search ── */
.map-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.map-search-input-wrap {
  position: relative;
  flex: 1;
}

.map-search .search-btn {
  white-space: nowrap;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  align-self: flex-start;
}

.map-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 220px;
  overflow-y: auto;
}

.map-search-dropdown.open {
  display: block;
}

.map-search-option {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
  border-radius: 8px;
  margin: 0.1rem 0.3rem;
}

.map-search-option:hover,
.map-search-option.highlighted {
  background: #f0faf5;
  color: var(--green-dark);
}

/* ── Map ── */
#map {
  height: 400px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #ccc;
}

.controls {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* ── Language switcher ── */
.lang-switcher {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 1100;
  display: flex;
  gap: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.lang-btn {
  border: none;
  background: white;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.lang-btn.active {
  background: var(--green);
  color: white;
}

.lang-btn:hover:not(.active) {
  background: #f0faf5;
}

/* ── Hamburger button ── */
.hamburger-btn {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 1100;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Side menu ── */
.side-menu {
  position: fixed;
  top: 0; left: 0;
  width: 270px;
  height: 100%;
  background: white;
  border-right: 1px solid var(--border);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  padding: 2rem 1.5rem;
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.side-menu nav { flex: 1; }

.side-menu.open { transform: translateX(0); }

.side-menu-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 1150;
}

.side-menu-overlay.open { display: block; }

.side-menu-logo {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.side-menu nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.97rem;
  transition: background 0.15s;
}

.side-menu nav a:hover { background: #f0faf5; color: var(--green-dark); }
.side-menu nav a.active { background: #e6f7f0; color: var(--green-dark); }

.side-menu-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.side-menu-footer-logo {
  width: 120px;
  display: block;
  margin-bottom: 0.65rem;
}
.side-menu-tagline {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.side-menu-tagline a {
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Menu pages ── */
.menu-page { display: none; }
.menu-page.active { display: block; }

/* ── Site footer ── */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 2px solid var(--border);
  background: #f8fdfb;
  border-radius: 16px 16px 0 0;
}
.site-footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-footer-desc {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.site-footer-desc a,
.site-footer-cta a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}
.site-footer-desc a:hover,
.site-footer-cta a:hover { text-decoration: underline; }
.site-footer-cta {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.site-footer-credits {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.site-footer-credits a {
  color: var(--muted);
  text-decoration: underline;
}

.catalogue-link {
  margin-top: 1.25rem;
  margin-bottom: 0;
  font-size: 0.88rem;
}
.catalogue-link a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}
.catalogue-link a:hover { text-decoration: underline; }

/* ── Next Steps card ── */
.next-steps-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.next-step-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.next-step-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.next-step-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}
.next-step-item p {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}
.next-step-item p a { color: var(--green-dark); font-weight: 600; }
.full-btn { width: 100%; }

/* ── Info pages ── */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.info-card h2 {
  color: var(--green-dark);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.info-card h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.info-card p, .info-card li {
  line-height: 1.8;
  color: var(--text);
}

.info-card ul { padding-left: 1.25rem; }
.info-card a { color: var(--green); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero,
  .section-card,
  .result-card {
    padding: 1.4rem;
  }
}
