/* ==========================================================================
   Página de pré-cadastro — locação Arruda/Colombo
   Sem frameworks. Mobile-first.
   ========================================================================== */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d221f;
  --ink-2: #4a524d;
  --muted: #7a817c;
  --line: #e4e0d6;
  --accent: #2f5b4a;
  --accent-ink: #ffffff;
  --accent-soft: #e7efe9;
  --sand: #efe9dc;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 34, 31, .05), 0 8px 24px rgba(29, 34, 31, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --wrap: 760px;
  --sticky-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--sticky-h) + env(safe-area-inset-bottom));
}

img { display: block; max-width: 100%; }
a { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.65rem, 5.5vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 4.2vw, 1.6rem); }
p { margin: 0 0 1em; }

svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: .92rem; }
.section { padding-top: 40px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 .98rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #264c3d; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn--lg { min-height: 54px; font-size: 1.05rem; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }

.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; letter-spacing: .01em; }
.brand svg { color: var(--accent); }

/* ---------- Galeria ---------- */
.gallery { padding-top: 16px; }
.gallery__stage { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sand); aspect-ratio: 4 / 3; box-shadow: var(--shadow); touch-action: pan-y; }
@media (min-width: 700px) { .gallery__stage { aspect-ratio: 16 / 10; } }

.gallery__main { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: var(--ink); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }
.gallery__count { position: absolute; right: 12px; bottom: 12px; background: rgba(20, 24, 22, .7); color: #fff; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .03em; }
.gallery__caption { position: absolute; left: 12px; bottom: 12px; background: rgba(255,255,255,.92); color: var(--ink); font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.thumb { all: unset; flex: 0 0 76px; height: 56px; border-radius: 8px; overflow: hidden; cursor: pointer; scroll-snap-align: start; background: var(--sand); opacity: .6; outline: 2px solid transparent; outline-offset: -2px; transition: opacity .15s, outline-color .15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { opacity: 1; outline-color: var(--accent); }
.thumb:focus-visible { outline: 3px solid var(--accent); }

/* Espaço reservado enquanto não há foto real */
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: #8d8676; background: repeating-linear-gradient(135deg, #efe9dc 0 14px, #ebe4d5 14px 28px); text-align: center; font-size: .9rem; font-weight: 600; }
.placeholder svg { width: 36px; height: 36px; stroke-width: 1.4; }
.thumb .placeholder { font-size: 0; gap: 0; }
.thumb .placeholder svg { width: 20px; height: 20px; }

/* ---------- Resumo ---------- */
.intro { padding-top: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .5em; }
.location { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-bottom: 20px; }

.price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.price__value { font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -.02em; }
.price__unit { color: var(--ink-2); margin-left: 2px; }
.price__note { color: var(--muted); font-size: .92rem; }

.features { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem; color: var(--ink-2); }
.features li strong { color: var(--ink); }
.features svg { color: var(--accent); width: 22px; height: 22px; }

/* ---------- Condições ---------- */
.terms { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 560px) { .terms { grid-template-columns: 1fr 1fr; } }
.terms > div { padding: 16px 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) {
  .terms > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .terms > div:nth-last-child(-n+2) { border-bottom: 0; }
}
.terms > div:last-child { border-bottom: 0; }
.terms dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.terms dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; }
.terms small { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); }

/* ---------- Passos ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; align-items: start; }
.steps li::before { content: counter(step); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.steps strong { display: block; }
.steps span { color: var(--ink-2); font-size: .95rem; }

/* ---------- Formulário ---------- */
.form-section { scroll-margin-top: 72px; }
.form-section:focus { outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 24px 20px; box-shadow: var(--shadow); }
@media (min-width: 640px) { .card { padding: 36px; } }

fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); padding: 20px 0 12px; }

.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.req { color: var(--danger); }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }

input[type="text"], input[type="tel"], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 16px/1.4 var(--font); color: var(--ink);
  background: #fcfbf8; border: 1px solid #d6d1c5; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 110px; }
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a524d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background-color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.is-invalid input, .is-invalid select, .is-invalid textarea { border-color: var(--danger); background-color: var(--danger-soft); }
.error { margin: 6px 0 0; font-size: .85rem; color: var(--danger); font-weight: 500; min-height: 0; }
.error:empty { display: none; }

