/* Simulador de amostragem — formulário em largura total + resultado abaixo */

:root {
  --am-ink: #163528;
  --am-muted: #5d6f64;
  --am-line: rgba(22, 53, 40, 0.1);
  --am-soft: #f3f7f4;
  --am-green: #1a6b4a;
  --am-green-deep: #0f4a32;
  --am-radius: 16px;
  --am-radius-sm: 12px;
}

/* Hub */
.calc-hub-intro h1 { letter-spacing: -0.02em; }

.calc-hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}
.calc-hub-step {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(33, 79, 53, 0.35);
}
.calc-hub-card--amostra {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(44, 132, 99, 0.12), transparent 55%),
    linear-gradient(165deg, #f0faf4 0%, #ffffff 52%) !important;
}
.calc-hub-card .hub-list { flex: 1; margin-bottom: 18px; }
.calc-hub-actions { margin-top: auto; flex-wrap: wrap; }

@media (max-width: 1100px) and (min-width: 981px) {
  .calc-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-hub-card--amostra { grid-column: 1 / -1; }
}

/* Página larga */
body.amostra-page .amostra-hero .container,
body.amostra-page .calc-stage.container,
body.amostra-page #metodologia-amostragem > .container {
  width: min(calc(100% - 40px), 1360px);
}

body.amostra-page .amostra-hero { padding-bottom: 4px; }

.amostra-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.amostra-hero-mark {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(15, 45, 31, 0.1);
  overflow: hidden;
}
.amostra-hero-mark img { display: block; width: 100%; height: 100%; }

body.amostra-page .amostra-hero .section-heading p {
  max-width: 72ch;
  color: var(--am-muted);
}

/* Uma coluna: formulário FULL WIDTH, depois resultado FULL WIDTH */
body.amostra-page .amostra-workspace.calc-workspace {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px;
  align-items: stretch;
}

body.amostra-page .amostra-workspace > .amostra-builder,
body.amostra-page .amostra-workspace > .amostra-result {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  grid-column: 1 / -1;
}

/* Painéis ocultos (display do .field sobrescreve [hidden]) */
body.amostra-page .hidden,
body.amostra-page [hidden] {
  display: none !important;
}

.amostra-builder {
  padding: 22px 24px !important;
}

.amostra-builder .calc-section-title {
  margin-top: 2px;
  margin-bottom: 10px;
}

.amostra-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .amostra-mode-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.amostra-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius-sm);
  background: var(--am-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.amostra-choice:hover { border-color: rgba(26, 107, 74, 0.28); }
.amostra-choice:has(input:checked) {
  border-color: rgba(26, 107, 74, 0.5);
  background: linear-gradient(180deg, #eef8f2 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(26, 107, 74, 0.14);
}
.amostra-choice strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.95rem;
  color: var(--am-ink);
}
.amostra-choice span:not(.amostra-choice-icon) {
  color: var(--am-muted);
  font-size: 0.84rem;
  line-height: 1.3;
}
.amostra-choice input { margin-top: 3px; accent-color: var(--am-green); }
.amostra-choice--icon { align-items: center; }
.amostra-choice-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--am-line);
}

/* Campos em grade larga — menos altura, mais largura */
body.amostra-page .amostra-builder .field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

