/* POC — visual inspirado no site do Noon Apartments:
   preto, branco e cinzas, cantos retos, bordas finas e tipografia grotesca. */

:root {
  --ink: #111111;
  --ink-soft: #3f3f3f;
  --muted: #767676;
  --paper: #ffffff;
  --panel: #f7f7f7;
  --line: #e4e4e4;
  --line-strong: #d1d1d1;
  --ok: #16794c;
  --warn: #a05a00;
  --err: #b3261e;
}

* { box-sizing: border-box; }

/* Garante que o atributo `hidden` sempre esconda (evita conflito com display:flex). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ topo */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.4rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .13em;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .letter-o {
  width: .72em;
  height: .72em;
  border: .13em solid currentColor;
  border-radius: 50%;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar-tag { color: var(--ink-soft); }

/* ------------------------------------------------------------------ faixa da estadia + etapas */
.shell { max-width: 1240px; margin: 0 auto; padding-inline: 2.5rem; }

.stay-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.6rem;
  border: 1px solid var(--line);
}
.stay-cell {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .85rem 1.1rem;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.stay-cell:last-child { border-right: 0; }
.stay-label {
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.stay-cell strong {
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steps { display: flex; align-items: center; margin-top: 1.1rem; }
.step { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .85rem; }
.step:not(:last-child) { flex: 1; }
.step:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  margin: 0 1.1rem;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}
.step.active { color: var(--ink); }
.step.active .step-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.step.active .step-label { font-weight: 600; }
.step.done { color: var(--ink-soft); }
.step.done .step-num { border-color: var(--ink); color: var(--ink); }

/* ------------------------------------------------------------------ layout */
.layout {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  padding-block: 2.4rem 4rem;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 2.4rem;
  align-items: start;
}
.main-column { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 2.4rem; }

/* ------------------------------------------------------------------ intro */
.eyebrow {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
}
.intro h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin: .15rem 0 .7rem;
}
.intro-sub { color: var(--muted); font-size: .95rem; max-width: 48ch; margin: 0; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--paper); border: 1px solid var(--line); padding: 1.5rem; }
.card h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ botões */
.controls { display: flex; gap: .6rem; }
.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: .6rem 1.1rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover:not(:disabled) { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn.hangup {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-color: var(--err);
  color: var(--err);
}
.btn.hangup:hover:not(:disabled) { background: var(--err); border-color: var(--err); color: #fff; }

/* ------------------------------------------------------------------ status */
.status-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 1rem 0 .4rem;
  font-size: .83rem;
  color: var(--muted);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c9c9; }
.dot.connecting { background: var(--warn); animation: pulse 1s infinite; }
.dot.listening { background: var(--ok); }
.dot.speaking { background: var(--ink); animation: pulse .8s infinite; }
.dot.error { background: var(--err); }
.dot.offline { background: #bdbdbd; }
@keyframes pulse { 50% { opacity: .3; } }

.model-name {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .7rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .15rem .5rem;
}

/* ------------------------------------------------------------------ microfone */
.mic-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .6rem 0 1.2rem;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mic-bar { flex: 1; height: 4px; background: #ececec; overflow: hidden; }
.mic-fill { height: 100%; width: 0%; background: var(--ink); transition: width .08s linear; }

/* ------------------------------------------------------------------ chat */
.chat {
  height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding-right: .3rem;
}
/* Botão central de ligar — coração da tela quando ocioso. */
.call-cta {
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
.btn-call {
  width: 96px;
  height: 96px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease, background-color .15s ease;
}
.btn-call::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  animation: chamada 2.2s ease-out infinite;
}
.btn-call:hover:not(:disabled) { background: var(--ink-soft); transform: scale(1.04); }
.btn-call:disabled { opacity: .5; cursor: not-allowed; }
@keyframes chamada {
  0% { transform: scale(.92); opacity: .55; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}
.call-title { margin: .8rem 0 0; font-size: 1.05rem; font-weight: 600; }
.call-sub { margin: 0; color: var(--muted); font-size: .82rem; }

.bubble { padding: .65rem .9rem; max-width: 85%; font-size: .9rem; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--ink); color: var(--paper); }
.bubble.assistant { align-self: flex-start; background: var(--panel); }
.bubble-title {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .2rem;
  opacity: .65;
}
.bubble-body { white-space: pre-wrap; }

/* ------------------------------------------------------------------ link de reserva */
.booking {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  border-top: 1px solid var(--line);
  padding-top: 2.4rem;
  scroll-margin-top: 2rem;
}
.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: .15rem 0 0;
}
.booking-lead { color: var(--muted); font-size: .95rem; max-width: 62ch; margin: .55rem 0 0; }

.availability-status {
  margin: 0;
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: .85rem;
}
.availability-status.available { border-color: #cde7d8; background: #f5fbf7; color: var(--ok); }
.availability-status.unavailable { border-color: #edd2cf; background: #fdf7f6; color: var(--err); }

.booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
  gap: 2.4rem;
  align-items: flex-start;
}

/* -------- formulário -------- */
.guest-form { background: var(--panel); border: 1px solid var(--line); padding: 1.6rem; }
.form-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1.3rem; }

/* Estadia confirmada por voz — somente leitura. */
.stay-fieldset { border: 1px solid var(--line); background: var(--paper); margin: 0 0 1.5rem; padding: .7rem 1rem 1.1rem; }
.stay-fieldset legend {
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 .45rem;
}
.stay-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
.guest-form input[readonly] { background: var(--panel); color: var(--ink-soft); border-color: var(--line); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.2rem;
}
.guest-form label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .78rem;
  color: var(--muted);
}
.guest-form input,
.guest-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  padding: .68rem .8rem;
  font: inherit;
  font-size: .88rem;
}
.guest-form input::placeholder { color: #a9a9a9; }
.guest-form input:focus,
.guest-form select:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
  border-color: var(--ink);
}
.form-message { margin: 1rem 0 0; font-size: .82rem; }
.error-message { color: var(--err); }
.submit-button { width: 100%; margin-top: 1.3rem; padding: .85rem 1rem; font-size: .9rem; }

