/* ==========================================================================
   VS Projetos de Engenharia — cores retiradas do logótipo
   ========================================================================== */
:root {
  --navy: #344f6c;
  --navy-900: #1f3247;
  --navy-950: #16243a;
  --teal: #3bc5c7;
  --teal-600: #24a3a5;
  --teal-50: #e9f8f8;
  --ink: #1d2a38;
  --text: #4a5868;
  --muted: #8593a3;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-alt: #f5f8fa;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 50, 71, .08);
  --shadow-lg: 0 20px 50px rgba(31, 50, 71, .14);
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.65; font-size: 16px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
.muted { color: var(--muted); }
.icon { flex-shrink: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 600; color: var(--teal-600); margin-bottom: .9em; }
.eyebrow a { color: inherit; }
.lead { font-size: 1.15rem; color: var(--text); max-width: 640px; }

/* Botões ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: .5em; font-family: var(--font-head); font-weight: 600; font-size: .95rem; padding: .9em 1.6em; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: all .2s ease; white-space: nowrap; }
.btn-sm { padding: .6em 1.2em; font-size: .88rem; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--teal); color: #fff; }
.btn-outline-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.1); color: #fff; }

/* Cabeçalho --------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: box-shadow .2s, border-color .2s; }
.site-header.scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(31,50,71,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand img { height: 58px; width: auto; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { font-family: var(--font-head); font-weight: 500; font-size: .95rem; color: var(--navy); position: relative; padding: 6px 0; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--teal); transition: width .25s; }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; color: var(--navy); cursor: pointer; padding: 8px; }
.header-call { display: none; align-items: center; gap: 6px; margin-left: auto; margin-right: 6px; background: var(--teal); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: .9rem; padding: 10px 16px; border-radius: 999px; }
.header-call:hover, .header-call:active { background: var(--navy); color: #fff; }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy) 100%); color: #d8e2ec; padding: clamp(80px, 12vw, 150px) 0 clamp(90px, 12vw, 160px); }
.hero h1 { color: #fff; max-width: 820px; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero .lead { color: #c3d0dd; }
.hero .eyebrow { color: var(--teal); }
.hero-inner { position: relative; z-index: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero .btn-ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.hero .btn-ghost:hover { background: #fff; color: var(--navy); }
/* Linhas inspiradas no edifício do logótipo */
.hero-lines { position: absolute; right: -40px; top: 50%; transform: translateY(-50%) skewY(-8deg); width: min(560px, 55vw); display: grid; gap: 22px; opacity: .9; }
.hero-lines span { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, transparent, var(--teal)); opacity: .18; animation: slide 1s ease both; }
.hero-lines span:nth-child(odd) { opacity: .28; }
.hero-lines span:nth-child(n) { animation-delay: calc(var(--i, 0) * 1ms); }
@keyframes slide { from { transform: translateX(80px); opacity: 0; } }

.page-hero { background: linear-gradient(135deg, var(--navy-950), var(--navy)); color: #c3d0dd; padding: 80px 0 70px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px; border: 40px solid var(--teal); opacity: .08; border-radius: 50%; }
.page-hero h1 { color: #fff; max-width: 820px; }
.page-hero .eyebrow { color: var(--teal); }
.page-hero .lead { color: #c3d0dd; margin: 0; }

/* Secções ----------------------------------------------------------------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }

.stats { background: #fff; border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 40px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.8rem); color: var(--navy); line-height: 1; margin-bottom: 8px; }
.stat span { font-size: .92rem; color: var(--muted); }

/* Serviços */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.service-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; color: var(--text); transition: all .25s; display: block; }
.service-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-4px); color: var(--text); }
.service-card p { font-size: .94rem; margin: 0; }
.service-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--teal-50); color: var(--teal-600); margin-bottom: 18px; transition: all .25s; }
.service-card:hover .service-icon { background: var(--teal); color: #fff; }
.service-icon.lg { width: 72px; height: 72px; margin: 0; }

.service-list { display: grid; gap: 18px; }
.service-row { display: grid; grid-template-columns: auto 1.1fr 1.4fr auto; gap: 30px; align-items: center; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.service-row h2 { font-size: 1.3rem; margin-bottom: .3em; }
.service-row p { margin: 0; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--bg-alt); border: 1px solid var(--line); color: var(--navy); font-size: .84rem; padding: 5px 12px; border-radius: 999px; }

.checklist { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); }
.checklist .icon { color: var(--teal); margin-top: 3px; }

.process { display: grid; gap: 16px; }
.process-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.process-row .process-step { flex-direction: column; }
.process-step { display: flex; gap: 20px; background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.process-step h3 { margin-bottom: .3em; }
.process-step p { margin: 0; font-size: .94rem; }
.num { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; color: var(--teal); line-height: 1; }

/* Projetos */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .25s, box-shadow .25s; }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: var(--text); }
.project-card.hidden { display: none; }
.project-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--navy); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project-card:hover .project-media img { transform: scale(1.05); }
.tag { position: absolute; left: 16px; top: 16px; background: rgba(255,255,255,.95); color: var(--navy); font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.project-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.2rem; margin-bottom: .2em; }
.project-body .meta { color: var(--muted); font-size: .88rem; margin-bottom: .8em; }
.project-body p:not(.meta) { font-size: .94rem; }
.link-arrow { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--teal-600); }

