/* Viaggio — página de agendamento.
   Valores lidos de docs/identidade-visual.md. Cor sempre como token. */

:root {
  --bg: #F2EDE4;          /* calcário */
  --surface: #FBF8F2;
  --accent: #B45F3C;      /* terracota */
  --accent-ink: #F2EDE4;
  --text: #2A1F14;        /* espresso */
  --muted: #6B5A45;       /* marrom suave */
  --line: rgba(180, 95, 60, 0.28);
  --focus: #B45F3C;
  --error: #9E2B1E;
  --hero-bg: #F2EDE4;     /* a capa não tem modo escuro */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1520;        /* noite */
    --surface: #16202C;   /* noite elevada */
    --accent: #C98A5C;    /* cobre */
    --accent-ink: #0D1520;
    --text: #EAE4D8;      /* areia */
    --muted: #8A7A67;
    --line: rgba(201, 138, 92, 0.35);
    --focus: #E3A876;
    --error: #F08A73;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1520; --surface: #16202C; --accent: #C98A5C; --accent-ink: #0D1520;
  --text: #EAE4D8; --muted: #8A7A67; --line: rgba(201, 138, 92, 0.35);
  --focus: #E3A876; --error: #F08A73;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ---------- capa ---------- */
.hero {
  background:
    radial-gradient(ellipse 120% 60% at 50% 110%, rgba(180,95,60,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 40% at 80% 10%, rgba(140,160,100,0.08) 0%, transparent 60%),
    var(--hero-bg);
  color: #2A1F14;
  text-align: center;
  padding: 24px 16px 40px;
}
/* Duas camadas tiradas da arte escolhida (docs/arte/ESCOLHIDA-splash-2k.png):
   as palmeiras numa faixa com o dobro da largura (espelho + original) e o carro
   com o miolo opaco, para as palmeiras passarem por trás dele. */
.hero-art {
  position: relative;
  height: 192px;
  max-width: 344px;
  margin: 0 auto;
  overflow: hidden;
  /* as bordas somem no papel, para a paisagem entrar e sair sem corte */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hero-palms {
  position: absolute; top: 0; left: 0;
  width: 200%; height: 100%;
  background: url("img/palms.png") 0 0 / 100% 100% no-repeat;
  transform: translateX(-50%); /* posição final = a arte original */
}
.hero-car {
  position: absolute; inset: 0;
  background: url("img/car.png") center / 100% 100% no-repeat;
}

/* Ao abrir: a paisagem corre para a esquerda e desacelera até parar (~3 s),
   enquanto o carro chega um pouco e balança de leve, como em movimento. */
@media (prefers-reduced-motion: no-preference) {
  .hero-palms { animation: viaggio-scenery 3.2s cubic-bezier(.25, .6, .3, 1) both; }
  .hero-car   { animation: viaggio-arrive 3.2s cubic-bezier(.25, .6, .3, 1) both,
                           viaggio-bob 0.4s ease-in-out 6; }
}
@keyframes viaggio-scenery {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes viaggio-arrive {
  from { translate: -14px 0; }
  to   { translate: 0 0; }
}
@keyframes viaggio-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.2px); }
}
.brand {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 54px;
  letter-spacing: 2px;
  margin: 8px 0 4px;
  color: #2A1F14;
}
.descriptor {
  font-size: 10px;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: #B45F3C;
  margin: 0;
}
.ornament {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 18px 0;
}
.ornament span { width: 36px; height: 1px; background: rgba(180,95,60,0.35); }
.ornament i { width: 5px; height: 5px; background: #B45F3C; transform: rotate(45deg); }
.slogan {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 17px;
  color: #6B5A45;
  margin: 0;
  line-height: 1.4;
}

/* ---------- formulário ---------- */
main {
  max-width: 560px;
  margin: -16px auto 0;
  padding: 0 16px 48px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 20px 24px;
  position: relative;
}
.section-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  text-align: center;
  margin: 0 0 8px;
}
fieldset { border: 0; padding: 0; margin: 20px 0 0; }
legend {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 0;
}
.field { display: block; margin-bottom: 14px; }
.field > span, .field > label {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row .field { min-width: 0; }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* evita zoom automático no iPhone */
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  min-height: 46px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: 0.7; }

/* ---------- busca de endereço ---------- */
.place { position: relative; }
.suggestions {
  position: absolute; z-index: 10; left: 0; right: 0; top: 100%;
  margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(42, 31, 20, 0.12);
}
.suggestions [role="option"] {
  padding: 10px 12px; cursor: pointer; line-height: 1.3;
}
.suggestions [role="option"] strong { display: block; font-weight: 400; color: var(--text); }
.suggestions [role="option"] span { font-size: 13px; color: var(--muted); }
.suggestions [role="option"]:hover,
.suggestions [role="option"][aria-selected="true"] { background: var(--bg); }
.suggestions .powered {
  padding: 6px 12px 4px; font-size: 11px; color: var(--muted); text-align: right;
}

/* ---------- estimativa ---------- */
.quote {
  text-align: center;
  margin: 8px 0 4px;
  padding: 20px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.quote-label {
  margin: 0; font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--accent);
}
.quote-price {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  line-height: 1.1;
}
.quote-meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.quote-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.quote-status { margin: 4px 0 0; font-size: 14px; color: var(--muted); text-align: center; min-height: 1px; }

fieldset:disabled { opacity: 0.45; }
.demo-banner {
  margin: 0 0 4px; padding: 8px 12px; font-size: 12px; text-align: center;
  color: var(--muted); border: 1px dashed var(--line);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-fare { margin: 6px 0 4px; }
.field.unit { margin-top: -6px; }

/* ---------- preferências (toque, sem digitar) ---------- */
.prefs { margin: 4px 0 14px; }
.prefs-title {
  margin: 0 0 8px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
}
.prefs-title em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.pref-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pref-label { flex: 0 0 100%; font-size: 13px; color: var(--text); }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: 9px 14px; min-height: 40px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; color: var(--text); background: var(--bg);
}
.chip input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 14px 0 0; line-height: 1.5; }
.error { color: var(--error); font-size: 14px; margin: 8px 0 0; text-align: center; }

