/* =====================================================================
   GRUPO PACTO MERCANTIL — Camada v7 (design system + correções)
   Carregada no <head>. Os seletores usam o prefixo "html body" para
   prevalecer sobre os blocos <style> legados que ficam no <body>
   (com !important), sem depender da ordem de carregamento.
   ===================================================================== */

/* ---------- Fontes (hospedadas localmente) ---------- */
@font-face{font-family:'Montserrat';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/montserrat-600.woff2) format('woff2')}
@font-face{font-family:'Montserrat';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/montserrat-700.woff2) format('woff2')}
@font-face{font-family:'Montserrat';font-style:normal;font-weight:800;font-display:swap;src:url(/assets/fonts/montserrat-800.woff2) format('woff2')}
@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(/assets/fonts/roboto-300.woff2) format('woff2')}
@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/roboto-400.woff2) format('woff2')}
@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/roboto-500.woff2) format('woff2')}
@font-face{font-family:'Roboto';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/roboto-700.woff2) format('woff2')}

/* ---------- Tokens ---------- */
html:root{
  --gpm-navy:#03254A;
  --gpm-navy-deep:#021B36;
  --gpm-green:#005A43;
  --gpm-green-deep:#014737;
  --gpm-gold:#B88A10;
  --gpm-gold-hover:#C99A1E;
  --gpm-gold-ink:#8A6609;      /* dourado para texto sobre fundo claro (contraste AA) */
  --gpm-gold-soft:#D9B04A;     /* dourado para texto pequeno sobre azul */
  --gpm-paper:#F7F6F2;
  --gpm-paper-2:#EFECE4;
  --gpm-ink:#26323F;
  --gpm-muted:#5A6573;
  --gpm-line:#E1DCD0;
  --gpm-white:#FFFFFF;

  --ff-title:'Montserrat',Tahoma,'Segoe UI',sans-serif;
  --ff-text:'Roboto',Tahoma,'Segoe UI',sans-serif;

  --radius-s:4px;
  --radius-m:6px;
  --shadow-1:0 1px 2px rgba(2,27,54,.06),0 8px 24px rgba(2,27,54,.08);

  /* variáveis legadas remapeadas para a paleta institucional */
  --gold:#B88A10; --gold2:#C99A1E; --gold3:#8A6609;
  --navy:#021B36; --bg-deep:#021B36; --bg-dark:#03254A;
  --paper:#F7F6F2; --paper2:#EFECE4; --ink:#03254A; --graf:#26323F;
  --border:rgba(184,138,16,.18); --borderlt:rgba(184,138,16,.4);
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
img,video,svg{max-width:100%}

/* ---------- Tipografia ---------- */
html body{font-family:var(--ff-text)!important;font-size:16px;line-height:1.6;background:var(--gpm-navy-deep)}
html body .h1,html body h1.h1,html body #pg-home .h1{
  font-family:var(--ff-title)!important;font-weight:800!important;letter-spacing:-.015em!important;
  font-size:clamp(30px,calc(3.2vw + 12px),58px)!important;line-height:1.12!important}
html body .h2,html body h2.h2,
html body #home-quem-somos .h2,html body #home-historia .h2,html body #home-contact .h2,html body #home-brands .h2{
  font-family:var(--ff-title)!important;font-weight:700!important;letter-spacing:-.01em!important;
  font-size:clamp(26px,calc(1.4vw + 19px),40px)!important;line-height:1.18!important}
html body h3,html body #pg-home h3,html body .foot-col-title{font-family:var(--ff-title)!important;font-weight:700!important;letter-spacing:0!important}
html body h4,html body #home-historia h4{font-family:var(--ff-title)!important;font-weight:700!important}
html body .h1 em,html body .h2 em,html body h1 em,html body h2 em{font-style:normal!important;font-weight:inherit!important}
html body .lead{font-family:var(--ff-text)!important;font-weight:400!important;font-size:17px!important;line-height:1.6!important}
html body .eyebrow,html body #pg-home .hero-badge{letter-spacing:.12em!important;font-weight:500;font-family:var(--ff-text)!important}
html body .btn,html body .btn-lg,html body .btn-xl,html body .form-submit,html body .btn-cadastro,html body .btn-entrar{
  font-family:var(--ff-title)!important;font-weight:700!important;font-size:15px!important;letter-spacing:.01em!important}
