/* ===== Variáveis / Tema ===== */
:root {
  --green: #1e5e44;
  --green-dark: #14422f;
  --green-soft: #e8f0eb;
  --bg: #ffffff;
  --surface: #f3f3f3;
  --line: #e2e2e2;
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --maxw: 1100px;
  --gap: 24px;

  /* ===== Escala tipográfica (estilo Apple HIG) ===== */
  --fs-display:  clamp(1.5rem, 4vw, 1.75rem);    /* nome / título principal */
  --fs-title:    clamp(1.375rem, 3.5vw, 1.625rem); /* títulos de seção */
  --fs-stat:     clamp(1.375rem, 3.5vw, 1.5rem);  /* números de destaque */
  --fs-headline: 1.125rem;   /* títulos de card / texto enfatizado */
  --fs-body:     1rem;       /* corpo de texto padrão */
  --fs-subhead:  .9375rem;   /* subtítulos / legendas secundárias */
  --fs-caption:  .8125rem;   /* rótulos pequenos */

  --lh-tight: 1.15;
  --lh-snug:  1.35;
  --lh-body:  1.55;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ===== Carregamento / erro ===== */
.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 50;
}
.boot__spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot__error { text-align: center; color: var(--muted); padding: 24px; }
.boot__error p { font-size: var(--fs-headline); margin-bottom: 6px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { margin-top: 44px; }
.section__title {
  font-size: var(--fs-title); font-weight: 700; line-height: var(--lh-tight);
  letter-spacing: -.01em; margin-bottom: 18px;
}

/* ===== Animação de entrada (cascata) ===== */
@keyframes subir {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.up { opacity: 0; animation: subir .6s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .up { animation: none; opacity: 1; }
}

/* ===== Hero / Perfil ===== */
.hero { padding-top: 22px; }
.hero__inner { display: flex; flex-direction: column; --avatar-x: 20px; }

/* Capa */
.cover { position: relative; }
.cover__media {
  height: clamp(200px, 40vw, 340px); border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
.cover__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Avatar sobreposto */
.profile__avatar {
  position: absolute; left: var(--avatar-x); bottom: -34px; z-index: 2;
  width: 92px; height: 92px; border-radius: 50%;
  border: 4px solid var(--bg); background: var(--bg);
}
.profile__avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 22%;
  border-radius: 50%; background: var(--surface);
}
.profile__avatar img.is-placeholder,
.profile__avatar:has(img:not([src])) img {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
.profile__badge {
  position: absolute; right: 0; bottom: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #2196f3; color: #fff; border: 3px solid var(--bg);
  display: grid; place-items: center;
}
.profile__badge svg { width: 16px; height: 16px; fill: currentColor; }

/* Linha do nome + ações — nome alinhado com o avatar */
.hero__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 46px; padding-left: var(--avatar-x);
}
.profile__id { min-width: 0; }
.profile__name {
  font-size: var(--fs-display); font-weight: 700;
  line-height: var(--lh-tight); letter-spacing: -.02em;
}
.profile__role { color: var(--muted); font-size: var(--fs-subhead); }

.hero__actions { display: flex; gap: 10px; flex: 0 0 auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: var(--green-dark);
  background: rgba(30, 94, 68, .09);
  transition: background .2s, transform .12s;
}
@media (hover: hover) {
  .icon-btn:hover { background: rgba(30, 94, 68, .16); }
}
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 20px; height: 20px; }

/* Stats + chamar */
.hero__meta { display: flex; flex-direction: column; gap: 22px; margin-top: 24px; }
.stats { display: flex; width: 100%; }
.stats__item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 2px 8px;
}
.stats__item + .stats__item { border-left: 1px solid var(--line); }
.stats__num { font-size: var(--fs-stat); font-weight: 700; line-height: 1.2; }
.stats__label { color: var(--muted); font-size: var(--fs-caption); }

/* Skeleton do número — mesma altura calculada pra ZERO layout shift.
   Shimmer suave indica progresso sem distrair. */
.stats__skeleton {
  display: inline-block;
  width: 2.4ch;
  height: calc(var(--fs-stat) * 1.2); /* casa com line-height do .stats__num */
  border-radius: 6px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--line) 70%, transparent),
    color-mix(in srgb, var(--surface) 60%, transparent),
    color-mix(in srgb, var(--line) 70%, transparent));
  background-size: 200% 100%;
  animation: statsShimmer 1.2s linear infinite;
  vertical-align: middle;
}
@keyframes statsShimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stats__skeleton { animation: none; }
}

