/* ==========================================================================
   BOFIL-ROTA ESCOLAR — Design tokens
   Paleta extraída do logótipo: preto quente, vermelho de marca, aço/cromado.
   Tipografia: Barlow Condensed (destino/placa de rota) + Inter (leitura) +
   JetBrains Mono (códigos de zona, tarifas, nº de passe).
   Elemento-assinatura: "Linha de Rota" — uma linha de percurso com paragens,
   que atravessa as secções tal como um autocarro atravessa a cidade.
   ========================================================================== */

:root {
  --ink: #16181d;
  --ink-soft: #2b2e37;
  --red: #c41230;
  --red-deep: #7a0e22;
  --red-bright: #e31837;
  --paper: #faf8f5;
  --paper-dim: #f1eee8;
  --steel: #8b92a0;
  --steel-light: #e4e6ea;
  --steel-line: #d7dae0;
  --green-trust: #1f7a4d;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 24px rgba(22, 24, 29, 0.08);
  --shadow-lift: 0 12px 40px rgba(196, 18, 48, 0.18);
  --max-width: 1180px;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.2px;
  margin: 0 0 .4em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }

p { margin: 0 0 1em; color: var(--ink-soft); }
.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 60ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-bottom: .9em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--red);
  display: inline-block;
}

/* ---------- Botões ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow-lift); }
.btn-primary:hover { transform: translateY(-2px); background: var(--red-bright); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-header-outline { border: 2px solid var(--steel-line); color: var(--ink); background: #fff; }
.btn-header-outline:hover { border-color: var(--ink); }
.btn-outline-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--steel-line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  gap: 12px;
}
.nav-brand { display: flex; align-items: center; gap: .55em; text-decoration: none; min-width: 0; }
.nav-brand img { height: 40px; width: 40px; border-radius: 50%; flex-shrink: 0; }
.nav-brand span {
  font-family: var(--font-display); font-weight: 800; letter-spacing: .02em;
  font-size: 1.15rem; text-transform: uppercase; color: var(--ink);
  white-space: nowrap;
}
.nav-brand span em { color: var(--red); font-style: normal; }

.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; }
.nav-links li + li { margin-left: 20px; }
.nav-links a {
  text-decoration: none; font-weight: 600; font-size: .85rem;
  color: var(--ink-soft); position: relative; padding-bottom: 4px;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--red); }

/* Submenu "Mais" — agrupa itens secundários para não ocupar toda a largura */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 0 0 4px;
  font-family: var(--font-body); font-weight: 600; font-size: .85rem;
  color: var(--ink-soft);
}
.nav-dropdown-toggle:hover { color: var(--red); }
.nav-caret { font-size: .7em; transition: transform .15s ease; }
.nav-dropdown.open .nav-caret, .nav-dropdown:hover .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 4px);
  background: #fff; border: 1px solid var(--steel-line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  min-width: 160px; list-style: none; margin: 0; padding: 8px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 70;
}
.nav-dropdown-menu li { width: 100%; }
.nav-dropdown-menu li + li { margin-left: 0; }
.nav-dropdown-menu a {
  display: block; padding: 8px 10px; border-radius: 6px; font-size: .82rem;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--paper-dim); }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}

.nav-cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-cta .btn { font-size: .82rem; padding: .7em 1.3em; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer;
  color: var(--ink);
}
.mobile-only-link { display: none; }

@media (max-width: 1080px) {
  .nav-links { gap: 14px; }
  .nav-links li + li { margin-left: 14px; }
}

