/* ==========================================================================
   Segursiren — folha de estilos
   Mobile-first, sem frameworks, sem fontes externas (fontes do sistema).
   ========================================================================== */

:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --blue: #0a66ff;          /* azul elétrico */
  --blue-dark: #0050d1;
  --blue-soft: #e8f0ff;
  --white: #ffffff;
  --bg-alt: #f5f8fc;
  --text: #1a2433;
  --muted: #5a6779;
  --border: #dde4ee;
  --danger: #c62828;
  --ok: #1b7f4b;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 4px 16px rgba(11, 31, 58, .06);
  --container: 1120px;
  --gutter: 16px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset leve ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[id] { scroll-margin-top: 80px; } /* não ficar tapado pelo cabeçalho fixo */
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--blue-dark); }
a:hover { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--white); padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: var(--gutter); top: var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px;
  padding: .7rem 1.25rem;
  font: inherit; font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease,
              transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(11, 31, 58, .35); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(13, 110, 253, .55); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; transition-duration: .1s; }
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-outline:hover { background: rgba(255,255,255,.1); color: var(--white); border-color: var(--white); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-block { width: 100%; }

/* ---------- Cabeçalho / menu ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--navy);
}
/* Logo: img/logo.png (navbar e rodapé), 608x200 px, sem fundo.
   Mais alto que o normal para o "Sistemas de segurança" se ler. */
.brand-logo { height: 56px; width: auto; max-width: 100%; }
@media (max-width: 480px) { .brand-logo { height: 46px; } }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--navy); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-nav ul {
  list-style: none; margin: 0; padding: .5rem var(--gutter) 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.site-nav a:not(.btn) {
  display: block; padding: .75rem .25rem;
  color: var(--navy); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.site-nav a:not(.btn):hover { color: var(--blue); }
.site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav li:last-child { margin-top: .75rem; }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open {
    display: block; position: static; box-shadow: none; border: 0; background: none;
  }
  .site-nav ul { flex-direction: row; align-items: center; padding: 0; gap: 1.5rem; }
  .site-nav a:not(.btn) { border: 0; padding: .5rem 0; }
  .site-nav li:last-child { margin-top: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--navy);
  background-image: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
}
.hero h1 { color: var(--white); max-width: 18ch; }
.hero h1 .accent { color: #5c9dff; }
.hero .lead { font-size: 1.1rem; color: #c9d6ea; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-inner { display: grid; gap: 2.25rem; grid-template-columns: 1fr; align-items: center; }
.hero-eyebrow {
  margin: 0 0 .75rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #8db8ff;
}
.hero-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.hero-stat { margin: 0; display: flex; align-items: center; gap: 1rem; }
.hero-stat strong {
  font-size: clamp(3rem, 10vw, 4.5rem); line-height: 1; letter-spacing: -.03em;
  color: var(--white);
}
.hero-stat span { color: #c9d6ea; line-height: 1.35; max-width: 16ch; }
.hero-facts {
  list-style: none; margin: 1.25rem 0 0; padding: 1.25rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: grid; gap: .8rem;
}
.hero-facts li { display: flex; align-items: flex-start; gap: .6rem; color: #dbe6f7; font-size: .95rem; }
.hero-facts svg { width: 20px; height: 20px; color: #5c9dff; flex: none; margin-top: .1rem; }
@media (min-width: 640px) {
  .hero { padding: 5rem 0 4rem; }
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.25fr .75fr; gap: 3rem; }
}

/* Animações do hero: entrada escalonada + brilho de fundo lento */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 75% 30%, rgba(92, 157, 255, .16), transparent 70%),
    radial-gradient(35% 30% at 15% 80%, rgba(92, 157, 255, .08), transparent 70%);
  animation: hero-glow 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero-eyebrow,
.hero h1,
.hero .lead,
.hero-actions,
.hero-card,
.hero-facts li { animation: hero-fade-up .9s cubic-bezier(.22, 1, .36, 1) backwards; }
.hero-eyebrow  { animation-delay: .05s; }
.hero h1       { animation-delay: .15s; }
.hero .lead    { animation-delay: .3s; }
.hero-actions  { animation-delay: .45s; }
.hero-card     { animation-name: hero-card-in; animation-duration: 1.1s; animation-delay: .35s; }
.hero-facts li:nth-child(1) { animation-delay: .75s; }
.hero-facts li:nth-child(2) { animation-delay: .9s; }
.hero-facts li:nth-child(3) { animation-delay: 1.05s; }
.hero-facts svg path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: hero-check .6s ease-out forwards;
}
.hero-facts li:nth-child(1) svg path { animation-delay: 1s; }
.hero-facts li:nth-child(2) svg path { animation-delay: 1.15s; }
.hero-facts li:nth-child(3) svg path { animation-delay: 1.3s; }
.hero-card { transition: transform .4s ease, border-color .4s ease, background-color .4s ease; }
.hero-card:hover {
  transform: translateY(-4px);
  border-color: rgba(141, 184, 255, .35);
  background-color: rgba(255, 255, 255, .08);
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-card-in {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-check { to { stroke-dashoffset: 0; } }
@keyframes hero-glow {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-4%, 3%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero-eyebrow, .hero h1, .hero .lead, .hero-actions,
  .hero-card, .hero-facts li, .hero-facts svg path { animation: none; }
  .hero-facts svg path { stroke-dashoffset: 0; }
  .hero-card, .hero-card:hover { transition: none; transform: none; }
}

/* ---------- Secções ---------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block; margin-bottom: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue);
}
.section-head p { color: var(--muted); }
@media (min-width: 640px) { .section { padding: 5rem 0; } }

/* ---------- Serviços ---------- */
.services {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .services { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 1rem;
  border-radius: 10px; background: var(--blue-soft); color: var(--blue);
}
.card .icon svg { width: 26px; height: 26px; }
.card p { color: var(--muted); margin: 0; }
.card-cta { background: var(--navy); border-color: var(--navy); color: var(--white); display: flex; flex-direction: column; }
.card-cta h3 { color: var(--white); }
.card-cta p { color: #c9d6ea; margin-bottom: 1.25rem; }
.card-cta .btn { margin-top: auto; align-self: flex-start; }

/* Cartões a entrar de lado ao fazer scroll (a classe .js-reveal é posta pelo main.js) */
.js-reveal .services .card {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
.js-reveal .services .card.is-visible { opacity: 1; transform: none; }
@media (min-width: 600px) {
  .js-reveal .services .card:nth-child(2n) { transform: translateX(40px); transition-delay: .12s; }
}
@media (min-width: 960px) {
  .js-reveal .services .card:nth-child(n) { transform: translateX(-40px); transition-delay: 0s; }
  .js-reveal .services .card:nth-child(3n+2) { transform: translateY(32px); transition-delay: .12s; }
  .js-reveal .services .card:nth-child(3n) { transform: translateX(40px); transition-delay: .24s; }
}
.js-reveal .services .card.is-visible:nth-child(n) { transform: none; }

/* ---------- Porquê nós ---------- */
.features { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
.feature { display: flex; gap: 1rem; align-items: flex-start; }
.feature .num {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: var(--white); font-weight: 700;
}
.feature p { color: var(--muted); margin: 0; }

/* Passos a entrar de lado ao fazer scroll (mesma lógica dos cartões de serviços) */
.js-reveal .features .feature {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
@media (min-width: 720px) {
  .js-reveal .features .feature:nth-child(2n) { transform: translateX(40px); transition-delay: .12s; }
}
.js-reveal .features .feature.is-visible:nth-child(n) { opacity: 1; transform: none; }

/* ---------- Marcas ---------- */
.brands {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .brands { grid-template-columns: repeat(5, 1fr); } }
.brands li {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 64px; padding: .75rem;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-weight: 700; color: var(--navy); letter-spacing: .02em;
}

/* Marcas a entrar ao fazer scroll */
.js-reveal .brands li {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
/* Telemóvel (2 colunas): cada linha é um par que aparece quando se chega a ela */
.js-reveal .brands li:nth-child(2n) { transform: translateX(40px); }
/* Computador (5 colunas): as duas linhas entram uma logo a seguir à outra */
@media (min-width: 640px) {
  .js-reveal .brands li:nth-child(n) { transform: translateX(-40px); }
  .js-reveal .brands li:nth-child(n+6) { transform: translateX(40px); transition-delay: .3s; }
}
.js-reveal .brands li.is-visible:nth-child(n) { opacity: 1; transform: none; }

/* ---------- Credenciais ---------- */
.credentials {
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .credentials { grid-template-columns: repeat(2, 1fr); } }
.credential {
  display: flex; gap: 1rem; align-items: center;
  padding: 1.25rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--white);
}
.credential svg { width: 36px; height: 36px; color: var(--blue); flex: none; }
.credential strong { display: block; color: var(--navy); }
.credential span { color: var(--muted); font-size: .95rem; }

/* ---------- Pedido de orçamento (email) ---------- */
.quote-box {
  display: grid; gap: 1.75rem; grid-template-columns: 1fr;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
@media (min-width: 900px) {
  .quote-box { grid-template-columns: 1.2fr 1fr; align-items: center; gap: 3rem; padding: 2.5rem; }
}
.quote-text ul { padding-left: 1.2rem; color: var(--muted); margin: 0; }
.quote-actions { display: grid; gap: .75rem; }
.btn-lg { min-height: 54px; padding: .9rem 1.5rem; font-size: 1.05rem; }
.quote-alt { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 440px) { .quote-alt { grid-template-columns: 1fr; } }
.quote-note { font-size: .9rem; color: var(--muted); margin: .25rem 0 0; }

/* ---------- Página interior ---------- */
.page-hero {
  background: var(--navy); color: var(--white);
  padding: 2.75rem 0 2.25rem;
}
.page-hero h1 { color: var(--white); margin: 0; }
.page-hero p { color: #c9d6ea; margin: .5rem 0 0; max-width: 60ch; }

.contact-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-item .icon {
  flex: none; width: 48px; height: 48px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue);
}
.contact-item .icon svg { width: 24px; height: 24px; }
.contact-item h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.contact-item p { margin: 0; color: var(--muted); }
.contact-item a { font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }

.company-data { margin: 0; display: grid; gap: .25rem 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .company-data { grid-template-columns: max-content 1fr; } }
.company-data dt { font-weight: 600; color: var(--navy); }
.company-data dd { margin: 0 0 .5rem; color: var(--muted); }
@media (min-width: 600px) { .company-data dd { margin: 0; } }
.placeholder { color: #a05a00; font-style: italic; }

/* ---------- Galeria ---------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { margin: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: .75rem 1rem; font-size: .95rem; color: var(--muted); }
.empty-state {
  text-align: center; padding: 3rem 1rem;
  border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted);
}

/* ---------- Texto legal ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.notice {
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  border-left: 4px solid #e0a100; background: #fff8e5; border-radius: var(--radius-sm);
  font-size: .95rem;
}

/* ---------- CTA faixa ---------- */
.cta-band {
  background: var(--blue); color: var(--white);
  padding: 2.5rem 0;
}
.cta-band .container { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.cta-band h2 { color: var(--white); margin: 0; font-size: 1.5rem; }
.cta-band p { margin: 0; color: #e3ecff; }
.cta-band .btn { background: var(--white); color: var(--blue-dark); }
.cta-band .btn:hover { background: var(--navy); color: var(--white); }
@media (min-width: 720px) {
  .cta-band .container { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Rodapé ---------- */
.site-footer {
  background: var(--navy); color: #b8c6dc;
  padding: 3rem 0 1.5rem; font-size: .95rem;
}
.site-footer a { color: #dbe6f7; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { color: var(--white); }
.site-footer h2 {
  color: var(--white); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .75rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-legal-data { margin-top: 1rem; font-size: .88rem; line-height: 1.7; }
.livro-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius-sm);
}
.livro-link svg { width: 18px; height: 18px; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; gap: .5rem;
  font-size: .85rem;
}
@media (min-width: 720px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* ---------- Restantes animações ao fazer scroll (mesmo tempo dos cartões) ---------- */
.js-reveal .section-head,
.js-reveal .company-data,
.js-reveal .credential,
.js-reveal .contact-grid .card,
.js-reveal .quote-text,
.js-reveal .quote-actions,
.js-reveal .footer-grid > div {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
.js-reveal .credential,
.js-reveal .contact-grid .card,
.js-reveal .quote-text { transform: translateX(-40px); }
@media (min-width: 640px) {
  .js-reveal .credential:nth-child(2n) { transform: translateX(40px); transition-delay: .12s; }
}
@media (min-width: 720px) {
  .js-reveal .contact-grid .card:nth-child(2n) { transform: translateX(40px); transition-delay: .12s; }
  .js-reveal .footer-grid > div:nth-child(2) { transition-delay: .12s; }
  .js-reveal .footer-grid > div:nth-child(3) { transition-delay: .24s; }
}
@media (min-width: 900px) {
  .js-reveal .quote-actions { transform: translateX(40px); transition-delay: .12s; }
}
.js-reveal .section-head.is-visible,
.js-reveal .company-data.is-visible,
.js-reveal .credential.is-visible:nth-child(n),
.js-reveal .contact-grid .card.is-visible:nth-child(n),
.js-reveal .quote-text.is-visible,
.js-reveal .quote-actions.is-visible,
.js-reveal .footer-grid > div.is-visible { opacity: 1; transform: none; }

/* Topo das páginas interiores: entra ao carregar, como o hero */
.page-hero h1, .page-hero p { animation: hero-fade-up .9s cubic-bezier(.22, 1, .36, 1) backwards; }
.page-hero p { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .page-hero h1, .page-hero p { animation: none; }
}