.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background:
  repeating-linear-gradient(-8deg, transparent 0 26px, rgba(59,197,199,.16) 26px 38px),
  linear-gradient(135deg, var(--navy-900), var(--navy)); }
.placeholder span { font-family: var(--font-head); font-weight: 700; font-size: 4rem; color: rgba(255,255,255,.22); }
.placeholder.large { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.placeholder.large span { font-size: 8rem; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter { font-family: var(--font-head); font-weight: 500; font-size: .9rem; border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 9px 20px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.filter:hover { border-color: var(--navy); }
.filter.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.project-detail { display: grid; gap: 50px; }
.project-hero-img img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.project-info { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; }
.facts { margin: 0; background: var(--bg-alt); border-radius: var(--radius); padding: 10px 28px; }
.facts > div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border: 0; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }

/* Sobre */
.values { display: grid; gap: 18px; }
.value { padding: 26px 28px; border-left: 4px solid var(--teal); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
.value p { margin: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; }
.team-card { text-align: center; padding: 36px 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.team-card p { color: var(--muted); margin: 0; font-size: .93rem; }
.avatar { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--navy)); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; }

/* Contactos */
.contact-grid { display: grid; grid-template-columns: 1fr 1.8fr; gap: 50px; align-items: start; }
.contact-info { display: grid; gap: 14px; }
.info-item { display: flex; gap: 18px; padding: 22px; background: var(--bg-alt); border-radius: var(--radius); }
.info-item > .icon { color: var(--teal-600); }
.info-item h3 { font-size: .95rem; margin-bottom: .2em; }
.info-item p, .info-item a { margin: 0; color: var(--ink); }
.info-item small { display: block; color: var(--muted); font-size: .75rem; }
.contact-form { background: #fff; padding: clamp(24px, 4vw, 44px); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.contact-form h2 { font-size: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(59,197,199,.15); background: #fff; }
.field.invalid input, .field.invalid textarea { border-color: #d64545; }
.field .error { display: block; color: #c43c3c; font-size: .84rem; margin-top: 5px; }
.field.checkbox label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); }
.field.checkbox input { width: auto; margin-top: 5px; accent-color: var(--teal); }
.alert { background: #fdecec; color: #a33; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.map iframe { display: block; width: 100%; height: 380px; border: 0; filter: grayscale(.4); }

.center-page { text-align: center; min-height: 50vh; display: grid; place-items: center; }
.center-page .lead { margin-inline: auto; margin-bottom: 30px; }
.big-check { display: inline-grid; place-items: center; width: 90px; height: 90px; border-radius: 50%; background: var(--teal-50); color: var(--teal-600); margin-bottom: 24px; }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; }

/* CTA + Rodapé */
.cta-band { background: linear-gradient(120deg, var(--teal-600), var(--teal)); color: #fff; padding: 56px 0; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { margin: 0; opacity: .92; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.site-footer { background: var(--navy-950); color: #9fb0c2; padding: 70px 0 0; font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.4fr; gap: 40px; padding-bottom: 50px; }
.footer-logo { height: 70px; width: auto; margin-bottom: 18px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { color: #c7d3df; }
.site-footer a:hover { color: var(--teal); }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; }
.contact-list .icon { color: var(--teal); margin-top: 3px; }
.social { display: flex; gap: 10px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); }
.social a:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; font-size: .85rem; color: var(--muted); }

/* Admin */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: var(--bg-alt); color: var(--ink); }
.admin-table .msg { white-space: pre-wrap; max-width: 420px; }

/* Animação ao entrar no ecrã */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-lines span { animation: none; }
}

/* Responsivo --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-row { grid-template-columns: auto 1fr; }
  .service-row .chips, .service-row .btn { grid-column: 2; justify-self: start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .process-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --header-h: 70px; }
  .brand img { height: 46px; }
  .nav-toggle { display: block; }
  .header-call { display: inline-flex; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 12px 20px 24px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(-120%); visibility: hidden; transition: transform .3s, visibility .3s; }
  .nav.open { transform: none; visibility: visible; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: 16px; justify-content: center; }
  .split, .contact-grid, .project-info { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .hero-lines { opacity: .45; }
}
@media (max-width: 600px) {
  .services-grid, .projects-grid, .form-row, .footer-grid, .process-row { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr; padding: 24px; }
  .service-row .chips, .service-row .btn { grid-column: auto; }
  .hero-actions .btn, .cta-actions .btn { width: 100%; justify-content: center; }
  .form-row { gap: 0; }
}
@media (max-width: 360px) {
  .header-call span { display: none; }
  .header-call { padding: 10px 12px; }
}