/* -------- resumo da estadia -------- */
.booking-summary { background: var(--paper); border: 1px solid var(--line); padding: 1.6rem; }
.guest-form[hidden] + .booking-summary { grid-column: 1 / -1; }
.summary-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .35rem; }
.summary-sub {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .85rem;
  margin: 0 0 1.3rem;
}
.summary-sub svg { width: 14px; height: 14px; flex: 0 0 auto; }
.summary-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.summary-rows li { display: flex; align-items: flex-start; gap: .8rem; }
.summary-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex: 0 0 auto;
}
.summary-icon svg { width: 16px; height: 16px; }
.summary-row-label {
  display: block;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .15rem;
}
.summary-row-value { font-size: .88rem; font-weight: 600; }
.summary-divider { border-top: 1px solid var(--line); margin: 1.4rem 0 1rem; }
.summary-price {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
  color: var(--muted);
  padding: .25rem 0;
}
.summary-price strong { color: var(--ink); font-size: .98rem; }
.summary-price.total { color: var(--ink); font-weight: 600; }

/* -------- link gerado (substitui o chat, centralizado) -------- */
.link-view {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 4rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.1rem;
  min-height: 420px;
  scroll-margin-top: 2rem;
}
.link-view h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
}
.link-view .link-out {
  color: var(--ink);
  font-weight: 600;
  word-break: break-all;
  max-width: 58ch;
}
.link-view .link-detalhes { margin: 0; color: var(--muted); font-size: .9rem; }
.link-view .btn { margin-top: .6rem; }

/* ------------------------------------------------------------------ painéis */
.muted { color: var(--muted); font-size: .85rem; }
.tools, .reservas {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
  max-height: 280px;
  overflow-y: auto;
}
.tool-entry {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  background: var(--panel);
  padding: .6rem .75rem;
  font-size: .8rem;
}
.tool-title { font-weight: 600; margin-bottom: .25rem; }
.tool-detail { color: var(--muted); white-space: pre-wrap; word-break: break-word; }

.reserva { border: 1px solid var(--line); background: var(--paper); padding: .7rem .8rem; font-size: .85rem; }
.reserva-title { font-weight: 600; }
.reserva-detail { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

code {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .05rem .3rem;
  font-size: .85em;
}

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .booking-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { padding-inline: 1.25rem; }
  .topbar-inner { padding: 1.1rem 1.25rem; }
  .stay-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stay-cell:nth-child(2n) { border-right: 0; }
  .stay-cell:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .stay-fields { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { margin: 0 .7rem; }
}
