/* =========================================================
   João Gomes — Serviços de Engenharia
   Identidade: preto + vermelho do logótipo (#d41200) + branco
   ========================================================= */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --black: #111111;
  --black-2: #1c1c1c;
  --ink: #1a1a1a;
  --muted: #5f5f5f;
  --line: #e6e4e1;
  --bg: #ffffff;
  --bg-soft: #f5f4f2;
  --red: #d41200;
  --red-dark: #a90e00;
  --red-soft: rgba(212, 18, 0, .08);
  --radius: 6px;
  --max: 1160px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.62; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { line-height: 1.08; color: var(--black); margin: 0 0 .55em; font-weight: 800; letter-spacing: -.025em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
::selection { background: var(--red); color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 10px; }

/* Motivo do logótipo: três barras */
.bars { display: inline-flex; flex-direction: column; gap: 4px; vertical-align: middle; }
.bars i { display: block; height: 4px; border-radius: 4px; background: var(--black); }
.bars i:nth-child(1) { width: 22px; margin-left: 8px; }
.bars i:nth-child(2) { width: 24px; background: var(--red); }
.bars i:nth-child(3) { width: 21px; margin-left: 8px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--black); color: #bdbdbd; font-size: .84rem; }
.topbar .container { display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: #ff6a5a; }

/* ---------- Header / Nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(6px); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--black); }
.brand-mark { height: 26px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; border-left: 1px solid var(--line); padding-left: 14px; }
.brand-text strong { font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; }
.brand-text span { font-size: .74rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.nav a { display: block; padding: 10px 13px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 3px; border-radius: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]:not(.btn)::after { transform: scaleX(1); }
.nav a:hover { color: var(--black); }
.nav .btn { margin-left: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 3px; border-radius: 3px; background: var(--black); margin: 4px 0; }
.nav-toggle span:nth-child(2) { background: var(--red); width: 18px; }

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 8px 20px 18px; }
  .nav a:not(.btn)::after { left: 0; right: auto; width: 28px; bottom: 6px; }
  .nav .btn { margin: 10px 0 0; text-align: center; }
}
@media (max-width: 420px) { .brand-mark { height: 20px; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; font-family: inherit; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff !important; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff !important; }
.btn-ghost:hover { background: #fff; color: var(--black) !important; border-color: #fff; }
.btn-outline { border-color: var(--black); color: var(--black) !important; }
.btn-outline:hover { background: var(--black); color: #fff !important; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { background: var(--black); color: #cfcfcf; padding: 104px 0 96px; position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; max-width: 820px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lead { font-size: 1.2rem; max-width: 640px; margin-bottom: 1.8em; color: #d6d6d6; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; margin-bottom: 22px; }
.eyebrow::before { content: ""; width: 34px; height: 4px; border-radius: 4px; background: var(--red); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 14px 28px; flex-wrap: wrap; margin-top: 56px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.12); font-size: .92rem; color: #e6e6e6; }
.hero-badges div { display: flex; gap: 10px; align-items: center; }
.hero-badges svg { width: 20px; height: 20px; color: var(--red); flex: none; }

/* Barras de velocidade (motivo do logótipo) */
.speed { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 46%; max-width: 620px; display: flex; flex-direction: column; gap: 34px; z-index: 1; pointer-events: none; }
.speed span { display: block; height: 46px; border-radius: 46px; background: #fff; opacity: .07; animation: slide 1.1s cubic-bezier(.2,.8,.2,1) both; }
.speed span:nth-child(1) { width: 78%; margin-left: 22%; animation-delay: .05s; }
.speed span:nth-child(2) { width: 100%; background: var(--red); opacity: .9; animation-delay: 0s; }
.speed span:nth-child(3) { width: 74%; margin-left: 22%; animation-delay: .1s; }
@keyframes slide { from { transform: translateX(60%); opacity: 0; } }
.speed span:nth-child(2) { animation-name: slide-red; }
@keyframes slide-red { from { transform: translateX(60%); opacity: 0; } to { opacity: .9; } }
@media (max-width: 900px) { .speed { display: none; } .hero { padding: 72px 0 64px; } }
@media (prefers-reduced-motion: reduce) { .speed span { animation: none; } html { scroll-behavior: auto; } }

.page-hero { background: var(--black); color: #cfcfcf; padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -40px; bottom: 30px; width: 320px; height: 26px; border-radius: 26px; background: var(--red); opacity: .9; }
.page-hero::before { content: ""; position: absolute; right: -40px; bottom: 74px; width: 250px; height: 26px; border-radius: 26px; background: #fff; opacity: .07; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { max-width: 680px; margin: 0; font-size: 1.12rem; }
.breadcrumb { font-size: .82rem; margin-bottom: 14px; color: #9a9a9a; letter-spacing: .04em; }
.breadcrumb a { color: #e0e0e0; text-decoration: none; }
.breadcrumb a:hover { color: #ff6a5a; }
@media (max-width: 700px) { .page-hero::after { width: 160px; height: 16px; bottom: 18px; } .page-hero::before { width: 120px; height: 16px; bottom: 44px; } }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); }
.section-dark { background: var(--black); color: #cfcfcf; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; margin-bottom: 14px; }
.kicker::before { content: ""; width: 26px; height: 4px; border-radius: 4px; background: var(--red); }

.grid { display: grid; gap: 22px; }
.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: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } section { padding: 60px 0; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; position: relative; transition: border-color .2s, transform .2s, box-shadow .2s; }
.card::before { content: ""; position: absolute; left: 30px; top: -1px; width: 40px; height: 4px; border-radius: 0 0 4px 4px; background: var(--red); transition: width .25s; }
.card:hover { border-color: #d2cfcb; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.06); }
.card:hover::before { width: 90px; }
.card h3 { margin-top: 4px; }
.card p { color: var(--muted); }
.card .more { margin-top: auto; font-weight: 600; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; color: var(--black); }
.card .more::after { content: "→"; color: var(--red); transition: transform .15s; }
.card .more:hover::after { transform: translateX(4px); }
.card-plain::before { display: none; }
.card-plain:hover { transform: none; box-shadow: none; }
.icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red); margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; }
.icon.green { background: var(--red-soft); color: var(--red); }
.card.feature { background: var(--black); border-color: var(--black); color: #cfcfcf; }
.card.feature h3 { color: #fff; }
.card.feature p { color: #bdbdbd; }
.card.feature .more { color: #fff; }
.card.feature .icon { background: var(--red); color: #fff; }
.card.feature .tag { position: absolute; top: 22px; right: 22px; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--red); padding: 4px 10px; border-radius: 999px; }

/* Serviço detalhado */
.service-block { display: grid; grid-template-columns: 300px 1fr; gap: 48px; padding: 48px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.service-block:first-child { padding-top: 0; }
.service-block:last-child { border-bottom: 0; }
.service-block h2 { font-size: 1.6rem; }
.service-block .side p { color: var(--muted); }
@media (max-width: 800px) { .service-block { grid-template-columns: 1fr; gap: 14px; } }
.checklist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 36px; }
.checklist li { padding: 0 0 0 30px; position: relative; margin-bottom: 12px; break-inside: avoid; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .72em; width: 16px; height: 4px; border-radius: 4px; background: var(--red); }
@media (max-width: 640px) { .checklist { columns: 1; } }

/* Passos */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 0; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.steps li { padding: 28px 24px 8px 0; position: relative; }
.steps li::before { counter-increment: s; content: "0" counter(s); display: block; font-size: 2.6rem; font-weight: 800; color: var(--red); letter-spacing: -.04em; line-height: 1; margin-bottom: 14px; }
.steps li::after { content: ""; position: absolute; top: -2px; left: 0; width: 40px; height: 3px; background: var(--black); }
.steps h3 { font-size: 1.08rem; }
.steps p { color: var(--muted); margin: 0; font-size: .96rem; }
.section-dark .steps { border-color: rgba(255,255,255,.15); }
.section-dark .steps li::after { background: #fff; }
.section-dark .steps p { color: #b5b5b5; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Números / stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stat strong { display: block; font-size: 2.2rem; font-weight: 800; color: var(--black); letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Escala energética */
.energy-scale { display: flex; flex-direction: column; gap: 7px; max-width: 380px; }
.energy-scale div { color: #fff; font-weight: 800; padding: 7px 16px; border-radius: 0 999px 999px 0; font-size: .95rem; }

/* Credenciais */
.creds { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.creds li { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 10px 16px; font-size: .92rem; font-weight: 600; }

/* FAQ */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 10px; }
.faq details[open] { border-color: #d2cfcb; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--black); list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: -4px; font-size: 1.5rem; color: var(--red); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* CTA */
.cta { background: var(--red); color: #fff; border-radius: 10px; padding: 52px; display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta > * { position: relative; z-index: 1; }
.cta h2 { color: #fff; margin: 0 0 .3em; }
.cta p { margin: 0; color: #ffe6e3; font-size: 1.08rem; }
.cta .btn-primary { background: var(--black); }
.cta .btn-primary:hover { background: #000; }
@media (max-width: 640px) { .cta { padding: 34px 26px; } }

/* Contactos */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0 0 24px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list svg { width: 22px; height: 22px; color: var(--red); flex: none; margin-top: 3px; }
.contact-list a { text-decoration: none; }
.contact-list small { display: block; color: var(--muted); }
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { form .row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--black); }
input, select, textarea { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border: 1px solid #cfcbc6; border-radius: var(--radius); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.field { margin-bottom: 16px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--muted); }
.consent input { width: auto; margin-top: 4px; accent-color: var(--red); }
.hp { position: absolute; left: -5000px; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; display: none; }
.notice.ok { display: block; background: #eef8f1; color: #1d6b3a; border: 1px solid #c5e6cf; }
.notice.err { display: block; background: var(--red-soft); color: var(--red-dark); border: 1px solid #f1c3be; }

/* Texto legal */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.35rem; margin-top: 1.7em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: #a3a3a3; padding: 64px 0 26px; font-size: .94rem; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 16px; }
.site-footer a { color: #e3e3e3; text-decoration: none; }
.site-footer a:hover { color: #ff6a5a; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer .brand-text { border-color: rgba(255,255,255,.18); }
.site-footer .brand-text strong { color: #fff; }
.site-footer .brand-text span { color: #9a9a9a; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.social a:hover { background: var(--red); color: #fff; }
.social svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .84rem; }
