/* ==========================================================================
   RFBC Serviços Contábeis — estilos
   Mobile-friendly: tipografia fluida (clamp), grids auto-fit, áreas seguras
   (notch), alvos de toque >= 44px, hover só em dispositivos com mouse.

   Breakpoints
     <= 1299px  setas do slider descem para junto dos pontos
     <=  960px  hero / sobre em 1 coluna
     <=  900px  menu hambúrguer
     <=  560px  celulares (botões em largura total)
     <=  380px  celulares pequenos
     landscape com altura <= 520px  hero compacto em 2 colunas
   ========================================================================== */
:root {
  --azul-noite: #0a1633;
  --azul-escuro: #0f2456;
  --azul: #1a73e8;
  --azul-claro: #2ea8ff;
  --texto: #1c2434;
  --texto-suave: #5b6577;
  --fundo: #ffffff;
  --fundo-alt: #f3f6fb;
  --borda: #dde4ef;
  --raio: 14px;
  --sombra: 0 10px 30px rgba(10, 22, 51, .08);
  --topo-h: 76px;
  --gutter: clamp(16px, 4vw, 32px);
  --secao-pad: clamp(56px, 9vw, 96px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topo-h) + 8px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(15px, .3vw + 14px, 17px);
  color: var(--texto);
  background: var(--fundo);
  line-height: 1.6;
  overflow-x: clip;           /* nunca rolagem horizontal */
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; overflow-wrap: break-word; hyphens: auto; }
p { overflow-wrap: break-word; }
.container {
  width: min(1180px, 100% - 2 * var(--gutter) - var(--safe-l) - var(--safe-r));
  margin-inline: auto;
}
:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 3px; border-radius: 6px; }

