/* ── Tema claro (padrão) ── */
:root {
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-strong: #eef5f1;
  --text: #10201d;
  --muted: #5c6d68;
  --line: #d9e4df;
  --primary: #0f6b5f;
  --primary-dark: #0a463f;
  --accent: #b8872f;
  --ink: #0b1412;
  --shadow: 0 18px 50px rgba(20, 38, 34, 0.12);
  --radius: 8px;
}

/* ── Tema escuro ── */
[data-theme="dark"] {
  --bg: #0d1a17;
  --surface: #152320;
  --surface-strong: #1c2e2a;
  --text: #e8f0ee;
  --muted: #8aada6;
  --line: #2a3e3a;
  --primary: #1a9b8a;
  --primary-dark: #22c4ae;
  --accent: #d4a040;
  --ink: #07100e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  transition: background 240ms ease, color 240ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

/* ── Header ── */
.site-header {
  align-items: center;
  background: rgba(246, 248, 245, 0.9);
  border-bottom: 1px solid rgba(217, 228, 223, 0.85);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(18px, 4vw, 56px);
  position: sticky;
  right: 0;
  top: 0;
  backdrop-filter: blur(14px);
  z-index: 20;
  transition: background 240ms ease, border-color 240ms ease;
}

[data-theme="dark"] .site-header {
  background: rgba(13, 26, 23, 0.92);
  border-bottom-color: rgba(42, 62, 58, 0.9);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.main-nav a {
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
  padding: 9px 12px;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--surface-strong);
  color: var(--primary-dark);
}

.main-nav .nav-login {
  background: var(--ink);
  color: #fff;
  margin-left: 6px;
}

/* ── Botão de tema ── */
.theme-toggle {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 4px;
  height: 36px;
  justify-content: center;
  padding: 0 12px;
  font-size: 1rem;
  transition: background 200ms ease;
}

.theme-toggle:hover {
  background: var(--line);
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

.nav-toggle {
  background: transparent;
  border: 0;
  display: none;
  height: 42px;
  padding: 8px;
  width: 42px;
}

.nav-toggle span {
  background: var(--text);
  display: block;
  height: 2px;
  margin: 5px 0;
  width: 100%;
}

/* ── Hero ── */
.hero {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  min-height: calc(100vh - 72px);
  padding: clamp(44px, 7vw, 88px) clamp(18px, 5vw, 72px) 42px;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 5.6rem);
  line-height: 0.98;
  margin-bottom: 22px;
  max-width: 980px;
}

h2 {
  font-size: clamp(1.85rem, 3.6vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-text {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  max-width: 680px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  box-shadow: 0 14px 30px rgba(15, 107, 95, 0.18);
  color: #fff;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--primary-dark);
}

.hero-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 42px 0 0;
}

.hero-metrics div {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.hero-metrics dt {
  font-weight: 900;
}

.hero-metrics dd {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 2px 0 0;
}

.hero-media {
  align-self: center;
  min-height: 420px;
  position: relative;
}

.hero-media img {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.status-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 228, 223, 0.95);
  border-radius: var(--radius);
  bottom: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
  left: 18px;
  max-width: calc(100% - 36px);
  padding: 16px 18px 16px 44px;
  position: absolute;
}

[data-theme="dark"] .status-panel {
  background: rgba(21, 35, 32, 0.95);
  border-color: rgba(42, 62, 58, 0.9);
}

.status-dot {
  background: #21a67a;
  border-radius: 999px;
  height: 12px;
  left: 18px;
  position: absolute;
  top: 22px;
  width: 12px;
}

.status-panel small {
  color: var(--muted);
}

/* ── Seções ── */
.section {
  padding: clamp(58px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.section-heading {
  margin: 0 auto 34px;
  max-width: 820px;
  text-align: center;
}

.section-heading p {
  color: var(--muted);
}

.section-heading.align-left {
  margin-left: 0;
  text-align: left;
}

.services-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 218px;
  padding: 24px;
}

.service-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.icon {
  color: var(--accent);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 28px;
}

.trust-band {
  align-items: start;
  background: var(--ink);
  color: #fff;
  display: grid;
  gap: 28px;
  grid-template-columns: 0.85fr 1.15fr;
  padding: clamp(52px, 7vw, 82px) clamp(18px, 5vw, 72px);
}

.trust-band .eyebrow {
  color: #7bd8c7;
}

.trust-list {
  display: grid;
  gap: 12px;
}

.trust-list div {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 0 18px;
}

.trust-list strong,
.trust-list span {
  display: block;
}

.trust-list span {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
}

.split {
  align-items: start;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
}

.timeline {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
  margin: 0;
  padding: 12px;
}

.timeline li {
  display: grid;
  gap: 16px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 18px;
}

.timeline li + li {
  border-top: 1px solid var(--line);
}

.timeline span {
  align-items: center;
  background: var(--surface-strong);
  border-radius: var(--radius);
  color: var(--primary-dark);
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.timeline p {
  color: var(--muted);
  margin-bottom: 0;
}

.portal-section {
  align-items: center;
  background: var(--surface-strong);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  padding: clamp(58px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.portal-copy p {
  color: var(--muted);
}

.portal-copy a {
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.login-panel,
.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: block;
  font-weight: 800;
  margin-top: 10px;
  min-height: 46px;
  width: 100%;
}

.login-panel button:hover,
.login-panel button:focus-visible {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.auth-status,
.form-status {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.form-status {
  min-height: 1.4em;
}

.form-status[data-status="success"] {
  color: #0f7b59;
}

.form-status[data-status="error"] {
  color: #b42318;
}

.form-status[data-status="warning"] {
  color: #946200;
}

.login-panel button[hidden] {
  display: none;
}

.contact-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.contact-section {
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
}

.contact-form {
  box-shadow: none;
}

.contact-form label {
  color: var(--primary-dark);
  display: grid;
  font-weight: 800;
  gap: 7px;
  margin-bottom: 14px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  min-height: 46px;
  padding: 11px 12px;
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 107, 95, 0.14);
}

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 28px;
  grid-template-columns: 1.3fr 1fr 0.7fr;
  padding: 38px clamp(18px, 5vw, 72px);
}

.site-footer strong {
  color: #fff;
}

.site-footer a {
  display: block;
  margin-top: 8px;
}

.footer-brand {
  color: #fff;
  margin-bottom: 12px;
}

/* ── Banner de Cookies ── */
.cookie-banner {
  background: var(--surface);
  border-top: 1px solid var(--line);
  bottom: 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
  left: 0;
  position: fixed;
  right: 0;
  z-index: 50;
  transition: transform 320ms ease, opacity 320ms ease;
}

.cookie-banner.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

.cookie-content {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1100px;
  padding: 18px clamp(18px, 4vw, 56px);
}

.cookie-content p {
  color: var(--muted);
  flex: 1;
  font-size: 0.9rem;
  margin: 0;
  min-width: 200px;
}

.cookie-content a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-actions .button {
  min-height: 40px;
  padding: 8px 16px;
}

/* ── Assistente de IA ── */
.ai-widget {
  bottom: 24px;
  position: fixed;
  right: 24px;
  z-index: 40;
}

.ai-toggle {
  align-items: center;
  background: var(--primary);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(15, 107, 95, 0.35);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 6px;
  height: 54px;
  justify-content: center;
  padding: 0 18px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ai-toggle:hover {
  box-shadow: 0 12px 36px rgba(15, 107, 95, 0.45);
  transform: translateY(-2px);
}

.ai-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  bottom: 66px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  width: 320px;
}

.ai-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  padding: 14px 16px;
}

.ai-dot {
  background: #21a67a;
  border-radius: 999px;
  height: 8px;
  width: 8px;
  flex-shrink: 0;
}

.ai-header strong {
  flex: 1;
  font-size: 0.92rem;
}

.ai-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
}

.ai-close:hover {
  color: var(--text);
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
}

.ai-msg {
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 88%;
  padding: 10px 13px;
}

.ai-msg.bot {
  background: var(--surface-strong);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  color: var(--text);
}

.ai-msg.user {
  background: var(--primary);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  color: #fff;
}

.ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.ai-quick-replies button {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  transition: background 160ms ease;
}

.ai-quick-replies button:hover {
  background: var(--line);
}

.ai-input-area {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.ai-input-area input {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  flex: 1;
  font-size: 0.88rem;
  min-height: 38px;
  padding: 8px 12px;
}

.ai-input-area input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 107, 95, 0.14);
}

.ai-input-area button {
  align-items: center;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
  flex-shrink: 0;
}

.ai-input-area button:hover {
  background: var(--primary-dark);
}

/* ── Responsivo ── */
@media (max-width: 980px) {
  .hero,
  .split,
  .portal-section,
  .contact-section,
  .trust-band,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-media {
    min-height: 340px;
  }

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

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    left: 18px;
    padding: 10px;
    position: absolute;
    right: 18px;
    top: 70px;
  }

  .main-nav.is-open {
    display: grid;
  }

  .main-nav .nav-login {
    margin-left: 0;
    text-align: center;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-actions,
  .contact-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .hero-metrics,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: auto;
  }

  .timeline li {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 16px 8px;
  }

  .timeline span {
    height: 36px;
    width: 36px;
  }

  .ai-panel {
    width: calc(100vw - 48px);
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions .button {
    flex: 1;
  }
}
