/* ==========================================================================
   Header Escuro Translúcido, Mega-Menu, Drawer Mobile, Actionbar e Rodapé
   ========================================================================== */

.nav {
  --bg: var(--au-bg);
  --surface: var(--au-surface);
  --ink: var(--au-ink);
  --muted: var(--au-muted);
  --accent: var(--au-gold);
  --accent-ink: #090a0c;
  --action: var(--au-gold);
  --action-ink: #090a0c;
  --card: var(--au-surface);
  --line: var(--au-line);
  --line-strong: var(--au-line-strong);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav);
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--au-line);
  color: var(--au-ink);
}
/* .nav::before aplica o glass sem criar containing block para o drawer fixed */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(9, 10, 12, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.nav__bar { height: 100%; display: flex; align-items: center; gap: var(--s-8); }
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font: 600 22px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--au-ink);
  flex: none;
}
.nav__logo svg, .nav__logo img { height: 24px; width: auto; }

/* Marca oficial Launea Software — Rubrica L Caligráfica */
.mark { display: inline-block; flex: none; width: 22px; height: 22px; }
.mark.mark--launea {
  width: 28px;
  height: 28px;
  background: none;
  -webkit-mask: none;
  mask: none;
  color: var(--au-gold);
  fill: var(--au-gold);
  transition: color 160ms ease, fill 160ms ease;
}
.mark.mark--launea path { fill: var(--au-gold); transition: fill 160ms ease; }
.nav__logo:hover .mark.mark--launea,
.nav__logo:focus-visible .mark.mark--launea { color: var(--au-gold-light); fill: var(--au-gold-light); }
.nav__logo:hover .mark.mark--launea path,
.nav__logo:focus-visible .mark.mark--launea path { fill: var(--au-gold-light); }

.nav__links { display: flex; align-self: stretch; gap: var(--s-1); flex: 1; min-width: 0; }
.nav__item { display: flex; align-items: center; height: 100%; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  height: 36px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgba(244, 244, 246, 0.74);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__link:hover,
.nav__link:focus-visible,
.nav__item:hover > .nav__link,
.nav__item:focus-within > .nav__link { color: var(--au-ink); }
.nav__link::before {
  content: "";
  position: absolute;
  left: var(--s-3);
  right: var(--s-3);
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--au-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}
.nav__link:hover::before,
.nav__link:focus-visible::before,
.nav__item:hover > .nav__link::before,
.nav__item:focus-within > .nav__link::before { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--s-3);
  right: var(--s-3);
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--au-gold);
}
.nav__link .chev { width: 12px; height: 12px; opacity: 0.6; transition: transform var(--dur) var(--ease); }
.nav__expand { display: none; }
.nav__actions { display: flex; align-items: center; gap: var(--s-4); flex: none; }
.nav__actions .btn { height: var(--btn-h); padding-inline: var(--s-5); font-size: 15px; }
.nav__actions .btn--primary { background: var(--au-gold); color: #090a0c; border-color: var(--au-gold); }
.nav__actions .btn--primary:hover,
.nav__actions .btn--primary:focus-visible { background: var(--au-gold-light); border-color: var(--au-gold-light); color: #090a0c; }
.nav__toggle { display: none; border-radius: var(--r-btn); border-color: var(--au-line-strong); color: var(--au-ink); }
.nav__toggle:hover { background: rgba(255, 255, 255, 0.08); }

@media (min-width: 1024px) and (max-width: 1279px) {
  .nav__bar { gap: var(--s-6); }
  .nav__link { padding: 0 var(--s-2); }
  .nav__link::before, .nav__link[aria-current="page"]::after { left: var(--s-2); right: var(--s-2); }
  .nav__links { gap: 0; }
}

/* Mega-menu desktop escuro */
.nav__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: rgba(14, 16, 20, 0.98);
  color: var(--au-ink);
  border-top: 1px solid var(--au-line);
  border-bottom: 1px solid var(--au-line);
  box-shadow: 0 28px 60px -20px rgba(0, 0, 0, 0.85);
  padding: var(--s-7) 0 var(--s-8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--m-close) var(--m-ease), transform var(--m-close) var(--m-ease), visibility 0s linear var(--m-close);
}
@media (min-width: 1024px) {
  .nav__item:is(:hover, :focus-within) > .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--m-panel) var(--m-ease) 150ms, transform var(--m-panel) var(--m-ease) 150ms, visibility 0s linear 150ms;
  }
  .nav.m-menu-open .nav__menu,
  .nav.m-menu-open .nav__item:is(:hover, :focus-within) > .nav__menu { transition-duration: 0s; transition-delay: 0s; }
  .nav__item:hover > .nav__link .chev,
  .nav__item:focus-within > .nav__link .chev { transform: rotate(180deg); }
}
.menu-col { display: grid; gap: var(--s-2); align-content: start; }
.menu-col > .t-label {
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--au-gold);
}
.menu-col a {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-2) 0;
  font-weight: 500;
  color: var(--au-ink);
  transition: color var(--m-out) var(--m-ease);
}
.menu-col a span { font-weight: 400; color: var(--au-muted); font-size: var(--t-small); }
.menu-col a:hover, .menu-col a:focus-visible { color: var(--au-gold-light); transition-duration: var(--m-in); }
.menu-col a:hover span { color: var(--au-body); }

