/*
 * GIFO — fecho da auditoria pública de julho de 2026.
 * Correções transversais de legibilidade, contraste, foco, toque e mobile.
 */

:root {
  --gifo-audit-focus: #42f5dc;
  --gifo-audit-link: #79a9ff;
  --gifo-audit-link-hover: #a7c5ff;
}

html {
  scroll-padding-top: 6rem;
}

html,
body {
  max-width: 100%;
}

body {
  overflow-x: clip;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--gifo-audit-focus) !important;
  outline-offset: 3px !important;
}

:where(button, [role="button"], input[type="submit"], input[type="button"], .btn, .nav-login, .nav-cta, .nav-contact) {
  min-height: 44px;
}

:where(.nav-hamburger, .menu-button, .menu-close, .mobile-close, .back-to-top) {
  min-width: 44px;
  min-height: 44px;
}

footer :where(a, button) {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

footer .footer-heading,
footer h5 {
  margin: 0 0 0.8rem;
  color: #f4f7fb;
  font: 700 0.78rem/1.35 "Space Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer :where(a, p, li, small) {
  line-height: 1.55;
}

:where(.card, .endpoint, .code-example, .code, pre, code, table, .table-wrap) {
  min-width: 0;
  max-width: 100%;
}

:where(pre, .code, .code-example, .endpoint) {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

:where(.card p, .card li, .notice, .section-intro, .hero-lead, .lead) {
  line-height: 1.65;
}

a:not(.btn):not(.nav-brand):not(.home-service-card):not(.published-card) {
  text-underline-offset: 0.18em;
}

html.page-agentsure a:not(.btn):not(.brand):not(.nav-brand) {
  color: var(--gifo-audit-link);
}

html.page-agentsure a:not(.btn):not(.brand):not(.nav-brand):hover {
  color: var(--gifo-audit-link-hover);
}

html.page-agentsure :where(.btn-primary, .cta-primary, .primary-button, a[class*="primary"]) {
  color: #06111e !important;
  background: #65c9ff !important;
  border-color: #65c9ff !important;
}

.audit-ecosystem-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: #0d121a;
  color: rgba(237,242,250,0.78);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.audit-ecosystem-bridge a {
  color: #71f1dc !important;
  font-weight: 700;
}

.audit-language-link {
  white-space: nowrap;
  font-size: 0.78rem;
}

.editorial-nav-toggle {
  display: none;
}

.cookie-banner,
.cookie-consent,
.consent-banner,
#cookie-banner,
#cookie-consent {
  max-width: min(720px, calc(100vw - 20px));
}

img.nav-logo,
.nav-brand img,
.mobile-menu-head img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.form-error[role="alert"],
[aria-invalid="true"] {
  scroll-margin-top: 7rem;
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  :where(.wrap, .container, main, section, article, .grid, .card) {
    min-width: 0;
  }

  .audit-ecosystem-bridge {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
    padding-block: 0.65rem;
  }

  .editorial-nav {
    position: relative;
  }

  .editorial-nav-toggle {
    display: flex;
    width: calc(100% - 22px);
    min-height: 44px;
    margin: 0.55rem auto;
    padding: 0.7rem 0.9rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    color: #f5f1e8;
    font: 700 0.82rem/1.2 "Space Mono", monospace;
    text-align: left;
  }

  .editorial-nav-toggle::after {
    content: "⌄";
    font-size: 1.1rem;
    transition: transform 160ms ease;
  }

  .editorial-nav.is-open .editorial-nav-toggle::after {
    transform: rotate(180deg);
  }

  .editorial-nav .editorial-nav-inner {
    display: none !important;
    width: calc(100% - 22px);
    margin: 0 auto 0.7rem;
    padding: 0.45rem;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 12px;
    background: #11100f;
  }

  .editorial-nav.is-open .editorial-nav-inner {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .editorial-nav .editorial-nav-inner a {
    min-height: 44px;
    padding: 0.7rem 0.75rem;
    display: flex;
    align-items: center;
    border-radius: 8px;
  }

  .cookie-banner,
  .cookie-consent,
  .consent-banner,
  #cookie-banner,
  #cookie-consent {
    inset: auto 10px 10px !important;
    width: auto !important;
    max-height: min(38vh, 310px);
    padding: 12px 14px !important;
    overflow-y: auto;
    border-radius: 12px !important;
  }

  .cookie-banner p,
  .cookie-consent p,
  .consent-banner p,
  #cookie-banner p,
  #cookie-consent p {
    margin: 0 0 0.55rem !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
  }

  .cookie-banner :where(button, .btn),
  .cookie-consent :where(button, .btn),
  .consent-banner :where(button, .btn),
  #cookie-banner :where(button, .btn),
  #cookie-consent :where(button, .btn) {
    min-height: 40px;
  }

  footer .footer-heading,
  footer h5 {
    margin-top: 0.4rem;
  }

  footer a {
    padding-block: 0.35rem;
  }

  :where(.code, .code-example, pre) {
    font-size: 0.72rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
