* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #050814;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 76, 112, 0.2), transparent 38%),
    radial-gradient(circle at 85% 18%, rgba(40, 198, 153, 0.08), transparent 28%),
    linear-gradient(180deg, #070d19 0%, #08111f 46%, #050814 100%);
  background-color: #050814;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
}

/* XGR 2026: identidade dark corporativa limpa */
body.page-home,
body.page-automacao,
body.page-projetos,
body.page-contato,
body.page-sobre {
  color: #eef4fb !important;
  background:
    radial-gradient(circle at 50% -8%, rgba(60, 82, 116, 0.28), transparent 34%),
    radial-gradient(circle at 12% 18%, rgba(212, 175, 55, 0.055), transparent 24%),
    radial-gradient(circle at 88% 22%, rgba(38, 107, 127, 0.12), transparent 30%),
    linear-gradient(180deg, #07101f 0%, #091524 42%, #06101d 100%) !important;
  background-attachment: scroll !important;
  background-size: auto !important;
}

.top-header {
  background: transparent !important;
  padding: 28px 20px 10px !important;
}

.brand-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: clamp(2.7rem, 5vw, 4.35rem) !important;
  letter-spacing: .11em !important;
  background-image:
    linear-gradient(115deg, #4e2a08 0%, #a76d1e 22%, #f1c75c 42%, #fff2a9 50%, #d69a2f 62%, #7a430d 82%, #f0cc73 100%) !important;
  background-size: 220% 220% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter:
    drop-shadow(0 2px 0 rgba(22, 14, 4, .95))
    drop-shadow(0 0 15px rgba(214, 154, 47, .22)) !important;
  text-shadow: none !important;
}

.brand-link::after {
  background: linear-gradient(90deg, transparent, rgba(241, 199, 92, .68), transparent) !important;
  opacity: .72 !important;
}

.navbar {
  background: rgba(6, 10, 18, .74) !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  backdrop-filter: blur(16px) !important;
}

.navbar a,
.nav-dropdown__trigger {
  color: rgba(238, 244, 251, .9) !important;
}

.navbar a:hover,
.navbar a.active,
.nav-dropdown:hover .nav-dropdown__trigger,
.nav-dropdown:focus-within .nav-dropdown__trigger,
.nav-dropdown.is-open .nav-dropdown__trigger {
  color: #f1c75c !important;
}

.hero,
.section,
body.page-projetos .hero,
body.page-projetos .section {
  max-width: 1260px !important;
}

.hero {
  padding-top: 78px !important;
}

.hero-box {
  width: min(100%, 980px) !important;
  margin: 0 auto !important;
  background:
    linear-gradient(135deg, rgba(18, 33, 52, .72), rgba(11, 22, 38, .54)) !important;
  border: 1px solid rgba(241, 199, 92, .12) !important;
  border-radius: 20px !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.3) !important;
  backdrop-filter: blur(10px) !important;
}

.home-hero-box::before {
  opacity: .26 !important;
}

.hero h1,
.section-title {
  color: #f4f7fb !important;
  letter-spacing: -0.02em !important;
}

.hero p,
.section-subtitle,
.card p {
  color: #9ba9ba !important;
}

.section {
  padding-left: 32px !important;
  padding-right: 32px !important;
}