/* Drawer mobile (< 1024px) */
@media (max-width: 1023px) {
  .nav__bar { gap: var(--s-3); }
  .nav__links, .nav__actions { display: none; }
  .nav__toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--au-line-strong);
    background: transparent;
    cursor: pointer;
    flex: none;
  }
  .nav:not(.is-open) .nav__actions { display: flex; margin-left: auto; }
  .nav:not(.is-open) .nav__actions > :not(.btn--primary) { display: none; }
  .nav:not(.is-open) .nav__actions + .nav__toggle { margin-left: 0; }
  .nav.is-open { background: var(--au-bg); }
  .nav.is-open .nav__links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav);
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--s-4) var(--gut) calc(var(--btn-h) * 2 + 56px);
    background: var(--au-bg);
    overflow-y: auto;
    gap: 0;
    transition: opacity var(--m-panel) var(--m-ease), transform var(--m-panel) var(--m-ease);
  }
  @starting-style { .nav.is-open .nav__links { opacity: 0; transform: translateY(-8px); } }
  .nav.is-open .nav__item { display: grid; grid-template-columns: 1fr auto; height: auto; border-bottom: 1px solid var(--au-line); }
  .nav.is-open .nav__link { height: 56px; padding: 0; font-size: 20px; background: none; }
  .nav.is-open .nav__link[aria-current="page"]::after { left: 0; right: auto; width: 24px; bottom: 10px; }
  .nav.is-open .nav__link::before, .nav.is-open .nav__link .chev { display: none; }
  .nav.is-open .nav__expand {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 56px;
    border: 0;
    background: none;
    color: var(--au-ink);
    cursor: pointer;
  }
  .nav__expand svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
  .nav__item.is-expanded .nav__expand svg { transform: rotate(180deg); }
  .nav.is-open .nav__menu {
    position: static;
    grid-column: 1 / -1;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0 0 var(--s-4);
  }
  .nav.is-open .nav__item.is-expanded .nav__menu { display: block; }
  .nav.is-open .nav__menu .wrap { width: 100%; }
  .nav.is-open .nav__menu .grid { row-gap: var(--s-4); }
  .nav.is-open .nav__actions {
    display: grid;
    gap: var(--s-2);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 51;
    padding: var(--s-4) var(--gut) calc(var(--s-4) + env(safe-area-inset-bottom));
    background: var(--au-bg);
    border-top: 1px solid var(--au-line);
  }
  .nav.is-open .nav__actions .btn { width: 100%; height: 48px; font-size: var(--t-body); }
  body.nav-locked { overflow: hidden; }
}

