/* ===========================================================
   NFS-e Nacional · Prefeitura de Nova Iguaçu
   Identidade visual extraída de novaiguacu.rj.gov.br
   =========================================================== */

:root {
  --indigo: #2D2166;        /* institucional (header/rodapé/títulos) */
  --indigo-700: #241a52;
  --indigo-050: #f3f1fa;
  --orange: #E75925;        /* destaque (botões/ícones/ações) */
  --orange-600: #E65100;    /* hover */
  --ink: #26243a;
  --gray: #6D6D6D;
  --gray-200: #e6e6ea;
  --gray-100: #f4f4f6;
  --white: #ffffff;

  --font: "Inter", "SimplonBP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1160px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(45, 33, 102, 0.10);
  --shadow-sm: 0 4px 14px rgba(45, 33, 102, 0.08);
  --font-scale: 1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: calc(16px * var(--font-scale));
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;   /* trava rolagem horizontal / estouro no mobile */
}

h1, h2, h3, h4 { color: var(--indigo); line-height: 1.2; margin: 0 0 .4em; font-weight: 800; }
a { color: var(--orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--indigo); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.placeholder {
  background: #fff3cd; color: #7a5b00; font-size: .82em; font-weight: 600;
  padding: 1px 6px; border-radius: 5px; border: 1px dashed #d9b400;
  white-space: normal; overflow-wrap: anywhere;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; padding: 13px 24px;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-600); }
.btn--ghost { background: transparent; color: var(--indigo); border-color: rgba(45,33,102,.25); }
.btn--ghost:hover { border-color: var(--indigo); background: var(--indigo-050); }