/* Transição suave quando o valor real entra. Sem "salto" perceptível. */
.stats__item--ready .stats__num {
  animation: statsFadeIn .28s ease both;
}
@keyframes statsFadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .stats__item--ready .stats__num { animation: none; }
}

.hero__cta { width: 100%; }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 24px; border-radius: 999px; font-weight: 600; font-size: var(--fs-body);
  letter-spacing: .01em;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--green); color: #fff; }
.btn--ghost { background: rgba(30, 94, 68, .09); color: var(--green-dark); border: 0; }
.btn--block { width: 100%; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--green-dark); }
  .btn--ghost:hover { background: rgba(30, 94, 68, .16); }
}

/* ===== Carrossel ===== */
.carousel { position: relative; }
.carousel__track {
  display: flex; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 4px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 80%; scroll-snap-align: center; }
.slide__img {
  width: 100%; aspect-ratio: 3 / 4; display: block;
  object-fit: cover; object-position: center;
  border-radius: var(--radius-lg); background-color: var(--surface);
}

.carousel__dots {
  display: flex; justify-content: center; align-items: center;
  gap: 10px; margin-top: 20px;
}
.carousel__dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--line); padding: 0; border: 0;
  transition: width .28s cubic-bezier(.4, 0, .2, 1), background .28s ease;
}
@media (hover: hover) { .carousel__dot:hover { background: #c4c4c4; } }
.carousel__dot.is-active {
  width: 28px; background: var(--green);
}

/* ===== Texto / Sobre ===== */
.prose { color: var(--muted); font-size: var(--fs-body); line-height: var(--lh-body); max-width: 60ch; }

/* ===== Cards ===== */
.card { border-radius: var(--radius); }
.card--services { border: 1.5px solid var(--line); padding: 22px; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card__title { font-size: var(--fs-headline); font-weight: 600; line-height: var(--lh-tight); }
.card__link {
  color: var(--green-dark); font-weight: 600; font-size: var(--fs-subhead); white-space: nowrap;
  background: rgba(30, 94, 68, .09); padding: 8px 14px; border-radius: 999px;
  transition: background .2s;
}
@media (hover: hover) { .card__link:hover { background: rgba(30, 94, 68, .16); } }
.services li {
  color: var(--muted); font-size: var(--fs-body); line-height: var(--lh-snug);
  padding: 7px 0; counter-increment: svc;
}
.services { counter-reset: svc; }
.services li::before { content: counter(svc) "- "; color: var(--muted); font-weight: 600; }

.card--note {
  margin-top: 18px; background: var(--surface); padding: 22px;
  display: flex; align-items: center; gap: 14px;
}
.card__note-icon { font-size: 1.5rem; }
.card__note-title { color: var(--muted); font-size: var(--fs-subhead); }
.card__note-text { font-weight: 600; font-size: var(--fs-headline); line-height: var(--lh-tight); }

/* ===== Mapa ===== */
.map {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  position: relative; height: clamp(200px, 42vw, 320px);
}
.map iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: calc(100% + 64px); border: 0; display: block;
  filter: saturate(0.82) contrast(1.02);
}

/* ===== Avaliações ===== */
.reviews {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 6px; margin-bottom: 18px;
}
.reviews::-webkit-scrollbar { display: none; }
.review {
  flex: 0 0 80%; scroll-snap-align: center; background: var(--surface);
  border-radius: var(--radius); padding: 28px 24px; min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.review__star { font-size: 1.6rem; }
.review__stars {
  font-size: 1.05rem; color: #f5a623; letter-spacing: 2px; line-height: 1;
}
.review__text {
  color: var(--text); font-size: var(--fs-body); line-height: var(--lh-body);
  flex: 1; margin: 14px 0 0;
}
.review__foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.review__author {
  color: var(--text); font-size: var(--fs-caption); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.review__date {
  color: var(--muted); font-size: var(--fs-caption); font-weight: 400;
  flex: 0 0 auto;
}

/* ===== Bottom Sheet de Avaliação ===== */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background .35s ease;
}
.sheet-backdrop.is-open {
  background: rgba(0, 0, 0, .48);
  pointer-events: all;
}

/* Sheet "flutuante" — descolado das laterais e da base, todos os cantos
   arredondados. Sensação de cartão suspenso ao invés de painel colado.
   Margens são tokens calibrados pra responsividade: 8px em telas pequenas,
   centralizado em desktop (definido lá embaixo na media query). */
.sheet {
  position: fixed; z-index: 101;
  /* Descola da base respeitando home indicator do iOS */
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  left: 8px; right: 8px;
  background: var(--bg);
  border-radius: 24px; /* uniforme nos 4 cantos */
  /* Altura limitada deixando respiro pro backdrop em cima */
  max-height: calc(88svh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 8px;
  /* Sombra mais marcada — enfatiza a flutuação do cartão */
  box-shadow:
    0 12px 48px rgba(0, 0, 0, .18),
    0 2px 8px rgba(0, 0, 0, .06);
  /* Sai completamente da viewport contando as margens */
  transform: translateY(calc(100% + 24px));
  transition: transform .42s cubic-bezier(.32, .72, 0, 1);
  visibility: hidden;
  will-change: transform;
  outline: none;
}
/* Sobrescreve padding-bottom global pra criar respiro extra entre botão
   e a curva inferior do cartão (evita conflito de curvaturas próximas). */
.sheet { padding-bottom: 12px; }
.sheet.is-open {
  transform: translateY(0);
  visibility: visible;
}

/* Desktop / tablet: vira modal centralizado (vertical + horizontal),
   padrão macOS/iOS web. Sai do estilo "bottom sheet" porque em telas
   grandes ele parece esquecido na base, desalinhado do conteúdo. */
@media (min-width: 600px) {
  .sheet {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(480px, calc(100% - 32px));
    max-height: min(620px, 85vh);
    /* Fechado: fora da viewport (deslocado pra baixo) */
    transform: translate(-50%, calc(-50% + 100vh));
  }
  .sheet.is-open {
    transform: translate(-50%, -50%);
  }
}

/* Handle — mais compacto, dá sinal de "arraste" sem ocupar espaço */
.sheet__handle-bar {
  display: flex; justify-content: center;
  padding: 10px 0 4px; cursor: grab; touch-action: none; user-select: none;
}
.sheet__handle-bar:active { cursor: grabbing; }
.sheet__handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--line);
}

/* Header — divisor mais sutil pra não cortar o cartão visualmente */
.sheet__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.sheet__profile { display: flex; align-items: center; gap: 12px; }
.sheet__avatar-wrap { position: relative; flex: 0 0 auto; }
.sheet__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; object-position: center 22%;
  background: var(--surface); display: block;
}
.sheet__avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #2196f3; color: #fff; border: 2px solid var(--bg);
  display: grid; place-items: center;
}
.sheet__avatar-badge svg { width: 10px; height: 10px; fill: currentColor; }
.sheet__name { font-weight: 700; font-size: var(--fs-body); line-height: 1.2; }
.sheet__role { color: var(--muted); font-size: var(--fs-caption); }