html body .gnav-a,html body .mob-link,html body .gnav-drop a,html body .gnav-drop button{font-family:var(--ff-text)!important}
html body .kpi-v,html body #pg-home .kpi-v{font-family:var(--ff-title)!important;font-weight:800!important}
html body input,html body select,html body textarea,html body button{font-family:var(--ff-text)}

/* ---------- Botões ---------- */
html body .btn,html body .btn-lg{border-radius:var(--radius-s)!important;min-height:48px}
html body .btn-gold{background:var(--gpm-gold)!important;color:var(--gpm-navy-deep)!important}
html body .btn-gold:hover{background:var(--gpm-gold-hover)!important}
html body .btn-ghost{border:1px solid rgba(217,176,74,.65)!important;color:var(--gpm-gold-soft)!important;background:transparent!important}
html body .btn-ghost:hover{background:rgba(184,138,16,.12)!important}

/* ---------- Header ---------- */
html body #gnav{background:var(--gpm-navy-deep)!important;border-bottom:1px solid rgba(184,138,16,.32)!important}
/* logomarca: versão derivada do arquivo oficial, só com o fundo removido (pacto-mercantil-transparente.webp) */
html body .gnav-logo img,html body .foot-brand img{width:auto;object-fit:contain;mix-blend-mode:normal}
html body .gnav-logo img{height:48px}
html body #gfoot{background:var(--gpm-navy-deep)!important;border-top:1px solid rgba(184,138,16,.35)!important}
html body .foot-col-title{color:var(--gpm-gold-soft)!important}

/* ---------- Hero ---------- */
html body #pg-home .hero-ov{background:linear-gradient(100deg,rgba(2,27,54,.95) 0%,rgba(2,27,54,.82) 42%,rgba(2,27,54,.35) 100%)!important}
html body #pg-home .hero-badge{color:var(--gpm-gold-soft)!important}
html body #pg-home .hero-badge::before{background:var(--gpm-gold)!important}
html body #pg-home .hero .lead{color:rgba(255,255,255,.86)!important;max-width:580px}

/* =====================================================================
   CARDS DE EMPRESAS E VERTICAIS (home)
   ===================================================================== */
html body .brand-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:24px!important;max-width:1240px;margin-left:auto;margin-right:auto}
html body #home-brands .bc{
  display:flex;flex-direction:column;min-width:0;width:100%;height:100%;
  background:var(--gpm-white)!important;border:1px solid var(--gpm-line)!important;border-radius:var(--radius-m)!important;
  box-shadow:none!important;overflow:hidden;cursor:pointer;transform:none!important;
  transition:box-shadow .2s ease,border-color .2s ease!important}
html body #home-brands .bc:focus-visible{outline:2px solid var(--gpm-gold);outline-offset:3px}
@media (hover:hover){
  html body #home-brands .bc:hover{box-shadow:var(--shadow-1)!important;border-color:#CDBF9C!important;transform:none!important}
}
html body #home-brands .bc-head{
  position:relative;min-height:0!important;aspect-ratio:16/9;padding:16px!important;
  display:flex;flex-direction:column!important;justify-content:flex-end!important;align-items:flex-start!important;
  background-color:var(--gpm-navy-deep)!important;
  background-image:linear-gradient(180deg,rgba(2,27,54,.05) 30%,rgba(2,27,54,.92) 100%),var(--ph,none)!important;
  background-size:cover!important;background-position:center!important}
html body #home-brands .bc-head::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--gpm-gold);opacity:.85}
/* logos oficiais (arquivos com fundo próprio) em moldura discreta, sem distorção */
html body #home-brands .bc-logo{position:relative;z-index:1;display:block;height:44px!important;max-height:44px!important;width:auto;max-width:160px!important;
  object-fit:contain;filter:none;border:1px solid rgba(217,176,74,.55);border-radius:3px;box-shadow:0 4px 14px rgba(0,0,0,.35)}