@media (max-width: 900px) {
  .nav { padding: 10px 16px; }
  .nav-brand img { height: 34px; width: 34px; }
  .nav-brand span { font-size: 1rem; }

  /* No mobile só ficam visíveis o botão principal e o menu hambúrguer;
     os restantes links passam a viver dentro do painel do menu. */
  .nav-cta .btn-header-outline { display: none; }
  .nav-cta .btn-primary { padding: .6em 1em; font-size: .8rem; }

  .nav-links {
    display: flex;
    position: fixed;
    top: var(--header-h, 58px); left: 0; right: 0; bottom: 0;
    width: 100%; height: calc(100vh - var(--header-h, 58px));
    background: var(--paper); flex-direction: column;
    align-items: stretch;
    padding: 24px 20px; gap: 4px; margin: 0;
    transform: translateX(100%); transition: transform .25s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    z-index: 60;
  }
  .nav-links li { width: 100%; }
  .nav-links li + li { margin-left: 0; }
  .nav-links a { display: block; font-size: .95rem; padding: 12px 4px; border-bottom: 1px solid var(--steel-line); }
  .nav-links.open { transform: translateX(0); }

  /* No mobile o "Mais" deixa de ser um popover flutuante e passa a expandir inline */
  .nav-dropdown-toggle {
    width: 100%; justify-content: space-between; font-size: .95rem;
    padding: 12px 4px; border-bottom: 1px solid var(--steel-line);
  }
  .nav-dropdown-menu {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    display: none; box-shadow: none; border: none; border-radius: 0;
    padding: 0 0 0 14px; margin-top: 0;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { font-size: .9rem; padding: 10px 4px; border-bottom: 1px dashed var(--steel-line); }

  .mobile-only-link { display: block; }
  .mobile-only-link a { color: var(--red); }

  .nav-toggle { display: flex; }
}

@media (max-width: 380px) {
  .nav-brand span { display: none; }
}

/* ---------- Linha de Rota (elemento-assinatura) ---------- */
.linha-rota {
  position: relative;
  padding-left: 46px;
}
.linha-rota::before {
  content: "";
  position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px;
  background-image: linear-gradient(var(--steel) 60%, transparent 0%);
  background-size: 2px 12px; background-repeat: repeat-y;
}
.paragem {
  position: relative; margin-bottom: 40px;
}
.paragem:last-child { margin-bottom: 0; }
.paragem::before {
  content: attr(data-stop);
  position: absolute; left: -46px; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--font-mono); font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 5px var(--paper);
}
.paragem.is-active::before { background: var(--red); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--ink) 0%, #23262f 55%, var(--red-deep) 130%);
  color: #fff;
  overflow: hidden;
  padding: 92px 0 110px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 64px);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; }
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero h1 em { color: var(--red-bright); font-style: normal; }
.hero .lede { color: rgba(255,255,255,.82); font-size: 1.2rem; }
.hero-ctas { display: flex; gap: 16px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 50px; flex-wrap: wrap; }
.hero-stats > * + * { margin-left: 32px; }
.hero-stat { margin-bottom: 8px; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 2.1rem; color: var(--red-bright); }
.hero-stat span { font-size: .82rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .06em; }

.hero-badge {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(6px);
}
.hero-badge .route-svg { width: 100%; height: auto; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Secções ---------- */
.section { padding: 84px 0; }
.section-dim { background: var(--paper-dim); }
.section-ink { background: var(--ink); color: #fff; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink p { color: rgba(255,255,255,.75); }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Grelhas de cartões ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--steel-line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: .35em; }
.card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--paper-dim); display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; font-size: 1.4rem; color: var(--red);
}

.pill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pill-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-weight: 500; color: var(--ink-soft);
}
.pill-list li::before {
  content: "✓"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-trust); color: #fff; font-size: .75rem;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
  margin-right: 12px;
}
.pill-list.cross li::before { content: "—"; background: var(--steel); }

/* ---------- Tabela de tarifário ---------- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.table-scroll .tarifa-table { box-shadow: none; border-radius: 0; }
.tarifa-table { width: 100%; min-width: 480px; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.tarifa-table th, .tarifa-table td { padding: 18px 20px; text-align: left; border-bottom: 1px solid var(--steel-line); }
.tarifa-table th { background: var(--ink); color: #fff; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: .92rem; }
.tarifa-table td.valor { font-family: var(--font-mono); font-weight: 700; color: var(--red); font-size: 1.05rem; }
.tarifa-table tr:last-child td { border-bottom: none; }
.zona-tag {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 700;
  background: var(--paper-dim); color: var(--ink); padding: 4px 10px; border-radius: 999px;
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--steel-line); padding: 22px 0; }
.faq-item summary {
  cursor: pointer; list-style: none; font-family: var(--font-display); text-transform: uppercase;
  font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.6rem; color: var(--red); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: 12px; }

/* ---------- Formulários ---------- */
.form-card { background: #fff; border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-card); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--steel-line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; background: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red); background: #fff;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand { display: flex; align-items: center; gap: .6em; margin-bottom: 14px; }
.footer-brand img { height: 40px; width: 40px; border-radius: 50%; }
.footer-brand span { font-family: var(--font-display); font-weight: 800; color: #fff; font-size: 1.2rem; text-transform: uppercase; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; margin-bottom: 16px; text-transform: uppercase; font-family: var(--font-mono); font-weight: 600; }
.footer-col a, .footer-col p { display: block; color: rgba(255,255,255,.68); text-decoration: none; margin-bottom: 10px; font-size: .94rem; }
.footer-col a:hover { color: var(--red-bright); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: rgba(255,255,255,.5); }
.tagline-quote { font-style: italic; color: rgba(255,255,255,.5); }

/* ---------- Alerts ---------- */
.alert { padding: 16px 20px; border-radius: var(--radius-sm); margin-bottom: 24px; font-weight: 500; }
.alert-sucesso { background: #e7f5ec; color: var(--green-trust); border: 1px solid #b9e3c6; }
.alert-erro { background: #fbe9ec; color: var(--red-deep); border: 1px solid #f0b9c2; }

/* ---------- Página interior genérica ---------- */
.page-hero {
  background: var(--ink); color: #fff; padding: 64px 0 56px;
}
.page-hero .eyebrow { color: var(--red-bright); }
.page-hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.2rem); }