/* Botões e selos -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 28px; border-radius: 999px;
  background: linear-gradient(90deg, var(--azul), var(--azul-claro));
  color: #fff; font-weight: 700; text-decoration: none; text-align: center;
  box-shadow: 0 6px 20px rgba(26, 115, 232, .35);
  transition: transform .2s, box-shadow .2s;
}
.btn--sm { min-height: 44px; padding: 8px 20px; font-size: .9rem; }
.btn--ghost { background: transparent; border: 2px solid var(--azul-claro); box-shadow: none; }
.selo {
  display: inline-block; margin: 0 0 14px; font-size: .78rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--azul-claro);
}
.selo--escuro { color: var(--azul); }

/* Topo ------------------------------------------------------------------ */
.topo {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borda);
}
.topo__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--topo-h); }
.topo__logo { flex-shrink: 0; }
.topo__logo img { height: 58px; width: auto; }
.menu { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 28px); }
.menu a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--azul-escuro); white-space: nowrap; }
.menu-btn {
  display: none; width: 48px; height: 48px; padding: 11px; margin-right: -11px;
  background: none; border: 0; cursor: pointer;
}
.menu-btn span {
  display: block; width: 26px; height: 3px; margin: 5px 0; background: var(--azul-escuro);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero / slider --------------------------------------------------------- */
.hero {
  color: #fff;
  background:
    linear-gradient(135deg, transparent 70%, rgba(46,168,255,.25) 70%, rgba(46,168,255,.25) 74%, transparent 74%),
    radial-gradient(ellipse at 80% 20%, #13306f 0%, transparent 60%),
    var(--azul-noite);
  position: relative; overflow: hidden;
  padding: clamp(36px, 6vw, 70px) 0 clamp(84px, 9vw, 100px);
  touch-action: pan-y;        /* swipe horizontal fica com o slider */
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; }
.hero h1, .hero__titulo { font-size: clamp(1.65rem, 3.6vw + .6rem, 3rem); font-weight: 800; }
.destaque { color: var(--azul-claro); }
.hero__sub { font-size: clamp(1rem, .5vw + .9rem, 1.15rem); color: #c9d6ee; max-width: 560px; margin: 0; }
.hero__acoes { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__img img { width: 100%; max-width: 520px; margin-inline: auto; filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); }

/* Todos os slides na mesma célula do grid: altura = a do maior, sem "pulo" */
.slides { display: grid; }
.slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden;
  transition: opacity .8s ease, visibility .8s;
}
.slide.ativo { opacity: 1; visibility: visible; }
.slide .hero__texto > * { transform: translateY(18px); opacity: 0; transition: transform .7s ease, opacity .7s ease; }
.slide.ativo .hero__texto > * { transform: none; opacity: 1; }
.slide.ativo .hero__texto > *:nth-child(2) { transition-delay: .1s; }
.slide.ativo .hero__texto > *:nth-child(3) { transition-delay: .2s; }
.slide.ativo .hero__texto > *:nth-child(4) { transition-delay: .3s; }
.slide .hero__img { transform: scale(.94); transition: transform 1s ease; }
.slide.ativo .hero__img { transform: none; }

.slider__seta {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer; padding: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(46,168,255,.5); background: rgba(10,22,51,.6);
  color: #fff; font-size: 28px; line-height: 1;
}
.slider__seta--ant { left: calc(16px + var(--safe-l)); }
.slider__seta--prox { right: calc(16px + var(--safe-r)); }
.slider__pontos {
  position: absolute; left: 0; right: 0; bottom: 26px; z-index: 5;
  display: flex; justify-content: center; gap: 2px;
}
/* alvo de toque de 44px, desenho de 12px */
.slider__pontos button {
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.slider__pontos button::before {
  content: ""; width: 12px; height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.35); transition: width .3s, background .3s;
}
.slider__pontos button.ativo::before { width: 34px; background: var(--azul-claro); }

/* Seções ---------------------------------------------------------------- */
.secao { padding: var(--secao-pad) 0; }
.secao--escura { background: var(--azul-noite); color: #fff; }
.secao__cab { text-align: center; max-width: 680px; margin: 0 auto clamp(32px, 5vw, 50px); }
.secao__cab h2, .sobre h2 { font-size: clamp(1.5rem, 2.4vw + .8rem, 2.3rem); color: var(--azul-escuro); }
.secao--escura .secao__cab h2 { color: #fff; }
.secao__cab p { color: var(--texto-suave); margin: 0; }
.secao--escura .secao__cab p { color: #c9d6ee; }

/* Cards de serviços: 3 → 2 → 1 colunas automaticamente ----------------- */
.cards {
  display: grid; gap: clamp(16px, 2.5vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}
.card {
  background: #fff; border: 1px solid var(--borda); border-radius: var(--raio);
  padding: clamp(22px, 3vw, 30px); box-shadow: var(--sombra); transition: transform .2s, border-color .2s;
}
.card h3 { font-size: 1.15rem; color: var(--azul-escuro); }
.card p { margin: 0; color: var(--texto-suave); font-size: .95rem; }
.card__ico {
  width: 56px; height: 56px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: var(--azul-noite); border: 2px solid var(--azul-claro);
}
.card__ico svg, .contato svg {
  width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Faixa Reforma --------------------------------------------------------- */
.faixa {
  color: #fff; padding: clamp(44px, 6vw, 64px) 0;
  background: linear-gradient(110deg, var(--azul-escuro), var(--azul) 120%);
}
.faixa__inner { display: flex; align-items: center; justify-content: space-between; gap: clamp(20px, 4vw, 40px); }
.faixa h2 { font-size: clamp(1.35rem, 2vw + .8rem, 2rem); }
.faixa p { color: #dbe7ff; margin: 0; max-width: 700px; }
.faixa .btn { flex-shrink: 0; background: #fff; color: var(--azul-escuro); }

/* Sobre ----------------------------------------------------------------- */
.secao#sobre { background: var(--fundo-alt); }
.sobre { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.sobre__img img { border-radius: var(--raio); box-shadow: var(--sombra); width: 100%; }
.sobre p { color: var(--texto-suave); }
.lista { list-style: none; padding: 0; margin: 20px 0 0; }
.lista li { position: relative; padding-left: 32px; margin-bottom: 12px; font-weight: 500; }
.lista li::before {
  content: "✓"; position: absolute; left: 0; top: .15em; width: 22px; height: 22px;
  border-radius: 50%; background: var(--azul); color: #fff;
  font-size: .75rem; display: grid; place-items: center;
}

/* Contato: 3 → 1 colunas automaticamente -------------------------------- */
.contatos {
  display: grid; gap: clamp(14px, 2vw, 20px);
  grid-template-columns: repeat(3, 1fr);
}
/* tablet / celular deitado: 2 colunas, o 3º ocupa a linha inteira (sem "órfão") */
@media (max-width: 1023px) {
  .contatos { grid-template-columns: repeat(2, 1fr); }
  .contato:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .contatos { grid-template-columns: 1fr; }
}
.contato {
  display: flex; align-items: center; gap: 16px; padding: clamp(18px, 2.5vw, 24px); text-decoration: none;
  border: 1px solid rgba(46,168,255,.35); border-radius: var(--raio);
  background: rgba(255,255,255,.04); transition: background .2s, border-color .2s;
  min-width: 0;
}
.contato svg { flex-shrink: 0; stroke: var(--azul-claro); }
.contato span { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.contato small { display: block; font-weight: 500; color: #9fb3d6; font-size: .8rem; }

/* Rodapé ---------------------------------------------------------------- */
.rodape { background: #060e22; color: #9fb3d6; padding: 26px 0 calc(26px + var(--safe-b)); font-size: .9rem; }
.rodape__inner { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.rodape p { margin: 0; }
.rodape strong { color: #fff; }

/* WhatsApp flutuante ---------------------------------------------------- */
.whats-flutuante {
  position: fixed; z-index: 60;
  right: calc(20px + var(--safe-r)); bottom: calc(20px + var(--safe-b));
  width: 58px; height: 58px; border-radius: 50%; background: #25d366;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.whats-flutuante svg { width: 32px; height: 32px; fill: #fff; }

/* 404 ------------------------------------------------------------------- */
.erro { min-height: 70vh; min-height: 70svh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.erro h1 { font-size: clamp(3.5rem, 10vw, 5rem); color: var(--azul); margin: 0; }

/* Hover só onde existe mouse (evita efeito "grudado" no toque) ---------- */
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(26, 115, 232, .45); }
  .btn--ghost:hover { background: rgba(46,168,255,.12); box-shadow: none; }
  .menu a:not(.btn):hover { color: var(--azul); }
  .slider__seta:hover { background: var(--azul); }
  .card:hover { transform: translateY(-4px); border-color: var(--azul-claro); }
  .contato:hover { background: rgba(46,168,255,.12); border-color: var(--azul-claro); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide, .slide .hero__texto > *, .slide .hero__img, .btn, .card, .menu-btn span { transition: none; }
}

/* Telas grandes --------------------------------------------------------- */
@media (min-width: 1600px) {
  .container { width: min(1320px, 100% - 2 * var(--gutter)); }
}

/* Abaixo de 1300px as setas desceriam sobre o texto: vão para junto dos pontos */
@media (max-width: 1299px) {
  .slider__seta {
    top: auto; bottom: 26px; transform: none;
    width: 44px; height: 44px; font-size: 26px;
  }
  .slider__seta--ant { left: calc(50% - 128px); }
  .slider__seta--prox { right: calc(50% - 128px); }
}

/* Tablet ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero__inner, .sobre { grid-template-columns: 1fr; }
  .hero__inner { text-align: center; }
  .hero__sub { margin-inline: auto; }
  .hero__acoes { justify-content: center; }
  .hero__img { order: -1; }
  .hero__img img { max-width: min(380px, 70%); }
  .sobre__img { max-width: 560px; margin-inline: auto; }
  .faixa__inner { flex-direction: column; align-items: flex-start; }
}

/* Menu hambúrguer ------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --topo-h: 68px; }
  .topo__logo img { height: 50px; }
  .menu-btn { display: block; }
  .menu {
    position: absolute; top: var(--topo-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--borda);
    box-shadow: 0 16px 30px rgba(10,22,51,.12);
    padding: 8px calc(var(--gutter) + var(--safe-r)) 20px calc(var(--gutter) + var(--safe-l));
    max-height: calc(100vh - var(--topo-h)); max-height: calc(100dvh - var(--topo-h));
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .menu.aberto { visibility: visible; opacity: 1; transform: none; }
  .menu a:not(.btn) { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--borda); }
  .menu .btn { margin-top: 16px; }
}

/* Celular --------------------------------------------------------------- */
@media (max-width: 560px) {
  .hero__acoes { flex-direction: column; align-items: stretch; }
  .hero__acoes .btn, .faixa .btn { width: 100%; }
  .hero__img img { max-width: min(280px, 80%); }
  .secao__cab { text-align: left; }
  .rodape__inner { flex-direction: column; padding-right: 72px; } /* não fica sob o botão do WhatsApp */
  .whats-flutuante { width: 54px; height: 54px; right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); }
}

@media (max-width: 380px) {
  :root { --topo-h: 62px; }
  .topo__logo img { height: 42px; }
  .selo { letter-spacing: .12em; font-size: .72rem; }
  .card { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; }
  .card__ico { width: 48px; height: 48px; margin: 0; grid-row: span 2; }
  .card__ico svg { width: 24px; height: 24px; }
  .contato { padding: 16px; gap: 12px; }
}

/* Celular deitado (pouca altura): hero em 2 colunas compacto ------------ */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --topo-h: 60px; }
  .topo__logo img { height: 42px; }
  .hero { padding: 24px 0 72px; }
  .hero__inner { grid-template-columns: 1.4fr 1fr; text-align: left; }
  .hero__img { order: 0; }
  .hero__img img { max-width: 220px; }
  .hero__sub { margin-inline: 0; }
  .hero__acoes { flex-direction: row; justify-content: flex-start; margin-top: 18px; }
  .hero__acoes .btn { width: auto; }
  .hero h1, .hero__titulo { font-size: clamp(1.4rem, 3.2vw, 2rem); }
  .menu { max-height: calc(100dvh - var(--topo-h)); }
}