html body #home-brands .bc-body{display:flex;flex-direction:column;gap:8px;flex:1;padding:20px 20px 22px!important;background:var(--gpm-white)!important}
html body #home-brands .bc-tag{
  display:block;padding:0!important;background:none!important;border-radius:0!important;opacity:1!important;
  color:var(--gpm-gold-ink)!important;font-family:var(--ff-text);font-size:12px!important;font-weight:700!important;
  letter-spacing:.1em!important;text-transform:uppercase;line-height:1.4}
html body #home-brands .bc-name{margin:0;font-family:var(--ff-title)!important;font-weight:700!important;font-size:20px!important;line-height:1.25;color:var(--gpm-navy)!important;overflow-wrap:break-word}
html body #home-brands .bc-desc{margin:0 0 6px!important;font-family:var(--ff-text);font-size:16px!important;line-height:1.55!important;color:var(--gpm-ink)!important;overflow-wrap:break-word}
html body #home-brands .bc-link{
  margin-top:auto;align-self:flex-start;font-family:var(--ff-title);font-weight:700;font-size:14px;color:var(--gpm-navy);
  padding-bottom:2px;border-bottom:1px solid var(--gpm-gold)}
html body #home-brands .bc:hover .bc-link{color:var(--gpm-gold-ink)}

/* Desktop ≥1200: diretório editorial em 2 colunas, card horizontal (foto | conteúdo) */
@media (min-width:1200px){
  html body #home-brands .bc{flex-direction:row}
  html body #home-brands .bc-head{flex:0 0 42%;aspect-ratio:auto;min-height:220px!important}
  html body #home-brands .bc-head::after{left:auto;top:0;width:2px;height:auto}
  html body #home-brands .bc-body{padding:26px 28px 26px!important}
  html body #home-brands .bc-name{font-size:22px!important}
}

/* =====================================================================
   RESPONSIVIDADE — grade única e previsível
   Desktop ≥1200: 2 colunas, cards horizontais (10 empresas = 5 linhas)
   768–1199: 2 colunas, cards verticais
   Mobile ≤767: 1 coluna, um card abaixo do outro
   ===================================================================== */