/* ---------- Topbar ---------- */
.topbar { background: var(--indigo-700); color: #cfc9e6; font-size: .82rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 16px; }
.topbar__links { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar a { color: #cfc9e6; }
.topbar a:hover { color: #fff; }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.social { display: flex; gap: 10px; }
.social a { display: inline-flex; color: #cfc9e6; }
.social a:hover { color: var(--orange); }
.a11y { display: flex; gap: 4px; }
.a11y button {
  background: transparent; border: 1px solid rgba(255,255,255,.25); color: #cfc9e6;
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: .72rem; font-weight: 700;
}
.a11y button:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- Header ---------- */
.header { background: var(--indigo); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 20px; }
.header__brand img { height: 52px; width: auto; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: #eae7f5; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav__cta { background: var(--orange); color: #fff !important; padding: 9px 18px; border-radius: 999px; }
.nav__cta:hover { background: var(--orange-600); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: #fff; border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--indigo) 0%, #3a2b82 55%, #4a327f 100%); color: #fff; padding: 64px 0 72px; }
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--orange); margin: 0 0 10px; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 0 0 14px; }
.hero__lead { font-size: 1.12rem; color: #ded9f0; max-width: 34ch; margin: 0 0 28px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__actions .btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero__actions .btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* Cartão de nota decorativo */
.hero__card { display: flex; justify-content: center; }
.hero__nota { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 380px; box-shadow: 0 30px 60px rgba(0,0,0,.28); }
.hero__nota-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hero__nota-top img { height: 34px; width: auto; }
.tag { background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; letter-spacing: .05em; }
.hero__nota-line { height: 10px; background: var(--gray-200); border-radius: 6px; margin-bottom: 8px; }
.hero__nota-line.short { width: 55%; }
.hero__nota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.hero__nota-grid span { display: block; height: 7px; width: 60%; background: var(--gray-200); border-radius: 5px; margin-bottom: 6px; }
.hero__nota-grid b { display: block; height: 10px; width: 85%; background: var(--indigo-050); border-radius: 5px; }
.hero__nota-total { display: flex; align-items: center; justify-content: space-between; border-top: 2px dashed var(--gray-200); padding-top: 14px; }
.hero__nota-total span { color: var(--gray); font-size: .85rem; }
.hero__nota-total strong { color: var(--indigo); font-size: 1.3rem; }

/* ---------- Banner Atenção ---------- */
.alert { background: #fff6f1; border-top: 3px solid var(--orange); border-bottom: 1px solid #ffe0d0; }
.alert__inner { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0; }
.alert__icon { color: var(--orange); flex-shrink: 0; margin-top: 2px; }
.alert__title { color: var(--orange-600); font-size: 1.05rem; margin: 0 0 4px; }
.alert p { margin: 0; color: #5a4a42; }

/* ---------- Seções ---------- */
.section { padding: 68px 0; }
.section--muted { background: var(--gray-100); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section__head h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.section__sub { color: var(--gray); font-size: 1.05rem; margin: 0; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 26px 22px; position: relative; box-shadow: var(--shadow-sm); }
.step__num { width: 42px; height: 42px; border-radius: 12px; background: var(--indigo); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; margin-bottom: 16px; }
.step h3 { font-size: 1.12rem; margin-bottom: 6px; }
.step p { margin: 0; color: var(--gray); font-size: .95rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon { width: 58px; height: 58px; border-radius: 14px; background: var(--indigo-050); color: var(--orange); display: grid; place-items: center; margin-bottom: 18px; }
.card h3 { font-size: 1.28rem; margin-bottom: 8px; }
.card > p { color: var(--gray); margin: 0 0 18px; }
.card__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.card__list li { padding-left: 20px; position: relative; }
.card__list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.card__list a { color: var(--indigo); font-weight: 600; font-size: .95rem; }
.card__list a:hover { color: var(--orange-600); }

/* Downloads */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.download { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.download:hover { text-decoration: none; border-color: var(--orange); transform: translateY(-2px); }
.download__ext { flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px; background: var(--indigo); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .78rem; }
.download__body { flex: 1; display: flex; flex-direction: column; }
.download__body strong { color: var(--indigo); font-size: 1rem; }
.download__body small { color: var(--gray); }
.download__arrow { color: var(--orange); flex-shrink: 0; }

/* Suporte */
.support { display: grid; grid-template-columns: 1.4fr 1fr; gap: 34px; align-items: start; }
.faq details { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 4px 20px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--indigo); padding: 14px 0; list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-size: 1.5rem; color: var(--orange); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--gray); }
.contact { background: var(--indigo); color: #fff; border-radius: var(--radius); padding: 30px 28px; }
.contact h3 { color: #fff; margin-bottom: 20px; }
.contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.contact__label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #b7aee0; margin-bottom: 3px; }
.contact a { color: #fff; font-weight: 600; word-break: break-word; }
.contact a:hover { color: var(--orange); }
.contact .placeholder { color: #7a5b00; }

/* ---------- Rodapé ---------- */
.footer { background: var(--indigo); color: #cfc9e6; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; padding: 52px 0 40px; }
.footer__brand img { margin-bottom: 14px; height: 54px; width: auto; }
.footer__brand p { margin: 0; color: #b7aee0; font-size: .92rem; }
.footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.footer p { margin: 0; color: #cfc9e6; font-size: .92rem; line-height: 1.7; }
.footer a { color: #cfc9e6; }
.footer a:hover { color: var(--orange); }
.footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; }
.footer__bottom p { text-align: center; font-size: .85rem; color: #a89ecf; margin: 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 36px; }
  .hero__card { order: -1; }
  .hero__lead { max-width: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .downloads { grid-template-columns: 1fr; }
  .support { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--indigo-700); padding: 8px 0;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav.open { max-height: 420px; }
  .nav a { padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.08); }
  .nav__cta { margin: 10px 24px; text-align: center; }
  .topbar__links { display: none; }
}

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .topbar__inner { justify-content: center; }

  /* Rodapé mobile: brasão centralizado + blocos com divisórias */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 40px 0 8px;
    text-align: center;
  }
  .footer__brand { padding-bottom: 26px; }
  .footer__brand img { margin: 0 auto 14px; height: 48px; }
  .footer__col {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 24px 0;
  }
  .footer__links { align-items: center; }
  .footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); }
}

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