*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Cores, fontes e medidas: static/css/theme.css (carregado antes deste). */

html { scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  /* Above Leaflet's control-corner layer (z-index: 1000, GeoPack's map)
     so the avatar dropdown doesn't render behind map controls; still
     below modal overlays (z-index: 2000+) so those stay on top of it. */
  z-index: 1500;
  background: color-mix(in srgb, var(--tint-page) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 38px; }
.nav-wordmark {
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--text);
  margin-left: 10px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Standard tool nav header (icon + name + one-line tagline), shared by every
   tool workspace (piloted 2026-07 on GeoPack/TSView as .gp-nav-*/.tsv-nav-*,
   consolidated here so every tool — including Zonpy/SAK and the 5 DDReport-
   family pages — uses one shared implementation instead of a per-file copy). */
.nav-with-tagline { height: auto; min-height: 64px; padding: 10px 48px; }
.tool-nav-left { display: flex; align-items: center; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; }
.tool-nav-sep { color: var(--border); }
.tool-nav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex: none; }
.tool-nav-icon svg { width: 100%; height: 100%; }
.tool-nav-tool { font-size: var(--fs-12); font-weight: 700; color: var(--teal-light); letter-spacing: 0.2px; white-space: nowrap; }
.tool-nav-tagline { flex-basis: 100%; color: var(--text-dim); font-size: var(--fs-7); }
@media (max-width: 1024px) { .tool-nav-tagline { display: none; } }

.nav-right { display: flex; align-items: center; gap: 28px; }

#header-buttons { display: flex; align-items: center; gap: 28px; }
.header-btn {
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-10);
  font-weight: 500;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  white-space: nowrap;   /* "Go Pro" broke into two lines in the narrower tool headers */
  flex-shrink: 0;
}
.header-btn:hover { color: var(--btn-label); }
.header-btn--cta {
  background: var(--btn-fill);
  color: var(--text-on-brand) !important;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.header-btn--cta:hover { background: var(--btn-fill-hover); color: var(--text-on-brand) !important; }

#plan-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 4px;
  font-size: var(--fs-6);
  color: var(--text-dim);
}
#plan-badge:empty { display: none; }
#plan-badge img { width: 20px; height: 20px; border-radius: 50%; }

/* Language of the site (auth_gate.js renderLanguageMenu): globe + code, list.
   No flags: a flag is a country (Henrique, 2026-11-04). */
#lang-menu { position: relative; }
#lang-btn {
  display: flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit;
  background: var(--navy-card); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 4px 10px 4px 6px; font-size: var(--fs-6); color: var(--text-dim);
}
#lang-btn:hover { border-color: var(--btn-ring); color: var(--btn-label); }
#lang-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lang-globe { width: 16px; height: 16px; flex: none; }
.lang-caret { width: 9px; height: 6px; }
.lang-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 160px; padding: 6px; display: none; z-index: 200;
  background: var(--navy-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow) 35%, transparent);
}
#lang-menu.open .lang-dropdown { display: block; }
.lang-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius); border: none; background: none;
  color: var(--text); font-size: var(--fs-8); font-family: inherit;
}
.lang-dropdown button:hover { background: var(--navy-light); color: var(--teal); }
.lang-dropdown button[aria-checked="true"] { font-weight: 600; color: var(--btn-label); }
/* Phone: only the globe, so the header keeps its room. */
@media (max-width: 600px) {
  #lang-btn { padding: 6px; }
  #lang-btn .lang-code, #lang-btn .lang-caret { display: none; }
}
/* Touch: the button and each language at least the tap size (responsive.css). */
@media (pointer: coarse) {
  #lang-btn { min-width: var(--tap-min); min-height: var(--tap-min); justify-content: center; }
  .lang-dropdown button { min-height: var(--tap-min); }
}

#avatar-menu { position: relative; }
#avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy-light);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { color: var(--text); font-weight: 700; font-size: var(--fs-8); }

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 180px;
  padding: 6px;
  display: none;
  z-index: 200;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow) 35%, transparent);
}
.avatar-dropdown.open { display: block; }
.avatar-dropdown a, .avatar-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-8);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: var(--navy-light); color: var(--teal); }
.avatar-dropdown-icon { display: flex !important; align-items: center; gap: 8px; }
.avatar-dropdown-icon svg { flex: none; color: var(--text-muted); }
.avatar-dropdown-icon:hover svg { color: inherit; }
.avatar-dropdown-subitem {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding-left: 14px !important;
  font-size: var(--fs-6) !important;
  color: var(--text-dim) !important;
}
.avatar-dropdown-subitem svg { width: 16px; height: 16px; flex: none; }

/* ── HERO ── */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--tint-brand) 12%, transparent) 0%, transparent 70%),
    var(--navy);
}

.hero-logo { width: 260px; margin-bottom: 40px; }

