:root {
  --primary: #006948;
  --primary-dark: #005137;
  --text: #131b2e;
  --muted: #3d4a42;
  --border: #d8e1db;
  --surface: #ffffff;
  --background: #f6faf7;
  --success: #087f5b;
  --danger: #ba1a1a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.5;
}

.container {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: 40px 0;
}

.intro { margin-bottom: 24px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 20px; }
.brand img { display: block; width: auto; height: 80px; max-width: min(300px, 80vw); object-fit: contain; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 22px; }
h3 { color: var(--primary); font-size: 17px; }
p { color: var(--muted); margin: 8px 0 0; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 36px);
  box-shadow: 0 8px 24px rgba(19, 27, 46, .06);
}

.form-header { margin-bottom: 28px; text-align: center; }
.section { padding-top: 24px; margin-top: 24px; border-top: 1px solid #e8eee9; }
.section:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.field { grid-column: span 12; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-1 { grid-column: span 1; }

label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.required { color: var(--danger); }
input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  font: inherit;
}
input:focus { outline: 2px solid rgba(0, 105, 72, .18); border-color: var(--primary); background: #fff; }
.cep-row { display: flex; gap: 8px; }
.cep-row input { flex: 1; }
button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.secondary-button { padding: 0 16px; color: var(--primary-dark); background: #dff6e9; white-space: nowrap; }
.secondary-button:hover { background: #bfead3; }
.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 20px;
  color: #fff;
  background: var(--primary);
  font-size: 16px;
}
.primary-button:hover { background: var(--primary-dark); }
button:disabled { cursor: wait; opacity: .7; }
.feedback { min-height: 20px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.response-card { display: none; margin-top: 24px; padding: 16px; border-radius: 10px; background: #f0f7f2; border: 1px solid #c8e5d1; }
.response-card.visible { display: block; }
.response-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
pre { overflow: auto; margin: 12px 0 0; padding: 12px; border-radius: 8px; background: #102018; color: #dff6e9; font-size: 12px; }
.note { margin-top: 16px; font-size: 13px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 360px; padding: 14px 16px; border-radius: 10px; color: #fff; background: #173c2d; box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .25s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast strong { display: block; }

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 860px); padding: 24px 0; }
  .span-6, .span-8, .span-4, .span-3, .span-1 { grid-column: span 12; }
  .cep-row { flex-direction: column; }
  .secondary-button { height: 44px; }
  .response-meta { flex-direction: column; gap: 2px; }
}
