/* ════════════════════════════════════════════════════════════
   APAS Itapetininga — componentes das páginas internas
   (hero padrão, seções, cartões, formulários, sub-navegação)
   ════════════════════════════════════════════════════════════ */

[hidden] { display: none !important; }

/* ── Hero padrão ── */
.pg-hero { padding: 40px 0 88px; }
.pg-hero-in { position: relative; z-index: 1; }
.pg-hero h1 { margin-top: 18px; }
.pg-hero h1 span { color: #8ee6b2; }
.pg-hero p { max-width: 620px; }
.pg-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: rgba(255,255,255,.62); margin-bottom: 22px; }
.pg-crumbs a { color: rgba(255,255,255,.85); font-weight: 600; }
.pg-crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pg-crumbs i.fa-chevron-right { font-size: 9px; opacity: .6; }
.pg-crumbs span { color: #fff; font-weight: 600; }
.pg-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.pg-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.pg-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.pg-chip i { color: #8ee6b2; }

/* Faixa de números que sobrepõe o hero */
.pg-stats { position: relative; z-index: 2; margin-top: -56px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface);
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pg-stat { padding: 22px 20px; display: flex; align-items: center; gap: 14px; border-left: 1px solid var(--border); }
.pg-stat:first-child { border-left: 0; }
.pg-stat > i { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--g-pale); color: var(--g); flex-shrink: 0; }
.pg-stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.8px; color: var(--txt); line-height: 1.1; }
.pg-stat small { display: block; font-size: 12.5px; color: var(--txt3); font-weight: 600; margin-top: 2px; }

/* ── Seções ── */
.pg-sec { padding: 80px 0; }
.pg-sec.alt { background: var(--surface2); }
.pg-sec.tight { padding-top: 56px; }
.pg-head { text-align: center; max-width: 660px; margin: 0 auto 40px; }
.pg-head.left { text-align: left; margin-left: 0; }
.pg-head .section-title { margin: 6px 0 10px; }
.pg-head p { font-size: 15.5px; color: var(--txt2); line-height: 1.7; }

/* ── Grades e cartões ── */
.pg-grid { display: grid; gap: 18px; }
.pg-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.pg-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.pg-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.pg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px 24px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.pg-card.hover:hover, a.pg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--g-border); }
a.pg-card { display: block; color: inherit; text-decoration: none; }
.pg-card h3 { font-size: 16.5px; font-weight: 800; color: var(--txt); margin-bottom: 8px; letter-spacing: -.2px; }
.pg-card p { font-size: 14px; color: var(--txt2); line-height: 1.7; }
.pg-ico { width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff; flex-shrink: 0;
  background: linear-gradient(145deg, var(--g), #14a556); box-shadow: var(--shadow-g); margin-bottom: 18px; }
.pg-ico.soft { background: var(--g-pale); color: var(--g); box-shadow: none; }
.pg-ico.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; margin-bottom: 0; }

/* Lista com check */
.pg-check { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pg-check li { position: relative; padding-left: 31px; font-size: 14.5px; color: var(--txt2); line-height: 1.5; }
.pg-check li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; width: 20px; height: 20px; border-radius: 50%;
  position: absolute; left: 0; top: 1px; display: flex; align-items: center; justify-content: center; background: var(--g-pale); color: var(--g); }
.pg-check li strong { color: var(--txt); }

/* Etiquetas */
.pg-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--g-pale); color: var(--g); }
.pg-tag.gray { background: var(--surface2); color: var(--txt2); border: 1px solid var(--border); }