.sheet__close {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: var(--surface); display: grid; place-items: center;
  color: var(--muted); transition: background .2s, color .2s;
  outline: none;
}
.sheet__close:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}
@media (hover: hover) { .sheet__close:hover { background: var(--line); color: var(--text); } }
.sheet__close svg { width: 18px; height: 18px; }

/* Corpo — padding lateral ampliado e respiro inferior generoso pra que
   o botão de envio respire em relação às curvas do cartão. */
.sheet__body { padding: 22px 22px 14px; }
.sheet__title {
  font-size: var(--fs-headline); font-weight: 700;
  line-height: var(--lh-tight); margin-bottom: 4px;
  text-align: center;
}
.sheet__subtitle {
  color: var(--muted); font-size: var(--fs-caption);
  margin-bottom: 16px; line-height: var(--lh-snug);
  text-align: center;
}

/* Estrelas */
.stars-row {
  display: flex; justify-content: center; gap: 4px;
  margin-bottom: 6px;
}
.star-btn {
  font-size: 2.2rem; color: var(--line); padding: 4px 3px;
  transition: color .12s ease, transform .1s ease;
  line-height: 1; user-select: none; -webkit-tap-highlight-color: transparent;
}
.star-btn.is-active { color: #f5a623; }
.star-btn:active { transform: scale(.82); }
@media (hover: hover) { .star-btn:hover { transform: scale(1.15); } }

.stars__label {
  text-align: center; font-size: var(--fs-subhead); font-weight: 600;
  color: var(--green-dark); min-height: 1.4em; margin-bottom: 16px;
}

/* Campos agrupados — estilo Apple ────────────────────────────────── */
.field-group {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 18px;
  transition: border-color .2s;
}
.field-group:focus-within { border-color: var(--green); }

.field-row {
  display: flex; align-items: center;
  min-height: 50px; padding: 0 16px;
  background: var(--bg);
}
.field-row--stacked {
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 16px;
  position: relative;
}
.field-row__input--ta {
  width: 100%; margin-top: 6px;
  resize: none;
}
.field-row--stacked.field-row--comment {
  padding-bottom: 28px;
}
.field-row--comment .field-row__input--ta {
  min-height: 52px;
}
.field-row__sep {
  height: 1px; background: var(--line); margin-left: 16px;
}

.field-row__label {
  font-size: var(--fs-subhead); font-weight: 600;
  color: var(--text); min-width: 80px; flex: 0 0 auto;
  line-height: 1; pointer-events: none; padding-right: 8px;
}
.field-row__label.is-required::after {
  content: " *";
  color: #e53935;
  font-weight: 400;
}
.field-row__header {
  display: flex; align-items: baseline; gap: 6px;
}
.field-row__hint {
  font-size: var(--fs-caption); font-weight: 400;
  color: var(--muted);
}
.field-row__label--top { padding-top: 1px; }
.field-row__label-stack {
  display: flex; flex-direction: column;
  min-width: 80px; flex: 0 0 auto;
  padding-right: 8px; padding-top: 1px;
}

.field-row__input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  font: inherit; font-size: var(--fs-body);
  color: var(--text); background: transparent;
  padding: 0; line-height: var(--lh-body);
  resize: none;
}
.field-row__input::placeholder { color: var(--muted); }
.field-row__input:-webkit-autofill,
.field-row__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
}