.hero h1 {
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
  padding-bottom: 0.1em;
  background: linear-gradient(135deg, var(--text-strong) 30%, var(--teal-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero p {
  max-width: 560px;
  font-size: var(--fs-13);
  color: var(--text-dim);
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.btn-primary {
  background: var(--btn-fill);
  color: var(--bg-page);
  font-weight: 700;
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-11);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--btn-fill-hover); transform: translateY(-1px); }

.btn-outline-hero {
  background: transparent;
  color: var(--btn-label);
  font-weight: 600;
  padding: 13px 32px;
  border: 1.5px solid var(--btn-ring);
  border-radius: var(--radius-md);
  font-size: var(--fs-11);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-outline-hero:hover { background: color-mix(in srgb, var(--btn-tint-brand) 10%, transparent); }

/* ── WAVE DIVIDER ── */
.wave-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-top: -2px;
}
.wave-divider svg { display: block; width: 100%; height: 60px; }

/* ── SECTIONS ── */
section { padding: 80px 24px; }

.container { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: var(--fs-4);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.section-title {
  font-size: var(--fs-display-2);
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-strong);
}

.section-sub {
  font-size: var(--fs-12);
  color: var(--text-dim);
  max-width: 600px;
  margin-bottom: 52px;
}

/* ── ABOUT ── */
#about { background: var(--navy-card); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  color: var(--text-dim);
  font-size: var(--fs-12);
  margin-bottom: 16px;
  line-height: 1.75;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.stat-box {
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
}

.stat-box .value {
  font-size: var(--fs-15);
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-box .label {
  font-size: var(--fs-6);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── PROJECTS ── */
#projects { background: var(--navy); }

/* ── Homepage tools teaser: one compact card, just logo/name/status,
   pointing at /tools — the full descriptions live there, not here. ── */
.tools-teaser-card {
  display: block;
  max-width: 980px;
  margin: 0 auto;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 36px 32px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.tools-teaser-card:hover { border-color: var(--teal); transform: translateY(-3px); }

.tools-teaser-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
@media (max-width: 860px) {
  .tools-teaser-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .tools-teaser-grid { grid-template-columns: repeat(2, 1fr); }
}

.tool-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.tool-mini--soon { opacity: 0.55; }
.tool-logo-mini { height: 34px; max-width: 100%; }
.tool-mini-sub { font-size: var(--fs-5); color: var(--text-dim); line-height: 1.3; }

.tools-teaser-cta {
  text-align: center;
  margin-top: 28px;
  font-weight: 600;
  font-size: var(--fs-11);
  color: var(--teal);
}

.tool-logo { height: 48px; margin-bottom: 4px; }
.tool-subtitle {
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--text-strong);
  margin-top: -4px;
}

.project-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--teal); transform: translateY(-3px); }
a.project-card { text-decoration: none; color: inherit; cursor: pointer; }

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-4);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal);
  background: color-mix(in srgb, var(--tint-brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint-brand) 25%, transparent);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.project-name {
  font-size: var(--fs-14);
  font-weight: 800;
  color: var(--text-strong);
}

.project-desc {
  font-size: var(--fs-10);
  color: var(--text-dim);
  line-height: 1.7;
  flex: 1;
}

.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: var(--fs-3);
  background: var(--navy-light);
  color: var(--silver);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-9);
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  margin-top: 4px;
  transition: gap 0.2s;
}
.project-link:hover { gap: 10px; }

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.contact-item {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-label { font-size: var(--fs-4); text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 8px; }
.contact-value,
.contact-value:link,
.contact-value:visited,
.contact-value:hover,
.contact-value:active {
  font-size: var(--fs-11);
  color: var(--text-dim) !important;
  text-decoration: none !important;
  font-weight: 400;
  display: block;
  margin-bottom: 6px;
}

/* ── PROJECT CARD VARIANTS ── */
.project-badge--soon { color: var(--text-dim); background: color-mix(in srgb, var(--muted-tint) 8%, transparent); border-color: color-mix(in srgb, var(--muted-tint) 20%, transparent); }
.project-card--soon { opacity: 0.65; }
.project-card--soon:hover { border-color: var(--border); transform: none; }

/* ── FOOTER ── */
footer {
  background: var(--navy-card);
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

footer img { height: 32px; opacity: 0.7; }
footer p { font-size: var(--fs-7); color: var(--text-dim); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-wordmark { display: none; }
  .header-btn:not(.header-btn--cta) { display: none; }
  #plan-badge span { display: none; }
  .lang-code, .lang-caret { display: none; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  footer { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  /* Quatro quadradinhos em duas colunas: "NORMAM" no tamanho grande não cabia. */
  .stat-box { padding: 16px 10px; }
  .stat-box .value { font-size: var(--fs-14); }
}

/* Wait (static/js/wait.js): elapsed time while the server works, in a
   button (Wait.during) or inside GeoPack's working box (Wait.autoElapsed). */
.wait-elapsed { font-size: 0.8em; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 8px; opacity: 0.85; }
.spinner-inline.wait-in-button {
  display: inline-block; width: 12px; height: 12px; border: 2px solid color-mix(in srgb, var(--legacy-text-muted) 40%, transparent); border-top-color: currentColor;
  border-radius: 50%; animation: wait-spin 0.8s linear infinite; margin-right: 8px; vertical-align: -2px;
}
@keyframes wait-spin { to { transform: rotate(360deg); } }
