/* ==========================================================================
   AG Construtora — estilos base (porta fiel de "Construtora AG site claro")
   ========================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
/* ancoras nao ficam escondidas atras da navbar fixa */
section[id], [id="topo"] { scroll-margin-top: 96px; }
@media (max-width: 760px) { section[id] { scroll-margin-top: 84px; } }
html { overflow-x: hidden; }
body {
  margin: 0; background: #F4F1E9; color: #1B1A16;
  font-family: Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; max-width: 100%;
}
section, footer, header { max-width: 100vw; }
img { max-width: 100%; }
a { color: #A8503A; text-decoration: none; }
a:hover { color: #8A3F2C; }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: #D6CDBA; border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 22px; width: 22px; margin-top: -10px; border-radius: 50%; background: #A8503A; border: 3px solid #F4F1E9; box-shadow: 0 2px 8px rgba(27,26,22,.25); cursor: pointer; }
input[type=range]::-moz-range-track { height: 3px; background: #D6CDBA; border-radius: 3px; }
input[type=range]::-moz-range-thumb { height: 18px; width: 18px; border-radius: 50%; background: #A8503A; border: 3px solid #F4F1E9; cursor: pointer; }

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes wordIn { 0% { opacity: 0; filter: blur(12px); transform: translateY(34px); } 55% { opacity: .6; filter: blur(4px); transform: translateY(-3px); } 100% { opacity: 1; filter: blur(0); transform: none; } }
@keyframes kenBurns { 0% { transform: scale(1.04) translate3d(0,0,0); } 100% { transform: scale(1.16) translate3d(-2%,-2.5%,0); } }
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 240px 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes sheen { 0% { transform: translateX(-130%) skewX(-18deg); } 100% { transform: translateX(330%) skewX(-18deg); } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dotJump { 0%,60%,100% { transform: translateY(0); opacity:.45; } 30% { transform: translateY(-5px); opacity:1; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* revelacao ao rolar (data-reveal) */
[data-reveal] { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
.js [data-reveal]:not(.in) { opacity: 0; transform: translateY(22px); filter: blur(6px); }
.js [data-reveal].in { filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .js [data-reveal]:not(.in) { opacity: 1; transform: none; filter: none; } }

/* ---- responsivo (igual ao original) ---- */
@media (max-width: 860px) { .navlinks { display: none !important; } }
@media (max-width: 900px) { .dock { display: none !important; } }
@media (max-width: 860px) { .navburger { display: flex !important; } }
@media (max-width: 900px) {
  .modalcard { grid-template-columns: 1fr !important; grid-template-rows: 46vh 54vh; }
  .modalcard > div:first-of-type { height: auto !important; }
  .modalcard > div:last-child { height: auto !important; }
}
@media (max-width: 700px) {
  .navcta .navcta-long { display: none; }
  .navcta .navcta-short { display: inline; }
  .navcta { padding: 10px 15px !important; font-size: 13.5px !important; }
  .navbar { padding: 9px 9px 9px 14px !important; gap: 10px !important; }
  .navlogo span:last-child { font-size: 19px !important; }
}
@media (max-width: 760px) {
  section { padding-left: 16px !important; padding-right: 16px !important; }
  #topo { padding-top: 122px !important; }
  .fichagrid, .formgrid, .cardficha { grid-template-columns: 1fr !important; }
  input, button, select, textarea { font-size: 16px !important; }
  a, button { min-height: 44px; }
}
@media (max-width: 900px) {
  .modalcard { grid-template-rows: 40vh 1fr !important; height: 100dvh !important; }
  .modalcard > div:first-of-type { height: auto !important; min-height: 0; padding: 14px !important; }
  .modalcard > div:last-child { height: auto !important; padding: 26px 20px 34px !important; }
}
@media (hover: none) { [data-magnetic] { transform: none !important; } }
@media (max-width: 760px) {
  .herobg > video, .herobg > div { object-position: center 46% !important; background-position: center 46% !important; }
  /* hero menos "lavado" no celular: a imagem/video aparece atras do texto,
     mas com uma area mais opaca no canto do titulo pra manter a leitura */
  .heroscrim {
    background: radial-gradient(165% 78% at 20% 24%,
      rgba(244,241,233,.9) 0%, rgba(244,241,233,.6) 34%,
      rgba(244,241,233,.16) 62%, rgba(244,241,233,0) 80%) !important;
  }
  .heroscrim-fade {
    background: linear-gradient(180deg,
      rgba(244,241,233,.52) 0%, rgba(244,241,233,0) 24%,
      rgba(244,241,233,.1) 82%, #F4F1E9 100%) !important;
  }
  #topo h1, #topo p { text-shadow: 0 1px 9px rgba(244,241,233,.9), 0 0 3px rgba(244,241,233,.55); }
}

/* ==========================================================================
   Componentes reutilizados por outras paginas (projeto/checkout/sucesso/admin)
   ========================================================================== */
.wrap { max-width: 1240px; margin: 0 auto; }
.serif { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; letter-spacing: -.02em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.btn { display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-family:Manrope,sans-serif;
  font-weight:600; font-size:15.5px; padding:16px 26px; border-radius:999px; border:1px solid transparent;
  transition:background .25s,transform .25s,color .25s,border-color .25s; }
.btn-primary { background:#A8503A; color:#FFF8F0; box-shadow:0 14px 34px -16px rgba(168,80,58,.9); }
.btn-primary:hover { background:#8A3F2C; color:#FFF8F0; transform:translateY(-2px); }
.btn-ghost { background:transparent; color:#1B1A16; border-color:rgba(27,26,22,.2); }
.btn-ghost:hover { background:rgba(27,26,22,.06); color:#1B1A16; }
.btn-dark { background:#1B1A16; color:#F4F1E9; }
.btn-dark:hover { background:#2e2c26; color:#F4F1E9; transform:translateY(-2px); }
.btn-wa { background:#1FAF54; color:#fff; }
.btn-wa:hover { background:#199447; color:#fff; }
.btn-block { width:100%; justify-content:center; }
.btn[disabled] { opacity:.5; cursor:not-allowed; transform:none; }
.btn-sm { padding:10px 18px; font-size:13.5px; }

.field { display:block; margin-bottom:14px; }
.field span { display:block; font-size:12.5px; font-weight:600; color:#3A3830; margin-bottom:6px; }
.field input, .field textarea, .field select { width:100%; font:inherit; padding:12px 14px; border-radius:11px;
  border:1px solid rgba(27,26,22,.16); background:#FBF9F4; color:#1B1A16; }
.field input:focus, .field textarea:focus { outline:2px solid rgba(168,80,58,.35); border-color:#A8503A; }
.formgrid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }

.summary { background:#FBF9F4; border:1px solid rgba(27,26,22,.1); border-radius:18px; padding:22px; }
.summary .row { display:flex; justify-content:space-between; gap:12px; padding:8px 0; font-size:14.5px; }
.summary .row.total { border-top:1px solid rgba(27,26,22,.12); margin-top:8px; padding-top:14px; font-weight:700; font-size:17px; }
.summary .row.discount { color:#A8503A; }

.note { font-size:12px; color:#7B776A; line-height:1.5; }
.alert { padding:14px 16px; border-radius:12px; font-size:14px; margin-bottom:16px; }
.alert-err { background:#2a1215; color:#ffb3aa; border:1px solid #5c2b2e; }
.alert-ok { background:#12261a; color:#a7e5c0; border:1px solid #1f5c3a; }
.alert-info { background:#EDE8DC; color:#3A3830; border:1px solid rgba(27,26,22,.12); }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns:1fr; } }

/* ---- hovers (sem JS inline, compativel com CSP) ---- */
.lift-card:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -30px rgba(27,26,22,.55); border-color: rgba(168,80,58,.45) !important; }
.projcard:hover { transform: translateY(-6px); box-shadow: 0 30px 56px -34px rgba(27,26,22,.6); }
.tipcard:hover { background: #2A251C !important; }
.navcta:hover { background: #A8503A !important; }
.navbar a.navlogo:hover { color: #1B1A16; }
.sm:hover, .pf:hover, .ps:hover { border-color: #A8503A; }
.faq summary::-webkit-details-marker { display: none; }
.faq[open] .faqmark { transform: rotate(45deg); }
#simWa:hover, #chatStart:hover { background: #C06345; }
[data-magnetic]:hover { background: #8A3F2C; transform: translateY(-2px); }
.modalpkg:has(#modalPkg:checked) { border-color: #A8503A !important; background: rgba(168,80,58,.06) !important; }
.dock a:hover { background: #8A3F2C; }

/* ---- enquadramento: cards de projeto com altura uniforme ---- */
.projcard .pc-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 43px;
}
.projcard .pc-body { min-height: 232px; }
.projcard .pc-img img { object-position: center 58%; }

/* ---- simulador: painel esquerdo acompanha a altura do direito ---- */
#sim > div { display: flex; flex-direction: column; }
#sim .sim-left-inner { flex: 1; justify-content: center; }

/* ---- hero: menos vazio no mobile ---- */
@media (max-width: 940px) {
  #topo .hero-spacer { display: none; }
  #topo .hero-card-wrap { position: static !important; margin-top: 28px; }
}

/* ---- enquadramento mobile: titulos grandes cabem na tela ---- */
@media (max-width: 600px) {
  [style*="clamp(44px,6.4vw"] { font-size: 33px !important; line-height: 1.05 !important; }
  [style*="clamp(32px,4.2vw"] { font-size: 25px !important; }
  [style*="clamp(32px,4.4vw"] { font-size: 26px !important; }
  [style*="clamp(36px,5.6vw"] { font-size: 29px !important; }
  [style*="clamp(48px,7vw"]   { font-size: 40px !important; }
  [style*="clamp(30px,4.5vw"] { font-size: 25px !important; }
  #topo { padding-top: 116px !important; }
  section { padding-top: 68px !important; padding-bottom: 68px !important; }
  #topo p, #topo h1, section p { max-width: 100% !important; }
  body { overflow-x: clip; }
}

/* ---- checkout ---- */
.cowrap { overflow-x: hidden; }
.cowrap *, .cowrap *::before { min-width: 0; }
.cowrap .formgrid { gap: 0 14px; }
.co-grid { max-width: 100%; }
@media (max-width: 860px) {
  .co-grid { grid-template-columns: 1fr !important; }
  .co-aside { position: static !important; top: auto !important; order: 2; }
}
@media (max-width: 560px) {
  .cowrap { padding-left: 14px !important; padding-right: 14px !important; padding-top: 108px !important; }
  .cowrap form, .co-aside { padding: 18px !important; }
  .cowrap .formgrid { grid-template-columns: 1fr !important; }
}

/* ---- modal de projeto: enquadrado, nao ocupa a tela toda em telas grandes ---- */
@media (min-width: 1100px) {
  #projModal { padding: 4vh 4vw; align-items: center; }
  #projModal .modalcard {
    width: 100%; max-width: 1060px; height: 88vh; max-height: 780px;
    border-radius: 22px; box-shadow: 0 60px 120px -40px rgba(0,0,0,.7);
  }
  #projModal .modalcard > div { height: 88vh !important; max-height: 780px; }
}

/* ==========================================================================
   Celular: legibilidade da home (texto "apagado" e fundo "muito claro")
   ========================================================================== */
@media (max-width: 760px) {
  /* 1) o conteudo aparece SEMPRE, mesmo se a animacao de reveal (JS) nao rodar.
        Sem isto, um erro/atraso de JS deixava blocos inteiros meio invisiveis. */
  .js [data-reveal]:not(.in) {
    opacity: 1 !important; transform: none !important; filter: none !important;
  }

  /* 2) textos de apoio com mais contraste (os cinzas claros somem no celular) */
  [style*="color:#6B685C"], [style*="color:#7B776A"],
  [style*="color:#6b685c"], [style*="color:#7b776a"] { color: #514E44 !important; }
  [style*="color:#4A473E"], [style*="color:#4a473e"] { color: #37352D !important; }
  #topo p[style*="color:#3A3830"], #topo p[style*="color:#3a3830"] { color: #2C2A22 !important; }
  .note { color: #5C594F !important; }

  /* 3) hairlines muito fracas -> um pouco mais firmes, tira o ar "lavado" */
  #topo [style*="border-top:1px solid rgba(27,26,22,.1)"] { border-top-color: rgba(27,26,22,.24) !important; }

  /* 4) legenda do "100+ projetos entregues" - mais escura e com peso */
  .hero-stat-label { color: #2C2A22 !important; font-weight: 600 !important; }

  /* 5) foto do projeto em tela cheia ocupa a tela toda mesmo (barra do navegador) */
  #photoFull { height: 100dvh; }

  /* 6) botao "mostrar mais projetos" so existe no celular */
  #projShowMore { width: 100%; }
}
@media (min-width: 761px) {
  #projShowMore { display: none !important; }
}
