/* ===================================================
   entregas.saysix.com.br — Comparador de Fretes
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-light: #e0e7ff;
  --success: #10b981;
  --warning: #f59e0b;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; color: var(--brand);
}
.logo svg { color: var(--brand); }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--brand); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  padding: 64px 0 72px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  max-width: 680px;
  margin: 0 auto 16px;
}
.highlight { background: rgba(255,255,255,.25); border-radius: 6px; padding: 0 6px; }
.hero-sub { color: rgba(255,255,255,.85); font-size: 1.05rem; max-width: 500px; margin: 0 auto; }

/* ── Calculadora ── */
.section-calc { padding: 40px 0 60px; }

.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin-top: -40px;
  position: relative;
  z-index: 10;
}
.calc-card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 24px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; font-weight: 500; color: var(--muted); }

.input-with-icon { position: relative; }
.input-with-icon svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted);
}
.input-with-icon input { padding-left: 34px !important; }

input[type="text"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  background: var(--white);
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* Dimensões toggle */
.dimensoes-toggle {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 14px;
  background: var(--bg); border-radius: 8px;
  cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--muted);
  user-select: none; transition: background .2s;
}
.dimensoes-toggle:hover { background: var(--brand-light); color: var(--brand); }
.dimensoes-toggle svg:first-child { width: 16px; height: 16px; }
.chevron { margin-left: auto; width: 16px; height: 16px; transition: transform .3s; }
.chevron.open { transform: rotate(180deg); }

.dimensoes-panel { margin-top: 12px; }
.hidden { display: none !important; }

/* Botão calcular */
.btn-calcular {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
}
.btn-calcular:hover { background: var(--brand-dark); }
.btn-calcular:active { transform: scale(.99); }
.btn-calcular svg { width: 18px; height: 18px; }
.btn-calcular:disabled { background: #a5b4fc; cursor: not-allowed; }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Resultado ── */
.resultado { margin-top: 28px; }
.resultado-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.resultado-header h3 { font-size: 1.1rem; font-weight: 600; }
.rota-badge {
  background: var(--brand-light); color: var(--brand);
  padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600;
}

.resultado-grid { display: grid; gap: 12px; }

.frete-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s, border-color .2s;
  cursor: default;
}
.frete-card:hover { box-shadow: var(--shadow-lg); border-color: var(--brand); }
.frete-card.melhor { border-color: var(--success); background: #f0fdf4; }
.frete-card.mais-rapido { border-color: var(--warning); background: #fffbeb; }

.carrier-logo {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}

.frete-info { flex: 1; min-width: 0; }
.frete-nome { font-weight: 600; font-size: .95rem; }
.frete-servico { font-size: .8rem; color: var(--muted); margin-top: 2px; }

.frete-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 20px; margin-top: 4px; display: inline-block;
}
.badge-barato { background: #d1fae5; color: #065f46; }
.badge-rapido { background: #fef3c7; color: #92400e; }

.frete-prazo {
  text-align: center; flex-shrink: 0;
  font-size: .85rem; color: var(--muted);
}
.frete-prazo strong { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text); }

.frete-preco {
  text-align: right; flex-shrink: 0;
  font-size: 1.35rem; font-weight: 700; color: var(--brand);
}
.frete-preco small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }

/* erro */
.erro-msg {
  margin-top: 16px;
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #b91c1c; border-radius: 8px; padding: 14px 16px;
  font-size: .9rem;
}

/* ── Info sections ── */
.section-info, .section-carriers, .section-api {
  padding: 64px 0;
}
.section-info { background: var(--white); }
.section-carriers { background: var(--bg); }
.section-api { background: var(--white); }

.section-title {
  font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 40px;
}

.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { text-align: center; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; margin: 0 auto 14px;
}
.step h4 { font-size: .95rem; margin-bottom: 6px; }
.step p { font-size: .85rem; color: var(--muted); }

.carriers-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.carrier-badge {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 20px;
  font-size: .9rem; font-weight: 500;
}

.api-desc { text-align: center; color: var(--muted); margin-bottom: 28px; }
.api-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 8px; padding: 12px 16px;
  font-family: monospace; font-size: .9rem; margin-bottom: 16px;
}
.api-method {
  background: var(--brand); color: white;
  padding: 3px 9px; border-radius: 5px; font-size: .8rem; font-weight: 700;
}
.code-block {
  background: #1e293b; border-radius: 8px; padding: 20px 24px; overflow-x: auto;
}
.code-block pre { color: #94a3b8; font-size: .85rem; line-height: 1.8; }
.code-block code { font-family: 'Fira Code', monospace; }

/* ── Footer ── */
.footer {
  background: var(--text); color: rgba(255,255,255,.7);
  text-align: center; padding: 28px 0;
  font-size: .85rem;
}
.footer p + p { margin-top: 6px; }
.footer-sub { font-size: .8rem; }
.footer a { color: rgba(255,255,255,.6); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .calc-card { padding: 20px 16px; }
  .frete-card { flex-wrap: wrap; }
  .nav { display: none; }
}