.field__counter {
  position: absolute; right: 14px; bottom: 9px;
  font-size: var(--fs-caption); color: var(--muted);
  pointer-events: none; transition: color .2s;
}
.field__counter.is-low { color: #e53935; font-weight: 600; }

/* Botão submit */
.sheet__submit:disabled { opacity: .4; cursor: not-allowed; }
.sheet__submit:disabled:active { transform: none; }
.sheet__submit.is-loading { opacity: .65; cursor: wait; pointer-events: none; }

.sheet__disclaimer {
  text-align: center; color: var(--muted); font-size: var(--fs-caption);
  margin-top: 12px; padding-bottom: 20px; line-height: var(--lh-body);
}

/* Estado: cooldown (já avaliou recentemente) */
.sheet__cooldown {
  padding: 40px 28px 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center;
}
.cooldown__icon { font-size: 2.8rem; }
.cooldown__title { font-size: var(--fs-headline); font-weight: 700; line-height: var(--lh-tight); }
.cooldown__text  { color: var(--muted); font-size: var(--fs-body); max-width: 28ch; }

/* Estado: sucesso */
.sheet__success {
  padding: 44px 28px 28px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
}
.success__icon { width: 72px; height: 72px; }
.success__icon svg { width: 100%; height: 100%; }

.success__circle {
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: desenharCirculo .5s .1s cubic-bezier(.4, 0, .2, 1) forwards;
}
.success__check {
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: desenharCheck .3s .55s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes desenharCirculo { to { stroke-dashoffset: 0; } }
@keyframes desenharCheck   { to { stroke-dashoffset: 0; } }

.success__title { font-size: var(--fs-headline); font-weight: 700; line-height: var(--lh-tight); }
.success__text  { color: var(--muted); font-size: var(--fs-body); max-width: 28ch; }

/* ===== Footer ===== */
.footer {
  margin-top: 56px; padding: 28px 22px; text-align: center;
  color: var(--muted); font-size: var(--fs-caption); border-top: 1px solid var(--line);
}

/* ===== Desktop ===== */
@media (min-width: 820px) {
  .hero { padding-top: 40px; }
  .hero__inner { --avatar-x: 28px; }
  .profile__avatar { bottom: -40px; width: 120px; height: 120px; }
  .hero__head { margin-top: 54px; }
  .hero__meta {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: clamp(24px, 4vw, 56px); margin-top: 28px;
  }
  .stats { width: auto; }
  .stats__item { padding-inline: clamp(16px, 2.5vw, 32px); }
  .hero__cta { width: auto; min-width: 260px; flex: 0 0 auto; }

  .slide { flex-basis: 40%; }
  .review { flex-basis: 40%; }

  /* layout em 2 colunas: Sobre+serviços | mapa */
  .prose { font-size: 1.15rem; }
}

@media (min-width: 1024px) {
  .slide { flex-basis: 32%; }
}

/* Acessibilidade: respeitar quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel__track, .reviews { scroll-behavior: auto; }
}