@media (max-width:1199px){
  html body .brand-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:24px!important}
}
@media (min-width:768px) and (max-width:1023px){
  html body .g3,html body .g4,html body .course-grid,html body .fid-grid,
  html body div[style*="repeat(3,1fr)"]:not(.pstrip):not(.brand-kpis),
  html body div[style*="repeat(4,1fr)"]:not(.pstrip),
  html body div[style*="repeat(5,1fr)"],
  html body div[style*="1fr 1fr 1fr"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:767px){
  html body .wrap,html body .container{width:100%;max-width:100%;padding-left:20px!important;padding-right:20px!important}
  html body .brand-strip#home-brands{padding:56px 0!important}
  html body .brand-grid{grid-template-columns:minmax(0,1fr)!important;gap:24px!important}

  /* cards de serviços, produtos e verticais em todas as páginas */
  html body .g2,html body .g3,html body .g4,html body .bc-grid,html body .course-grid,html body .fid-grid,
  html body .sg,html body .erp-modules,html body .con-types,
  html body div[style*="repeat(3,1fr)"]:not(.pstrip):not(.brand-kpis),
  html body div[style*="repeat(4,1fr)"]:not(.pstrip),
  html body div[style*="repeat(5,1fr)"],
  html body div[style*="1fr 1fr 1fr"],
  html body div[style*="2fr 1fr"],
  html body div[style*="1fr 460px"],
  html body div[style*="1fr 480px"],
  html body div[style*="220px 1fr"]{grid-template-columns:minmax(0,1fr)!important}
  /* blocos de indicadores pequenos (painel) ficam em 2 colunas */
  html body div[style*="repeat(4,1fr);gap:8px"],
  html body div[style*="repeat(4,1fr);gap:10px"],
  html body div[style*="repeat(3,1fr);gap:10px"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .g2>*,html body .g3>*,html body .g4>*,html body .brand-grid>*{min-width:0}

  /* header */
  html body #gnav{height:64px!important}
  html body .gnav-logo img{height:42px!important}

  /* hero */
  html body #pg-home .hero{min-height:auto!important;padding-top:64px!important}
  html body #pg-home .hero-inner{padding:40px 20px 48px!important;gap:28px!important}
  html body #pg-home .h1{font-size:32px!important;line-height:1.14!important;margin-bottom:18px!important}
  html body #pg-home .h1 br{display:none}
  html body #pg-home .hero-badge{font-size:11px!important;padding-left:40px!important;margin-bottom:20px!important;line-height:1.6}
  html body #pg-home .hero-badge::before{width:28px!important}
  html body #pg-home .hero .lead{font-size:16px!important;line-height:1.6!important;margin-bottom:28px!important}
  html body .hero-cta{flex-direction:column!important;align-items:stretch!important;gap:12px!important}
  html body .hero-cta .btn{width:100%;justify-content:center}
  html body #pg-home .brand-kpis{margin-top:32px!important}

  /* títulos internos */
  html body .h1{font-size:30px!important}
  html body .h2{font-size:clamp(26px,7vw,30px)!important}

  /* rodapé: legibilidade */
  html body .foot-link{font-size:15px!important;line-height:2}
}
@media (max-width:360px){
  html body #pg-home .h1,html body .h1{font-size:29px!important}
  html body .gnav-logo img{height:38px!important}
}

/* =====================================================================
   BOTÃO FLUTUANTE ÚNICO DE ATENDIMENTO
   ===================================================================== */
#gpm-fab{
  position:fixed;z-index:2147483000;
  right:max(18px,env(safe-area-inset-right));
  bottom:calc(18px + env(safe-area-inset-bottom));
  width:58px;height:58px;border-radius:50%;border:0;padding:0;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  background:#25D366;color:#fff;box-shadow:0 6px 18px rgba(2,27,54,.28);
  transition:transform .15s ease}
#gpm-fab:hover{transform:scale(1.05)}
#gpm-fab:focus-visible{outline:3px solid var(--gpm-gold);outline-offset:3px}
#gpm-fab svg{width:30px;height:30px}
html.apv-open #gpm-fab{display:none}
@media (max-width:767px){#gpm-fab{width:54px;height:54px}}

/* =====================================================================
   FORMULÁRIO DE ANÁLISE PRÉVIA
   ===================================================================== */
.apv-card{background:var(--gpm-white);color:var(--gpm-ink);border-radius:var(--radius-m);padding:32px;border-top:3px solid var(--gpm-gold);box-shadow:0 20px 50px rgba(0,0,0,.28)}
.apv-title{margin:0 0 6px;font-family:var(--ff-title);font-weight:700;font-size:22px;line-height:1.25;color:var(--gpm-navy)}
.apv-sub{margin:0 0 22px;font-size:15px;line-height:1.55;color:var(--gpm-muted)}
.apv-form[hidden]{display:none!important}
.apv-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.apv-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.apv-field.full{grid-column:1/-1}
.apv-field label{font-size:14px;font-weight:500;color:var(--gpm-navy)}
.apv-field label .req{color:#9B2C2C;margin-left:2px}
.apv-field input:not([type=checkbox]),.apv-field select,.apv-field textarea{
  width:100%;min-height:48px;padding:12px 14px;font:400 16px/1.4 var(--ff-text);color:var(--gpm-ink);
  background:#fff;border:1px solid #C9C2B2;border-radius:var(--radius-s);outline:none;-webkit-appearance:none;appearance:none}
.apv-field select{background-image:linear-gradient(45deg,transparent 50%,var(--gpm-navy) 50%),linear-gradient(135deg,var(--gpm-navy) 50%,transparent 50%);background-position:calc(100% - 20px) 21px,calc(100% - 15px) 21px;background-size:5px 5px;background-repeat:no-repeat;padding-right:40px}
.apv-field textarea{min-height:96px;resize:vertical}
.apv-field input:focus,.apv-field select:focus,.apv-field textarea:focus{border-color:var(--gpm-navy);box-shadow:0 0 0 3px rgba(184,138,16,.25)}
.apv-field input:disabled{background:var(--gpm-paper);color:var(--gpm-muted)}
.apv-field[data-invalid] input,.apv-field[data-invalid] select{border-color:#9B2C2C}
.apv-err{display:none;font-size:13px;color:#9B2C2C}
.apv-field[data-invalid] .apv-err{display:block}
.apv-check{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.5;color:var(--gpm-ink);cursor:pointer}
.apv-check input[type=checkbox]{width:20px;height:20px;min-height:0;margin:1px 0 0;padding:0;flex:0 0 auto;accent-color:var(--gpm-navy);-webkit-appearance:checkbox;appearance:auto;cursor:pointer}
.apv-check a{color:var(--gpm-navy);text-decoration:underline}
.apv-inline-check{margin-top:2px;font-size:13px}
.apv-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
.apv-submit{
  grid-column:1/-1;min-height:52px;border:0;border-radius:var(--radius-s);cursor:pointer;
  background:var(--gpm-navy);color:#fff;font:700 16px/1 var(--ff-title);letter-spacing:.01em;
  display:flex;align-items:center;justify-content:center;gap:10px}
.apv-submit:hover{background:var(--gpm-navy-deep)}
.apv-submit:focus-visible{outline:3px solid var(--gpm-gold);outline-offset:2px}
.apv-submit[disabled]{opacity:.7;cursor:progress}
.apv-note{grid-column:1/-1;margin:0;font-size:13px;line-height:1.5;color:var(--gpm-muted)}
.apv-alert{grid-column:1/-1;margin:0;padding:12px 14px;border-radius:var(--radius-s);background:#FBEAEA;color:#7A1F1F;font-size:14px;display:none}
.apv-alert.show{display:block}
.apv-done{display:none;text-align:left}
.apv-done.show{display:block}
.apv-done .apv-proto{display:inline-block;margin:10px 0 14px;padding:6px 10px;background:var(--gpm-paper);border:1px solid var(--gpm-line);border-radius:var(--radius-s);font-weight:700;color:var(--gpm-navy);font-size:15px}
.apv-done p{font-size:15px;line-height:1.6;color:var(--gpm-ink);margin:0 0 10px}
.apv-done button{margin-top:6px}

/* modal (dialog nativo) */
#apv-dialog{padding:0;border:0;background:transparent;max-width:600px;width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto}
#apv-dialog::backdrop{background:rgba(2,27,54,.72)}
#apv-dialog .apv-card{position:relative;box-shadow:0 24px 60px rgba(0,0,0,.4)}
.apv-close{position:absolute;top:10px;right:10px;width:44px;height:44px;border:0;background:transparent;cursor:pointer;color:var(--gpm-navy);border-radius:50%;display:flex;align-items:center;justify-content:center}
.apv-close:hover{background:var(--gpm-paper)}
.apv-close:focus-visible{outline:2px solid var(--gpm-gold)}

/* seção de contato da home */
html body #home-contact .apv-card{box-shadow:0 20px 50px rgba(0,0,0,.35)}

@media (max-width:767px){
  .apv-card{padding:24px 20px}
  .apv-form{grid-template-columns:minmax(0,1fr)}
  #apv-dialog{width:100%;max-width:100%;max-height:100dvh;height:100dvh;margin:0;border-radius:0}
  #apv-dialog .apv-card{min-height:100dvh;border-radius:0;padding-top:28px;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
  .apv-title{font-size:21px;padding-right:44px}
  html body #home-contact{padding:56px 20px!important}
}

@media (prefers-reduced-motion:reduce){#gpm-fab{transition:none}}
.apv-done-phone{white-space:nowrap}
/* botões com texto longo nunca ultrapassam a tela (ex.: link da Academia) */
@media (max-width:767px){
  html body .btn,html body .btn-lg,html body .btn-xl{white-space:normal!important;max-width:100%!important;text-align:center;line-height:1.3;height:auto}
}
html:has(#mob-menu.open) #gpm-fab{display:none}
