/* R MKT — Diagnóstico 360º */

:root {
  --green: #8EB69B;
  --green-bold: #235347;
  --green-dark: #153832;
  --green-soft: #DAF1DD;
  --green-bg: #f0faf3;
  --text: #153832;
  --muted: #5a7a72;
  --border: rgba(35, 83, 71, 0.12);
  --danger: #dc2626;
  --warning: #d97706;
  --card: #ffffff;
  --shadow: 0 12px 40px rgba(21, 56, 50, 0.08);
  --radius: 18px;
  --accent: #235347;
  --accent-strong: #153832;
}

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

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: linear-gradient(165deg, #eef8f1 0%, #f8fbf9 40%, #ffffff 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(35, 83, 71, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 83, 71, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

/* Header */
.diag-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 38, 34, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(142, 182, 155, 0.15);
}

.diag-header-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.diag-logo img {
  height: 80px;
  width: auto;
}

.diag-header-meta {
  text-align: right;
}

.diag-header-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.diag-header-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
}

.diag-back {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(218, 241, 221, 0.7);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  transition: color 0.2s;
}

.diag-back:hover { color: var(--green); }

/* Offer strip */
.diag-offer {
  background: linear-gradient(90deg, #0e2622, #235347, #0e2622);
  border-bottom: 1px solid rgba(142, 182, 155, 0.2);
}

.diag-offer-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 20px;
  font-size: 0.78rem;
  color: rgba(218, 241, 221, 0.9);
  text-align: center;
}

.diag-offer-inner strong { color: var(--green-soft); }

/* Progress */
.diag-progress-wrap {
  max-width: 920px;
  margin: 28px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.diag-progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.diag-progress-step {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}

.diag-progress-step.active { color: var(--green-bold); }
.diag-progress-step.done { color: var(--green); }

.diag-progress-bar {
  height: 4px;
  background: rgba(35, 83, 71, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.diag-progress-fill {
  height: 100%;
  width: 33%;
  background: linear-gradient(90deg, var(--green-bold), var(--green));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.diag-container {
  max-width: 920px;
  margin: 24px auto 48px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.system-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 44px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.system-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-bold), var(--green), var(--green-bold));
}

/* Steps */
.step { display: none; opacity: 0; }
.step.active {
  display: block;
  animation: diagFadeIn 0.5s ease forwards;
}

@keyframes diagFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 32px;
}

.step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-bold);
  margin-bottom: 12px;
}

.step-kicker::before,
.step-kicker::after {
  content: '';
  width: 16px;
  height: 1.5px;
  background: var(--green);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 12px;
}

.step-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Trust row step 1 */
.diag-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.diag-trust-item {
  text-align: center;
  padding: 14px 10px;
  background: var(--green-bg);
  border: 1px solid rgba(142, 182, 155, 0.25);
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green-bold);
  line-height: 1.4;
}

.diag-trust-item i {
  display: block;
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 6px;
}

/* Form */
.diag-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group { margin-bottom: 0; }

.form-group.full { grid-column: 1 / -1; }

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-bold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-label i {
  color: var(--green);
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

.input-field {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fafcfb;
  color: var(--text);
  padding: 14px 16px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-field:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(142, 182, 155, 0.2);
}

.input-field:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-row-loc {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* Buttons */
.btn-full {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(135deg, var(--green) 0%, #6fa882 100%);
  color: #0e2622;
  padding: 15px 28px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(142, 182, 155, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: inherit;
}

.btn-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(142, 182, 155, 0.55);
}

.btn-full:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--green-bold);
  border: 1.5px solid rgba(35, 83, 71, 0.25);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--green-bg);
  box-shadow: none;
}

/* Quiz */
.quiz-progress-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--green-bg);
  border-radius: 12px;
  margin-bottom: 28px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-bold);
}

.quiz-block {
  margin-bottom: 28px;
  padding: 22px;
  background: #fafcfb;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quiz-block:focus-within {
  border-color: rgba(142, 182, 155, 0.45);
  box-shadow: 0 4px 20px rgba(35, 83, 71, 0.06);
}

.quiz-block:last-of-type { margin-bottom: 32px; }

.quiz-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green-bold);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-title i { color: var(--green); font-size: 0.95rem; }

.quiz-criteria {
  font-size: 0.84rem;
  background: rgba(218, 241, 221, 0.45);
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.55;
}

.criteria-sub {
  display: block;
  color: var(--green-bold);
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  margin: 8px 0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--green-bold);
  cursor: pointer;
  margin-top: -9px;
  box-shadow: 0 2px 12px rgba(35, 83, 71, 0.35);
  border: 2px solid #fff;
  transition: background 0.2s, transform 0.15s;
}

input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.08); }

input[type=range].low-score::-webkit-slider-thumb {
  background: var(--danger);
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.4);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(220,38,38,0.15), rgba(217,119,6,0.15), rgba(35,83,71,0.15));
  border-radius: 999px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.score-value-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-bold);
  min-width: 36px;
  text-align: center;
}

.score-value-display.critical { color: var(--danger); }

/* Loading */
.loader-container {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(35, 83, 71, 0.1);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#statusMessage {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 24px;
}

.success-msg { color: var(--green-bold); }
.error-msg { color: var(--danger); }

/* Results */
.result-hero {
  text-align: center;
  padding: 32px 20px 36px;
  margin: -12px -12px 32px;
  background: linear-gradient(180deg, var(--green-bg) 0%, transparent 100%);
  border-radius: 20px 20px 0 0;
  border-bottom: 1px solid var(--border);
}

.score-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
}

.score-ring-wrap svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-ring-bg { fill: none; stroke: rgba(35, 83, 71, 0.1); stroke-width: 8; }
.score-ring-fill {
  fill: none;
  stroke: var(--green-bold);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

#finalScore {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--green-bold);
}

.result-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-status {
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-bold);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 36px;
}

.chart-box {
  background: #fafcfb;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  position: relative;
}

.chart-box.full { grid-column: 1 / -1; height: 420px; }
.chart-box.half { height: 320px; }

.chart-box canvas {
  width: 100% !important;
  height: calc(100% - 28px) !important;
}

.chart-box-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.report-section-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 40px 0 24px;
  color: var(--text);
}

.detailed-report-box {
  display: grid;
  gap: 14px;
}

.report-item {
  background: #fafcfb;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
}

.report-item.low {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(254,242,242,0.8), #fafcfb);
}

.report-item.mid {
  border-left-color: var(--warning);
  background: linear-gradient(90deg, rgba(255,251,235,0.8), #fafcfb);
}

.report-item.high {
  border-left-color: var(--green-bold);
  background: linear-gradient(90deg, rgba(240,253,244,0.8), #fafcfb);
}

.report-title {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.report-score {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  background: rgba(35, 83, 71, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.report-criteria {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  font-style: italic;
  line-height: 1.5;
}

.report-text {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.65;
}

.report-text strong { color: var(--text); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 40px;
}

/* Footer */
.diag-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.72rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.diag-footer a {
  color: var(--green-bold);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 720px) {
  .diag-form-grid { grid-template-columns: 1fr; }
  .form-row-loc { grid-template-columns: 1fr; }
  .diag-trust { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-box.full,
  .chart-box.half { grid-column: 1; height: 300px; }
  .diag-header-inner { flex-direction: column; text-align: center; }
  .diag-header-meta { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
  .spinner { animation-duration: 1.5s; }
}