.cards {
  gap: 22px !important;
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.card {
  background: rgba(13, 28, 46, .74) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(8px) !important;
}

.front-card:first-child,
.card:hover {
  border-color: rgba(241, 199, 92, .34) !important;
}

.card h3 {
  color: #eef4fb !important;
}

.card ul {
  color: #9ba9ba !important;
}

.eyebrow,
.case-status,
body.page-contato .institutional-contact__label {
  color: #f1c75c !important;
  border-color: rgba(241, 199, 92, .24) !important;
  background: rgba(241, 199, 92, .08) !important;
}

.btn-primary,
.btn-whatsapp,
body.page-projetos .case-thumb-badge,
.xgr-cookie-btn.primary {
  background: linear-gradient(135deg, #e5b93d, #fff0a3 48%, #c98921) !important;
  color: #10141b !important;
  border: 0 !important;
}

.btn-secondary,
body.page-projetos .case-link,
body.page-projetos .case-mini-link {
  background: rgba(10, 21, 35, .56) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  color: #eef4fb !important;
}

.btn-secondary:hover,
body.page-projetos .case-link:hover,
body.page-projetos .case-mini-link:hover {
  border-color: rgba(241, 199, 92, .4) !important;
  color: #f1c75c !important;
}

.xgr-site-footer {
  background: transparent !important;
  border-top: 1px solid rgba(255,255,255,.07) !important;
}

@media (max-width: 940px) {
  .cards-3 { grid-template-columns: 1fr !important; }
  .section { padding-left: 18px !important; padding-right: 18px !important; }
}

.brand-link__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  object-fit: cover;
  -webkit-text-fill-color: initial;
}

/* Canais de contato flutuantes */
.social-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10000;
  display: grid;
  gap: 10px;
}
.social-dock__link {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  color: #fff;
  background: rgba(7,15,26,.92);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.social-dock__link:hover { transform: translateY(-3px); }
.social-dock__link svg { width: 27px; height: 27px; display: block; }
.social-dock__link img { width: 30px; height: 30px; display: block; object-fit: contain; }
.social-dock__link--whatsapp { color: #25d366; border-color: rgba(37,211,102,.34); }
.social-dock__link--whatsapp:hover { border-color: rgba(37,211,102,.75); box-shadow: 0 12px 30px rgba(37,211,102,.16); }
.social-dock__link--instagram { color: #f2b6ff; border-color: rgba(214,91,255,.3); }
.social-dock__link--instagram svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.social-dock__link--instagram circle:last-child { fill: currentColor; stroke: none; }
.social-dock__link--instagram:hover { border-color: rgba(214,91,255,.72); box-shadow: 0 12px 30px rgba(214,91,255,.14); }
@media (max-width: 600px) {
  .social-dock { right: 14px; bottom: 14px; gap: 8px; }
  .social-dock__link { width: 48px; height: 48px; border-radius: 14px; }
  .social-dock__link svg { width: 25px; height: 25px; }
  .social-dock__link img { width: 28px; height: 28px; }
}


/* Shared return-to-top control */
.back-to-top {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(233,189,77,.48);
  border-radius: 50%;
  color: #ffe27a;
  background: rgba(5,9,18,.86);
  box-shadow: 0 12px 34px rgba(0,0,0,.38), inset 0 0 20px rgba(233,189,77,.06);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .25s ease, transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.back-to-top:hover { border-color: #ffe27a; box-shadow: 0 12px 36px rgba(0,0,0,.42), 0 0 24px rgba(233,189,77,.16); }
.back-to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
@media (max-width: 600px) {
  .back-to-top { width: 42px; height: 42px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}

/* Consentimento de cookies compartilhado */
.cookie-consent {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 10020;
  width: min(470px, calc(100% - 44px));
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(105, 226, 213, .22);
  border-radius: 20px;
  color: #f4f7fb;
  background: rgba(5, 12, 24, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), inset 0 0 35px rgba(27, 203, 185, .035);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.cookie-consent.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.cookie-consent__copy { display: grid; gap: 7px; }
.cookie-consent__copy strong { color: #fff; font-size: 1rem; }
.cookie-consent__copy p { margin: 0; color: rgba(224, 234, 245, .76); font-size: .86rem; line-height: 1.55; }
.cookie-consent__copy a { width: fit-content; color: #65e4d6; font-size: .8rem; text-decoration: none; }
.cookie-consent__copy a:hover { text-decoration: underline; }
.cookie-consent__actions { display: flex; justify-content: flex-end; gap: 10px; }
.cookie-consent__button {
  min-width: 104px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 10px;
  color: #edf3fa;
  background: rgba(255, 255, 255, .035);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.cookie-consent__button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .34); }
.cookie-consent__button--primary { border-color: #e9bd4d; color: #09101b; background: linear-gradient(135deg, #ffe676, #e9bd4d); }
.cookie-settings-link {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.cookie-settings-link:hover { color: #ffe27a; }
@media (max-width: 600px) {
  .cookie-consent { left: 10px; bottom: 10px; width: calc(100% - 20px); padding: 17px; border-radius: 17px; }
  .cookie-consent__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-consent__button { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-consent { transition: none; }
}

/* Navegação mobile compartilhada */
.mobile-menu-toggle,
.mobile-menu-panel {
  display: none;
}

@media (max-width: 980px) {
  .site-header__inner {
    position: relative;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 11px;
    color: #f4f7fb;
    background: rgba(10, 21, 35, .72);
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    width: 19px;
    height: 2px;
    display: block;
    border-radius: 2px;
    background: currentColor;
    transform-origin: center;
    transition: transform .2s ease, opacity .2s ease;
  }

  .mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 20;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 15px;
    background: rgba(5, 12, 24, .98);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .46);
    backdrop-filter: blur(18px);
  }

  .mobile-menu-open .mobile-menu-panel {
    display: grid;
  }

  .mobile-menu-panel a {
    padding: 12px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #d8e1eb;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
  }

  .mobile-menu-panel a:hover,
  .mobile-menu-panel a[aria-current="page"] {
    border-color: rgba(233, 189, 77, .3);
    color: #ffe27a;
    background: rgba(233, 189, 77, .07);
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    gap: 10px !important;
  }

  .site-nav {
    margin-left: auto;
    gap: 0 !important;
  }

  .site-nav .nav-cta {
    padding: 9px 11px !important;
    font-size: .76rem !important;
    white-space: nowrap;
  }

  .mobile-menu-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xg-logo small {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .site-header__inner {
    width: min(100% - 20px, var(--xg-max)) !important;
  }

  .xg-logo {
    gap: 7px !important;
    font-size: 1rem !important;
  }

  .xg-logo__mark {
    width: 31px !important;
    height: 31px !important;
  }

  .site-nav .nav-cta {
    padding: 8px 9px !important;
    font-size: .68rem !important;
  }

  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-toggle span { transition: none; }
}