/* Avisos */
.pg-alert { display: flex; gap: 12px; align-items: flex-start; padding: 15px 18px; border-radius: 16px; font-size: 14px; line-height: 1.6; border: 1px solid; }
.pg-alert > i { margin-top: 3px; font-size: 16px; flex-shrink: 0; }
.pg-alert.info { background: var(--g-faint, #f3faf6); border-color: var(--g-border); color: var(--txt2); } .pg-alert.info > i { color: var(--g); }
.pg-alert.warn { background: #fff8e6; border-color: #f6dc9b; color: #6b4c00; } .pg-alert.warn > i { color: #d99400; }
.pg-alert.ok   { background: #ecf9f1; border-color: #b6e5c8; color: #14532d; } .pg-alert.ok > i { color: #16a34a; }
.pg-alert.err  { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; } .pg-alert.err > i { color: #dc2626; }
.pg-alert strong { color: inherit; }

/* Faixa de chamada final */
.pg-cta { position: relative; overflow: hidden; border-radius: 28px; padding: 44px 44px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: radial-gradient(600px 280px at 100% 0%, rgba(76,199,127,.4), transparent 60%), linear-gradient(130deg, var(--g-deep), var(--g-dark) 60%, #00743a); }
.pg-cta::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.pg-cta > * { position: relative; z-index: 1; }
.pg-cta h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.7px; color: #fff; margin-bottom: 6px; }
.pg-cta p { font-size: 15px; color: rgba(255,255,255,.8); max-width: 520px; }
.pg-cta .pg-hero-cta { margin-top: 0; }

/* Sub-navegação fixa (âncoras da página) */
.pg-subnav { position: sticky; top: 76px; z-index: 50; margin: 28px 0 0; }
.pg-subnav-in { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  overflow-x: auto; scrollbar-width: none; width: max-content; max-width: 100%; margin: 0 auto; }
.pg-subnav-in::-webkit-scrollbar { display: none; }
.pg-subnav a { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--txt2); white-space: nowrap; transition: background .2s, color .2s; }
.pg-subnav a i { font-size: 13px; color: var(--g); transition: color .2s; }
.pg-subnav a:hover { color: var(--g); }
.pg-subnav a.on { background: var(--g); color: #fff; box-shadow: var(--shadow-g); }
.pg-subnav a.on i { color: #fff; }
[id].pg-anchor { scroll-margin-top: 150px; }

/* ── Formulários ── */
.pg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pg-fld { display: block; margin-bottom: 16px; }
.pg-fld > span { display: block; font-size: 14px; font-weight: 700; color: var(--txt); margin-bottom: 7px; }
.pg-fld > span em { color: #dc2626; font-style: normal; }
.pg-fld > span small { font-weight: 500; color: var(--txt3); }
.pg-inp { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; font: inherit; font-size: 15.5px; color: var(--txt); background: var(--surface2);
  transition: border-color .2s, box-shadow .2s, background .2s; }
.pg-inp:focus { outline: none; border-color: var(--g); background: var(--surface); box-shadow: 0 0 0 4px rgba(0,140,60,.12); }
.pg-inp:user-invalid { border-color: #ef4444; }
textarea.pg-inp { min-height: 130px; resize: vertical; line-height: 1.6; }
select.pg-inp { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23668877' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.pg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.pg-count { display: block; text-align: right; font-size: 12px; color: var(--txt3); margin-top: 5px; }
.pg-btn-full { width: 100%; justify-content: center; padding: 16px 24px; font-size: 16px; }
.pg-trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12.5px; color: var(--txt3); font-weight: 600; }
.pg-trust span { display: inline-flex; align-items: center; gap: 6px; }
.pg-trust i { color: var(--g); }

/* Status aberto/fechado */
.pg-open { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--txt3); }
.pg-open::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #9aa9a1; box-shadow: 0 0 0 4px rgba(154,169,161,.18); }
.pg-open.on { color: #15803d; }
.pg-open.on::before { background: #18b45b; box-shadow: 0 0 0 4px rgba(24,180,91,.2); animation: pgPulso 2s infinite; }
@keyframes pgPulso { 50% { box-shadow: 0 0 0 7px rgba(24,180,91,.05); } }

/* ── Responsivo ── */
@media (max-width: 1080px) {
  .pg-grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .pg-stats { grid-template-columns: repeat(2, 1fr); }
  .pg-stat:nth-child(3) { border-left: 0; }
  .pg-stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) { .pg-grid.c3 { grid-template-columns: 1fr 1fr; } .pg-grid.c2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .pg-hero { padding: 28px 0 76px; }
  .pg-hero-cta > a { flex: 1 1 100%; }
  .pg-sec { padding: 56px 0; }
  .pg-grid.c3, .pg-grid.c4 { grid-template-columns: 1fr; }
  .pg-stats { border-radius: 20px; }
  .pg-stat { padding: 16px 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .pg-stat > i { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
  .pg-stat b { font-size: 20px; }
  .pg-cta { padding: 32px 22px; border-radius: 24px; }
  .pg-row { grid-template-columns: 1fr; }
  .pg-subnav { top: 70px; }
  .pg-subnav a { padding: 9px 13px; font-size: 13px; }
}
body.dark-mode .pg-alert.warn { background: rgba(217,148,0,.1); border-color: rgba(217,148,0,.3); color: #f3d38a; }
body.dark-mode .pg-alert.ok { background: rgba(22,163,74,.1); border-color: rgba(22,163,74,.3); color: #a7e5bd; }
body.dark-mode .pg-alert.err { background: rgba(220,38,38,.1); border-color: rgba(220,38,38,.3); color: #fca5a5; }
body.dark-mode .pg-open.on { color: #6ee7a0; }
@media print { .pg-subnav, .pg-cta { display: none; } }
