/* ==========================================================================
   ARQCALC — style.css
   Base: fontes, variáveis de cor (fonte única da paleta), tipografia, layout,
   cabeçalho, rodapé e secções. Componentes em components.css, ecrãs em responsive.css.
   ========================================================================== */

/* ---------- Fontes (auto-alojadas, licença em assets/fonts/LICENSE-Inter.txt) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }
/* Fonte de recurso com as medidas da Inter: evita o salto de layout (CLS) quando a Inter chega */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Helvetica'), local('Liberation Sans'); ascent-override: 90.2%; descent-override: 22.48%; line-gap-override: 0%; size-adjust: 107.4%; }

/* ---------- Paleta e tokens (decisão de 27/11: cinzento claro predominante) ---------- */
:root {
  --color-surface: #EDEDED;      /* fundo dominante */
  --color-surface-alt: #E0E0E0;  /* cabeçalho, rodapé, faixas */
  --color-white: #FFFFFF;        /* cartões, modais, formulários */
  --color-line: #B2B3B3;         /* linhas e bordas (paleta oficial) */
  --color-line-soft: #D4D4D4;
  --color-text: #1A1A1A;         /* 14,9:1 sobre #EDEDED */
  --color-text-muted: #4D4D4D;   /* 7,2:1 sobre #EDEDED */
  --color-action: #333333;       /* botões principais, item activo, foco */
  --color-action-hover: #1A1A1A;
  --color-whatsapp: #25D366;     /* só para WhatsApp, com texto escuro */
  --color-whatsapp-dark: #128C7E; /* botão flutuante, ícone branco (4,1:1) */
  --color-success-bg: #E6F2EA;
  --color-success: #1E5C36;
  --color-error-bg: #F7E6E6;
  --color-error: #8A1F1F;
  --color-notice-bg: #F4F0E4;
  --color-notice: #5C4A12;

  --font-sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius-sm: 4px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 72px;
  --transition: .25s ease;
}

/* ---------- Reset leve ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface);
  overflow-x: hidden;
}
img, picture, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--color-action); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 5000;
  background: var(--color-action); color: var(--color-white);
  padding: .75rem 1rem; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--color-text); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.005em; }
h3 { font-size: 1.15rem; }
p { max-width: 70ch; }
.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-text-muted);
  padding-bottom: .5rem; margin-bottom: .75rem;
  border-bottom: 2px solid var(--color-action);
}
.lead { font-size: 1.1rem; color: var(--color-text-muted); }
.text-muted { color: var(--color-text-muted); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section--white { background: var(--color-white); }
.section--alt { background: var(--color-surface-alt); }
.section--dark { background: var(--color-action); color: var(--color-white); }
.section--dark h2, .section--dark h3 { color: var(--color-white); }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center p { margin-inline: auto; }
.section-head p { margin-top: .75rem; }
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
main { display: block; padding-top: var(--header-h); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(224, 224, 224, .96);
  border-bottom: 1px solid var(--color-line);
  backdrop-filter: saturate(140%) blur(6px);
  transition: box-shadow var(--transition);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { height: 44px; width: auto; }
.main-nav__list { display: flex; align-items: center; gap: .25rem; list-style: none; padding: 0; }
.main-nav__link {
  display: block; padding: .55rem .9rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-muted); text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}
.main-nav__link:hover { background: rgba(51, 51, 51, .08); color: var(--color-text); }
.main-nav__link[aria-current="page"] { background: var(--color-action); color: var(--color-white); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--color-text);
  transition: background-color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: rgba(51, 51, 51, .08); }
.icon-btn svg { width: 22px; height: 22px; }
.nav-toggle { display: none; }

/* ---------- Cabeçalho de página interna ---------- */
.page-intro { padding-block: clamp(2.5rem, 6vw, 4rem) 0; }
.page-intro h1 { margin-bottom: .75rem; }

/* ---------- Rodapé ---------- */
.site-footer { background: var(--color-surface-alt); border-top: 1px solid var(--color-line); padding-top: 3.5rem; color: var(--color-text-muted); font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2rem; padding-bottom: 2.5rem; }
.footer-logo { display: inline-block; max-width: 100%; margin-bottom: 1.1rem; }
.footer-brand img { display: block; width: 263px; max-width: 100%; height: auto; }
/* Slogan sob "Arquitectura e Cálculos": o texto do logótipo começa a 37,8% da largura da imagem */
.footer-brand .footer-logo p { margin: .1rem 0 0 37.8%; font-size: .84rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; color: var(--color-text-muted); }
.footer-col h2 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1rem; color: var(--color-text); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-col a { text-decoration: none; color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-text); text-decoration: underline; }
.footer-social { display: flex; gap: .5rem; }
.footer-social a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--color-line); border-radius: 50%; color: var(--color-text); }
.footer-social a:hover { background: var(--color-white); }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid var(--color-line); padding-block: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .85rem; }

/* ---------- Faixa CTA ---------- */
.cta-band { text-align: center; }
.cta-band p { margin: .75rem auto 1.75rem; color: rgba(255, 255, 255, .85); }
.cta-band .btn-row { justify-content: center; }

/* Barra de pesquisa do cabeçalho (ecrãs largos); em ecrãs menores fica só o ícone */
.header-search { position: relative; display: flex; align-items: center; }
.header-search input { width: 230px; height: 40px; padding: 0 .9rem 0 2.4rem; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-white); font: inherit; font-size: .88rem; color: var(--color-text); }
.header-search input::placeholder { color: var(--color-text-muted); }
.header-search input:focus { outline: 2px solid var(--color-action); outline-offset: 1px; }
.header-search__icon { position: absolute; left: .8rem; display: inline-flex; color: var(--color-text-muted); pointer-events: none; }
.header-search__icon svg { width: 18px; height: 18px; }
.icon-btn--search { display: none; }
@media (max-width: 1240px) {
  .header-search { display: none; }
  .icon-btn--search { display: inline-flex; }
}

/* Rodapé: botão de pesquisa como ícone, igual às redes sociais */
.footer-social button { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--color-line); border-radius: 50%; color: var(--color-text); background: none; padding: 0; cursor: pointer; }
.footer-social button:hover { background: var(--color-white); }
/* Rodapé: "Mais…" com menu suspenso dos restantes serviços */
.footer-more { position: relative; }
.footer-more summary { list-style: none; cursor: pointer; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: .35rem; }
.footer-more summary::-webkit-details-marker { display: none; }
.footer-more summary::after { content: ""; width: .45em; height: .45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.footer-more details[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.footer-more summary:hover { color: var(--color-text); text-decoration: underline; }
.footer-more summary:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; border-radius: 2px; }
.footer-col .footer-more__menu { position: absolute; left: 0; top: calc(100% + .5rem); z-index: 20; min-width: 15rem; display: grid; gap: 0; padding: .4rem; background: var(--color-white); border: 1px solid var(--color-line); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.footer-more__menu a { display: block; padding: .55rem .7rem; border-radius: 4px; color: var(--color-text); }
.footer-col .footer-more__menu a:hover { background: var(--color-surface-alt); text-decoration: none; }
/* No computador o rodapé fica no fim da página: o menu abre para cima para não ficar cortado */
@media (min-width: 681px) { .footer-col .footer-more__menu { top: auto; bottom: calc(100% + .5rem); } }
