/* ============================================================
   Resgate do Plano Piloto — Folha de estilos compartilhada
   ============================================================ */

:root {
  --azul:         #185FA5;
  --azul-escuro:  #0f4278;
  --azul-claro:   #e8f0f9;
  --verde:        #1D9E75;
  --verde-escuro: #146b4f;
  --verde-claro:  #e6f7f2;
  --branco:       #ffffff;
  --cinza-f:      #f7f7f5;
  --cinza-e:      #e8e8e4;
  --cinza-9:      #9b9b9b;
  --cinza-6:      #6b6b6b;
  --texto:        #1a1a1a;
  --radius:       4px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
}

/* ─── Reset & Base ──────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--texto);
  background: var(--branco);
}

img { max-width: 100%; display: block; }
a { color: var(--azul); }

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  color: var(--texto);
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p  { margin-top: 0; }

/* ─── Layout ────────────────────────────────────────────────── */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--cinza-f);
}

.grid   { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ─── Header / Nav ──────────────────────────────────────────── */

.site-header {
  background: var(--azul);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(15,66,120,0.35);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
}

.site-logo small {
  display: block;
  font-size: 0.7rem;
  font-family: 'Source Serif 4', serif;
  font-weight: 300;
  opacity: 0.8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.site-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: background 0.18s;
}

.site-nav a:hover { background: rgba(255,255,255,0.14); color: #fff; }

.site-nav .btn-nav {
  background: var(--verde);
  color: #fff !important;
  font-weight: 600;
}

.site-nav .btn-nav:hover { background: var(--verde-escuro); }

/* ─── Botões ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s;
  line-height: 1;
}

.btn-primary   { background: var(--azul);  color: #fff; border-color: var(--azul); }
.btn-primary:hover { background: var(--azul-escuro); border-color: var(--azul-escuro); }

.btn-secondary { background: var(--verde); color: #fff; border-color: var(--verde); }
.btn-secondary:hover { background: var(--verde-escuro); border-color: var(--verde-escuro); }

.btn-outline   { background: transparent; color: var(--azul); border-color: var(--azul); }
.btn-outline:hover { background: var(--azul); color: #fff; }

.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.65); }
.btn-outline-white:hover { background: rgba(255,255,255,0.14); border-color: #fff; }

.btn-lg  { padding: 0.95rem 2.4rem; font-size: 1.1rem; }
.btn-sm  { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Cards ─────────────────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card--border {
  border: 1.5px solid var(--cinza-e);
  box-shadow: none;
}

/* ─── Formulários ───────────────────────────────────────────── */

.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-label .req { color: #c0392b; margin-left: 0.2rem; }

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--cinza-e);
  border-radius: var(--radius);
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  color: var(--texto);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}

.form-control::placeholder { color: var(--cinza-9); }
.form-hint { font-size: 0.85rem; color: var(--cinza-6); margin-top: 0.3rem; }

.radio-group,
.checkbox-group { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }

.radio-item,
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.5;
}

.radio-item input,
.checkbox-item input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: var(--azul);
  cursor: pointer;
  flex-shrink: 0;
}

/* Escala de avaliação 1-5 */
.rating-group { margin-top: 0.4rem; }

.rating-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.rating-options label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.rating-options input[type="radio"] { display: none; }

.rating-btn {
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--cinza-e);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.15s;
  background: #fff;
  color: var(--cinza-6);
}

.rating-options label:hover .rating-btn { border-color: var(--azul); color: var(--azul); }

.rating-options input:checked + .rating-btn {
  background: var(--azul);
  border-color: var(--azul);
  color: #fff;
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--cinza-9);
}

/* ─── Steps / Progresso ─────────────────────────────────────── */

.progress-steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 3rem;
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 1rem;
  left: calc(50% + 1rem);
  right: calc(-50% + 1rem);
  height: 2px;
  background: var(--cinza-e);
}

.progress-step:last-child::after { display: none; }
.progress-step.done::after       { background: var(--azul); }

.step-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--cinza-e);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  color: var(--cinza-9);
  transition: all 0.2s;
}

.progress-step.active .step-dot {
  border-color: var(--azul);
  background: var(--azul);
  color: #fff;
  box-shadow: 0 0 0 4px var(--azul-claro);
}

.progress-step.done .step-dot {
  border-color: var(--azul);
  background: var(--azul-claro);
  color: var(--azul);
}

.step-label {
  font-size: 0.68rem;
  color: var(--cinza-9);
  margin-top: 0.4rem;
  text-align: center;
  line-height: 1.25;
  max-width: 5.5rem;
}

.progress-step.active .step-label { color: var(--azul); font-weight: 600; }
.progress-step.done .step-label   { color: var(--cinza-6); }

/* ─── Alertas / Feedback ────────────────────────────────────── */

.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: none;
}

.alert.show { display: block; }

.alert-success {
  background: var(--verde-claro);
  color: var(--verde-escuro);
  border-left: 4px solid var(--verde);
}

.alert-error {
  background: #fdecea;
  color: #c0392b;
  border-left: 4px solid #c0392b;
}

/* ─── Stats (dados.html) ────────────────────────────────────── */

.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--azul);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  color: var(--cinza-6);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Gráfico de barras horizontal (CSS puro) */
.bar-chart { display: flex; flex-direction: column; gap: 1rem; }

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 3rem;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  font-size: 0.88rem;
  color: var(--cinza-6);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: var(--cinza-e);
  border-radius: 3px;
  height: 1.4rem;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--azul);
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.bar-fill--verde { background: var(--verde); }

.bar-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto);
}

/* Ranking de problemas */
.problem-list { display: flex; flex-direction: column; gap: 0.75rem; }

.problem-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--cinza-f);
  border-radius: var(--radius);
}

.problem-rank {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--azul);
  width: 2rem;
  flex-shrink: 0;
  text-align: center;
}

.problem-name { flex: 1; font-weight: 600; }

.problem-count {
  font-size: 0.85rem;
  color: var(--cinza-6);
  white-space: nowrap;
}

/* ─── Footer ────────────────────────────────────────────────── */

.site-footer {
  background: var(--texto);
  color: rgba(255,255,255,0.65);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
  margin-top: 5rem;
}

.site-footer a { color: rgba(255,255,255,0.65); text-decoration: none; }
.site-footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-title {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
}

/* ─── Utilidades ────────────────────────────────────────────── */

.text-azul   { color: var(--azul); }
.text-verde  { color: var(--verde); }
.text-center { text-align: center; }
.text-muted  { color: var(--cinza-6); }

.divider { width: 3rem; height: 3px; background: var(--verde); margin: 1.25rem 0; }
.divider--center { margin: 1.25rem auto; }

.tag {
  display: inline-block;
  background: var(--azul-claro);
  color: var(--azul);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag--verde { background: var(--verde-claro); color: var(--verde-escuro); }

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--cinza-9);
  font-size: 0.95rem;
}

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--cinza-e);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

/* ─── Responsivo ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .section { padding: 3rem 0; }

  .site-nav a:not(.btn-nav) { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .rating-btn { width: 2.5rem; height: 2.5rem; font-size: 1rem; }

  .bar-row { grid-template-columns: 80px 1fr 2.5rem; }
}

@media (max-width: 480px) {
  .btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }
  .step-label { display: none; }
}
