/* Q-Classe — folha de estilos única */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2-variations"),
       url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000;
  --night: #05090c;
  --panel: #0b1318;
  --line: #1a2a33;
  --ink: #e8f1f3;
  --mute: #93a6af;
  --neon: #38e1e6;
  --neon-dim: #13878b;
  --neon-glow: rgba(56, 225, 230, .35);

  /* escala da etiqueta energética, igual ao logótipo */
  --e1: #02a24a; --e2: #409e3d; --e3: #7cb23a; --e4: #ced219;
  --e5: #f0e100; --e6: #ddab26; --e7: #c43d27;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

/* faixa fina com as cores da etiqueta, no topo da página */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg,
    var(--e1) 0 14.28%, var(--e2) 0 28.56%, var(--e3) 0 42.84%, var(--e4) 0 57.12%,
    var(--e5) 0 71.4%, var(--e6) 0 85.68%, var(--e7) 0);
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--neon); text-underline-offset: 3px; }
a:hover { color: #8ff4f6; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; font-weight: 720; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-stretch: 112%; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; font-stretch: 106%; }
p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 4px; }

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

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--neon); color: #000; padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.4em;
  border: 1.5px solid var(--neon); border-radius: 999px;
  background: var(--neon); color: #001214;
  font: 650 1rem/1 var(--font); font-stretch: 108%;
  text-decoration: none; cursor: pointer;
  transition: box-shadow .2s, background-color .2s, color .2s;
}
.btn:hover { color: #001214; box-shadow: 0 0 0 4px rgba(56,225,230,.18), 0 0 24px var(--neon-glow); }
.btn--ghost { background: transparent; color: var(--neon); }
.btn--ghost:hover { color: var(--ink); background: rgba(56,225,230,.08); }
.btn--small { min-height: 40px; padding: 0 1.1em; font-size: .95rem; }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

/* ---------- cabeçalho ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26,42,51,.7);
}
.top__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand img { width: 52px; height: auto; }
.brand__name { font-size: 1.3rem; font-weight: 760; font-stretch: 118%; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--mute); text-decoration: none; font-size: .98rem; }
.nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { background: var(--black); position: relative; overflow: hidden; }
.hero__text { position: relative; z-index: 2; padding-top: clamp(20px, 3vw, 40px); }
.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  font-weight: 780; font-stretch: 116%;
  letter-spacing: -.02em; line-height: 1.04;
  max-width: 18ch; margin-bottom: .35em;
}
.hero__badge {
  display: inline-block; margin-bottom: 22px;
  padding: 6px 12px; border: 1px solid var(--neon-dim); border-radius: 6px;
  color: var(--neon); font-size: .92rem; font-weight: 560; font-stretch: 104%;
}
.hero__lead { max-width: 46ch; color: #b9c8ce; font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero__img { display: block; margin-top: clamp(-120px, -7vw, -24px); margin-bottom: clamp(-60px, -4vw, 0px); position: relative; z-index: 1; }
.hero__img img {
  width: 100%; max-width: 1400px; margin: 0 auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%);
  animation: neon-on 1.6s ease-out .2s both;
}
.hero::after { /* passagem suave do preto do hero para o fundo da página */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px;
  background: linear-gradient(transparent, var(--night)); z-index: 1; pointer-events: none;
}

@keyframes neon-on {
  0%   { opacity: 0; filter: brightness(.4); }
  12%  { opacity: .9; }
  16%  { opacity: .2; }
  24%  { opacity: 1; filter: brightness(1.4); }
  30%  { opacity: .5; }
  44%  { opacity: 1; filter: brightness(1); }
  100% { opacity: 1; filter: brightness(1); }
}