@media (max-width: 639px) {
  .nav__bar { gap: var(--s-2); }
  .nav__logo { font-size: clamp(16px, 4.6vw, 20px); gap: 6px; white-space: nowrap; min-height: 44px; }
  .nav__logo .mark.mark--launea { width: 24px; height: 24px; }
  .nav:not(.is-open) .nav__actions .btn { height: 44px; padding-inline: var(--s-3); font-size: var(--t-small); }
  :root:has(> body > nav.actionbar) .nav:not(.is-open) .nav__actions { display: none; }
  :root:has(> body > nav.actionbar) .nav:not(.is-open) .nav__toggle { margin-left: auto; }
}

@media (scripting: none) and (max-width: 1023px) {
  .nav__links {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: var(--s-3);
    padding-right: var(--s-2);
    border-right: 1px solid var(--au-line);
  }
  .nav__toggle { display: none; }
}
@media (scripting: none) and (max-width: 639px) { .nav__links { display: none; } }

/* ---- Barra fixa mobile (.actionbar) ---- */
.actionbar { display: none; }
@media (max-width: 639px) {
  :root:has(> body > nav.actionbar) { --bar: calc(64px + env(safe-area-inset-bottom)); }
  .actionbar {
    --bg: rgba(9, 10, 12, 0.95);
    --line: var(--au-line);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--s-3);
    align-items: center;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: var(--s-2) var(--gut) env(safe-area-inset-bottom);
    background: rgba(9, 10, 12, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--au-line);
    transition: transform 240ms var(--ease), visibility 0s;
  }
  .actionbar .btn { width: 100%; height: 48px; }
  .actionbar[data-bar="hidden"] {
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 240ms var(--ease), visibility 0s 240ms;
  }
}
@media (max-width: 639px) and (scripting: enabled) {
  .actionbar:not([data-bar="shown"], [data-bar="always"]) { transform: translateY(100%); visibility: hidden; }
}
@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
  .actionbar, .actionbar[data-bar="hidden"] { transition: none; }
}

/* ==========================================================================
   Rodapé Autoral (#090a0c com borda superior dourada sutil)
   ========================================================================== */
.au-footer { background: var(--au-bg); color: var(--au-ink); border-top: 1px solid var(--au-gold-line); }
.au-footer__cta-band { padding-block: clamp(56px, 6.5vw, 88px); border-bottom: 1px solid var(--au-line); }
.au-footer__cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
}
.au-footer__cta-inner > div:first-child { display: grid; gap: 12px; max-width: 56ch; }
.au-footer__main { padding-block: clamp(44px, 5vw, 64px); }
.au-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.75fr) minmax(0, 0.95fr);
  gap: 32px 48px;
}
.au-footer__brand { display: grid; gap: 14px; align-content: start; }
.au-footer__desc { margin: 0; max-width: 42ch; font-size: 14.5px; line-height: 1.58; color: var(--au-muted); }
.au-footer__col h3 {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--au-gold);
}
.au-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; color: var(--au-muted); }
.au-footer__col a { color: var(--au-body); text-decoration: none; transition: color 160ms ease; }
.au-footer__col a:hover, .au-footer__col a:focus-visible { color: var(--au-gold-light); }

.au-footer__bar { border-top: 1px solid var(--au-line); padding-block: 22px; }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 13.5px;
  color: var(--au-muted);
}
.footer__copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer__cnpj { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; }
.footer__cnpj::before { content: "·"; opacity: 0.55; }
.footer__legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer__legal-links a { color: var(--au-muted); text-decoration: none; transition: color 160ms ease; }
.footer__legal-links a:hover,
.footer__legal-links a:focus-visible { color: var(--au-gold-light); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 767px) { .au-footer__grid { grid-template-columns: 1fr; } }
@media (max-width: 639px) {
  .au-footer__bar { padding-bottom: 84px; }
  .footer__legal a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}