.choices { display: flex; gap: 10px; }
.choice { flex: 1; position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid #d6d1c5; border-radius: var(--radius-sm); background: #fcfbf8; font-weight: 600; transition: all .15s; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.is-invalid .choice span { border-color: var(--danger); }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; font-size: .93rem !important; color: var(--ink-2); cursor: pointer; }
.check input { flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.is-invalid .check { color: var(--danger); }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.demo-banner { background: #fff7e0; border: 1px solid #f0dc9c; color: #6b5310; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 8px; }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f1c6c3; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin: 4px 0 16px; }

/* ---------- Sucesso ---------- */
.success { text-align: center; padding: 24px 4px; }
.success:focus { outline: none; }
.success__icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.success__icon svg { width: 32px; height: 32px; stroke-width: 2.2; }
.success p { color: var(--ink-2); max-width: 46ch; margin: 0 auto; font-size: 1.05rem; }

/* ---------- Privacidade ---------- */
.privacy details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.privacy summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--muted); line-height: 1; }
.privacy details[open] summary::after { content: "–"; }
.privacy__body { padding: 0 20px 8px; font-size: .92rem; color: var(--ink-2); }

/* ---------- Rodapé ---------- */
.footer { padding: 40px 0 32px; text-align: center; font-size: .9rem; color: var(--ink-2); }
.footer p { margin: 0 0 4px; }

/* ---------- Barra fixa (celular) ---------- */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--sticky-h); padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(29,34,31,.06);
  transition: transform .2s ease;
}
.stickybar strong { font-family: var(--serif); font-size: 1.3rem; }
.stickybar span { color: var(--ink-2); font-size: .9rem; }
.stickybar small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.2; }
.stickybar.is-hidden { transform: translateY(110%); }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .stickybar { display: none; }
}

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 14, 13, .96); color: #fff; }
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox::backdrop { background: rgba(12, 14, 13, .9); }
.lightbox__figure { margin: 0; height: 100%; display: grid; place-items: center; align-content: center; gap: 12px; padding: 56px 0 24px; touch-action: pan-y; min-width: 0; }
.lightbox__figure img { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; }
.lightbox__figure .placeholder { width: min(90vw, 720px); height: auto; aspect-ratio: 4/3; border-radius: 12px; }
.lightbox__figure figcaption { font-size: .9rem; color: rgba(255,255,255,.8); }
.lightbox__close, .lightbox__nav { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.lightbox__nav { margin: 0 8px; }
@media (max-width: 600px) { .lightbox__nav { position: absolute; bottom: 20px; } .lightbox__nav--prev { left: calc(50% - 56px); } .lightbox__nav--next { right: calc(50% - 56px); } .lightbox[open] { grid-template-columns: 1fr; } }
.gallery__main .placeholder span { display: none; }

/* ---------- Endereço, destaques e fotos verticais ---------- */
.location { margin-bottom: 12px; align-items: flex-start; }
.location svg { margin-top: .2em; }
.maps-btn { margin-bottom: 20px; gap: 8px; }
.maps-btn svg { color: var(--accent); }

.lead { font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 16px; margin-bottom: 20px; }

.highlights { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 560px) { .highlights { grid-template-columns: 1fr 1fr; } }
.highlights li { position: relative; padding: 14px 18px 14px 44px; border-bottom: 1px solid var(--line); }
.highlights li::before { content: ""; position: absolute; left: 18px; top: 19px; width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.highlights strong { display: block; font-weight: 600; }
.highlights span { display: block; color: var(--ink-2); font-size: .92rem; }
.highlights li:last-child { border-bottom: 0; }
@media (min-width: 560px) {
  .highlights li:nth-child(odd) { border-right: 1px solid var(--line); }
  .highlights li:nth-last-child(-n+2) { border-bottom: 0; }
}

/* As fotos são verticais (3:4): no celular o palco também é vertical;
   no desktop a foto aparece inteira sobre um fundo desfocado da própria imagem. */
.gallery__stage { aspect-ratio: 4 / 5; }
.gallery__main { position: relative; overflow: hidden; }
.gallery__main .bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(22px) brightness(.85); display: none; }
@media (min-width: 700px) {
  .gallery__stage { aspect-ratio: 4 / 3; }
  .gallery__main .bg { display: block; }
  .gallery__main img:not(.bg) { position: relative; object-fit: contain; }
}
.thumb { flex-basis: 60px; height: 76px; }