/* ---------- secções ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lead { color: #b9c8ce; max-width: 52ch; }
.muted { color: var(--mute); }

.services { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 28px; border-top: 1px solid var(--line); }
.service { padding: 28px 40px 8px 0; }
.service + .service { padding-left: 40px; padding-right: 0; border-left: 1px solid var(--line); }
.service h3 { font-size: 1.45rem; }
.service > p { color: #b9c8ce; }

.ticks { list-style: none; margin: 0 0 1em; padding: 0; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: .45em; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 13px; height: 7px; border-left: 2px solid var(--neon); border-bottom: 2px solid var(--neon);
  transform: rotate(-45deg) translate(1px, -3px);
}

.note { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--mute); max-width: 72ch; font-size: .98rem; }

.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.split--contact { grid-template-columns: 1.4fr 1fr; }

.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 26px 64px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -4px;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1.5px solid var(--neon); border-radius: 50%;
  color: var(--neon); font-weight: 700; font-stretch: 110%;
}
.steps li:not(:last-child)::after { /* linha entre passos */
  content: ""; position: absolute; left: 21px; top: 42px; bottom: 2px; width: 1px; background: var(--line);
}
.steps h3 { margin-bottom: .2em; }
.steps p { color: #b9c8ce; margin: 0; }

.docs { background: var(--night); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.docs h3 + .ticks { margin-top: 14px; }
.docs h3:not(:first-child) { margin-top: 28px; }
.docs p { font-size: .98rem; }

/* ---------- formulário ---------- */
.form { margin-top: 28px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label, .q__label { display: block; margin-bottom: 6px; font-size: .95rem; font-weight: 560; color: #c9d6db; }
input, select, textarea {
  width: 100%; min-height: 48px;
  padding: 11px 14px;
  background: var(--panel); color: var(--ink);
  border: 1px solid #263a45; border-radius: 8px;
  font: inherit; font-size: 1rem;
}
textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
  padding-right: 40px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(56,225,230,.2); }
[aria-invalid="true"] { border-color: var(--e7); }
.hint { color: var(--mute); font-size: .9rem; margin: -6px 0 16px; }
.hint.is-error, .form__status.is-error { color: #ff8a73; }
.form__status { min-height: 1.5em; margin: 4px 0 12px; }
.form__status.is-ok { color: var(--neon); }
.privacy { color: var(--mute); font-size: .88rem; margin-top: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form.is-sent > :not(.form__done) { display: none; }
.form__done { border: 1px solid var(--neon-dim); border-radius: var(--radius); padding: 24px; }
.form__done h3 { color: var(--neon); }

.direct { border-left: 1px solid var(--line); padding-left: clamp(24px, 4vw, 48px); }
.direct__list { list-style: none; margin: 18px 0 28px; padding: 0; }
.direct__list li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }
.direct__list span { color: var(--mute); font-size: .88rem; }
.direct__list a { font-size: 1.2rem; font-weight: 600; font-stretch: 106%; text-decoration: none; }
.cred { color: var(--mute); font-size: .95rem; }

/* ---------- rodapé ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--mute); font-size: .92rem; }
.foot__in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot strong { color: var(--ink); font-stretch: 112%; }

/* botão flutuante de WhatsApp (só no telemóvel) */
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 56px; height: 56px; border-radius: 50%;
  display: none; place-items: center;
  background: #25d366; color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.fab:hover { color: #fff; }

/* ---------- simulador ---------- */
.sim {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--night); color: var(--ink);
  box-shadow: 0 0 0 1px rgba(56,225,230,.08), 0 30px 80px rgba(0,0,0,.7);
}
.sim::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.sim[open] { animation: sim-in .22s ease-out; }
@keyframes sim-in { from { opacity: 0; transform: translateY(12px); } }

.sim__form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.sim__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.sim__head h2 { font-size: 1.35rem; margin: 0; }
.sim__x { background: none; border: 0; color: var(--mute); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.sim__x:hover { color: var(--ink); background: var(--panel); }
.sim__body { padding: 8px 24px 4px; overflow-y: auto; }

.q { border: 0; margin: 0; padding: 16px 0 6px; min-width: 0; }
.q + .q { border-top: 1px solid var(--line); }
.q legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 1rem; }
.q legend + * { clear: both; }
.q .hint { margin: 8px 0 4px; }
.q[hidden] { display: none; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; cursor: pointer; }
.pills input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pills span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid #2a404c; border-radius: 999px; color: #c9d6db;
  transition: border-color .15s, background-color .15s, color .15s;
}
.pills--tight span { min-width: 52px; justify-content: center; padding: 0 12px; }
.pills label:hover span { border-color: var(--neon-dim); }
.pills input:checked + span { background: var(--neon); border-color: var(--neon); color: #001214; font-weight: 650; }
.pills input:focus-visible + span { outline: 2px solid var(--neon); outline-offset: 3px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid #2a404c; border-radius: 999px; overflow: hidden; }
.stepper button { width: 48px; height: 44px; background: none; border: 0; color: var(--neon); font-size: 1.4rem; cursor: pointer; }
.stepper button:hover { background: var(--panel); }
.stepper button:disabled { color: #33505c; cursor: default; background: none; }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 1.1rem; }

.sim__result { padding: 16px 24px 4px; border-top: 1px solid var(--line); background: #070d11; }
.sim__note { color: var(--mute); font-size: .9rem; margin: 10px 0 8px; }

/* resultado em forma de seta da etiqueta energética */
.arrow {
  --c: #1c2c35; --t: var(--mute);
  display: flex; align-items: baseline; gap: 14px;
  width: fit-content; min-width: 240px; max-width: 100%;
  padding: 12px 52px 12px 18px;
  background: var(--c); color: var(--t);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%);
  transition: background-color .25s, color .25s;
}
.arrow__label { font-size: .9rem; font-weight: 560; }
.arrow__value { font-size: 1.7rem; font-weight: 780; font-stretch: 112%; line-height: 1.1; }
.arrow[data-state="price"] { --c: var(--neon); --t: #001214; }
.arrow[data-state="quote"] { --c: var(--e6); --t: #1a1200; }
.arrow[data-state="out"]   { --c: var(--e7); --t: #fff; }

.sim__foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 24px 18px; border-top: 1px solid var(--line); }

/* ---------- ecrãs pequenos ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .services, .split, .split--contact { grid-template-columns: 1fr; }
  .service, .service + .service { padding: 24px 0 4px; border-left: 0; }
  .service + .service { border-top: 1px solid var(--line); }
  .direct { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
}

@media (max-width: 700px) {
  body { font-size: 1rem; }
  .top__in { height: 60px; gap: 12px; }
  .brand img { width: 44px; }
  .brand__name { font-size: 1.15rem; }
  .hero__img { margin-top: 8px; }
  .hero__img img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 75%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 75%, transparent 100%);
  }
  .hero__actions .btn { flex: 1 1 100%; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .fab { display: grid; }
  .foot { padding-bottom: 88px; }

  .sim { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .sim__form { height: 100%; max-height: 100dvh; }
  .sim__body { flex: 1; }
  .sim__foot .btn { flex: 1; padding: 0 .6em; font-size: .95rem; font-stretch: 100%; white-space: nowrap; }
  .sim__head { padding: 12px 12px 10px 20px; }
  .sim__body { padding: 0 20px; }
  .sim__result { padding: 12px 20px 2px; }
  .sim__note { font-size: .85rem; margin: 8px 0 6px; }
  .sim__foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
  .arrow { padding: 10px 46px 10px 16px; }
  .arrow__value { font-size: 1.5rem; }
  .arrow { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- acrescentos: prova, migalhas, freguesias, perguntas ---------- */
.hero__proof { margin: 18px 0 0; color: var(--mute); font-size: .95rem; }
.crumbs { display: flex; gap: 8px; margin-bottom: 18px; font-size: .9rem; color: var(--mute); }
.crumbs a { color: var(--mute); }
.crumbs a:hover { color: var(--ink); }
.lead--wide { max-width: 68ch; }

.areas {
  list-style: none; margin: 32px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  border-top: 1px solid var(--line);
}
.areas li { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.areas strong { font-weight: 640; font-stretch: 104%; }
.areas span { color: var(--mute); font-size: .92rem; }

.ticks--big li { margin-bottom: .7em; }
.docs .btn { margin: 4px 0 8px; }

.faq { margin-top: 24px; max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 18px 44px 18px 0; font-weight: 620; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--neon); border-bottom: 2px solid var(--neon);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: #b9c8ce; margin: 0 0 20px; max-width: 70ch; }
.faq summary:hover { color: #fff; }

.foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot__links a { color: var(--mute); }
.foot__links a:hover { color: var(--ink); }
.privacy a { color: var(--mute); }

.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-stretch: 112%; }
.legal h2 { font-size: 1.3rem; margin-top: 2em; }
.legal p, .legal li { color: #c3d0d5; max-width: 72ch; }

/* Casa inteira visível ao abrir a página (computador) */
@media (min-width: 701px) {
  .hero__lead { max-width: 75ch; }
  .hero__img img {
    width: min(100%, 1400px, max(640px, (100svh - 410px) * 2.57));
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%),
                        linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%),
                        linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
            mask-composite: intersect;
  }
}