.done { text-align: center; }
.done #done-summary { line-height: 1.6; margin: 12px 0 0; }

/* ---------- pagamento ---------- */
.card-element {
  min-height: 46px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.card-element.demo { color: var(--muted); font-size: 15px; letter-spacing: 1px; }
.pay-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.pay-note strong { color: var(--text); font-weight: 400; }
.pay-note a { color: var(--accent); }
.stripe-badge { margin-top: 4px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* ---------- política de cancelamento ---------- */
.quote-cancel { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.quote-cancel a, .policy a { color: var(--accent); }
.policy { margin-top: 20px; }
.policy ul { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.policy li { margin-bottom: 6px; }
.policy strong { color: var(--text); font-weight: 400; }

/* ---------- chat ---------- */
.chat-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 12px; font-weight: 400; letter-spacing: 2px; text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(42, 31, 20, 0.25);
  cursor: pointer;
}
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--text); color: var(--bg);
  font-style: normal; font-size: 11px; line-height: 20px; letter-spacing: 0; text-align: center;
}
.chat-is-open .chat-fab { display: none; }

.chat {
  position: fixed; z-index: 50;
  right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(42, 31, 20, 0.25);
  overflow: hidden;
}
.chat[hidden] { display: none; }
@media (max-width: 480px) {
  .chat { right: 0; left: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.chat-title { margin: 0; font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 24px; line-height: 1; }
.chat-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.chat-close {
  border: 0; background: none; color: var(--muted); font-size: 28px; line-height: 1;
  width: 44px; height: 44px; cursor: pointer;
}
.chat-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg);
}
.msg {
  max-width: 82%; margin: 0; padding: 10px 14px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  border-radius: 14px;
}
.msg-viaggio { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-customer { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg-note { align-self: center; margin: 4px 0; font-size: 12px; color: var(--muted); text-align: center; max-width: 90%; }
.chat-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-intro { display: grid; gap: 8px; margin-bottom: 8px; }
.chat-intro[hidden] { display: none; }
.chat-form input, .chat-form textarea { min-height: 42px; padding: 10px 12px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; max-height: 120px; }
.chat-send {
  flex: none; width: 44px; height: 42px;
  border: 0; border-radius: 2px; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.chat-send:disabled { opacity: 0.6; }
.chat-error { margin: 6px 0 0; font-size: 13px; color: var(--error); }

.foot {
  text-align: center;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 16px 96px; /* espaço para o botão do chat não cobrir o rodapé */
}