@media (min-width: 800px) {
  body.amostra-page .amostra-builder .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  body.amostra-page .amostra-builder .field-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.amostra-form-actions {
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Resultado */
.amostra-result {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.amostra-result .result-hero {
  margin-bottom: 0 !important;
  padding: 20px 22px 16px !important;
}

.amostra-result .result-hero h2 {
  margin: 4px 0 6px;
  font-size: clamp(1.3rem, 1.6vw, 1.55rem);
}

.amostra-result .result-hero p[data-amostra-lead] {
  margin: 0;
  line-height: 1.4;
  opacity: 0.92;
}

.amostra-answer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.amostra-kpi {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.amostra-kpi b {
  display: block;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.amostra-kpi span {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.25;
  opacity: 0.88;
}

.amostra-result-split {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--am-line);
}

@media (min-width: 900px) {
  .amostra-result-split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

.amostra-visual {
  margin: 0;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, #f6faf7 0%, #eef4ef 100%);
}

@media (min-width: 900px) {
  .amostra-visual { border-right: 1px solid var(--am-line); }
}

.amostra-visual-head .chart-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--am-ink);
}
.amostra-visual-head .chart-title small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: var(--am-muted);
  font-size: 0.8rem;
}

.amostra-map {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--am-radius-sm);
  background: #fff;
  border: 1px solid var(--am-line);
  box-shadow: 0 6px 16px rgba(15, 45, 31, 0.05);
}

.amostra-bed { fill: #c5d6c2; stroke: #5f7a5c; stroke-width: 1.1; }
.amostra-point { fill: var(--am-green); stroke: #fff; stroke-width: 1; }
.amostra-point--flow { fill: var(--am-green-deep); }
.amostra-point-n {
  fill: #fff;
  font-size: 3.5px;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.amostra-map-caption {
  fill: #3d4f3c;
  font-size: 3.3px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.amostra-map-note {
  fill: #6a7a68;
  font-size: 2.7px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.amostra-depth { stroke: #fff; stroke-width: 0.4; }
.amostra-depth--top { fill: #8fbf9a; }
.amostra-depth--mid { fill: #5f9a6e; }
.amostra-depth--bot { fill: #3d7a52; }
.amostra-silo-bg { fill: transparent; }
.amostra-silo-body { fill: #165f48; }
.amostra-silo-top { fill: #2c8463; }
.amostra-ban-ring { fill: none; stroke: #b91c1c; stroke-width: 1.6; }
.amostra-ban-x { stroke: #b91c1c; stroke-width: 1.8; stroke-linecap: round; }
.amostra-belt { fill: #2c8463; }
.amostra-flow-arrow { stroke: #165f48; stroke-width: 2; fill: none; stroke-linecap: round; }
.amostra-flow-arrow-head { fill: #165f48; stroke: none; }
.amostra-summary-box { fill: #e8f5ee; stroke: rgba(22, 95, 72, 0.2); stroke-width: 0.8; }
.amostra-summary-strong {
  fill: #0f4a38;
  font-size: 3.5px;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.amostra-result-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: #fff;
}

.amostra-meta-grid {
  margin: 0 !important;
  gap: 8px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.amostra-meta-grid .result-stat {
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--am-soft);
}

.amostra-details-block {
  margin: 0;
  padding: 13px 14px;
  border-radius: var(--am-radius-sm);
  background: var(--am-soft);
  border: 1px solid var(--am-line);
}
.amostra-details-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--am-ink);
}
.amostra-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 6px;
  line-height: 1.4;
  color: var(--am-ink);
  font-size: 0.9rem;
}

.amostra-alert {
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--am-radius-sm);
  border-left: 4px solid #b45309;
  background: #fff7ed;
}
.amostra-alert--suspeita { border-left-color: #b91c1c; background: #fef2f2; }
.amostra-alert--alcance { border-left-color: #a16207; background: #fffbeb; }
.amostra-alert strong { display: block; margin-bottom: 3px; font-size: 0.9rem; }
.amostra-alert p { margin: 0; color: var(--am-muted); font-size: 0.86rem; line-height: 1.4; }

.amostra-cite {
  margin: 0;
  font-size: 0.76rem;
  color: var(--am-muted);
  line-height: 1.35;
}

.amostra-method-panel {
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(44, 132, 99, 0.06), transparent 50%),
    var(--panel, #fff);
}

@media (max-width: 720px) {
  .amostra-answer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.amostra-page .amostra-builder .field-grid {
    grid-template-columns: 1fr;
  }
  .amostra-hero-mark {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .amostra-mode-grid { grid-template-columns: 1fr; }
}

@media print {
  .cg-header,
  .cg-footer,
  .amostra-hero-mark,
  .amostra-builder .hero-actions,
  [data-amostra-print],
  .amostra-no-print { display: none !important; }
  body.cg-site { background: #fff !important; }
  .amostra-map { break-inside: avoid; }
  .amostra-kpi {
    background: #eef8f2 !important;
    color: #0f4a38 !important;
    border-color: rgba(15, 45, 31, 0.1) !important;
  }
}
