:root {
  --green: #0d7d6b;
  --green-dark: #0a6355;
  --green-soft: #e6f2ef;
  --ink: #172723;
  --muted: #6b7c78;
  --line: #e2e8e5;
  --bg: #f6f9f8;
  --white: #ffffff;
  --warn-bg: #fff4e0;
  --warn-ink: #8a5a00;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(13, 125, 107, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* Topbar --------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
  color: var(--green);
}
.lang {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-item {
  border: none;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.lang-item:active, .lang-item.active { background: var(--green-soft); color: var(--green); }

/* Progress ------------------------------------------------------------- */
.progress { padding: 14px 20px 0; }
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Screen --------------------------------------------------------------- */
.screen {
  flex: 1;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 21px; margin: 0; letter-spacing: -0.01em; }
p.sub { color: var(--muted); margin: 0; }

/* Forms ---------------------------------------------------------------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select {
  font: inherit;
  color: var(--ink);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  width: 100%;
  appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7c78' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }

/* Buttons -------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 600;
  padding: 15px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow); }
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; }
.btn-ghost { background: var(--white); color: var(--green); border: 1px solid var(--line); }

.spacer { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* Stepper -------------------------------------------------------------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 20px; }
.step-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  font-size: 28px; color: var(--green); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.step-btn:disabled { opacity: 0.3; }
.step-value { font-size: 48px; font-weight: 700; min-width: 72px; text-align: center; }

/* Choice cards --------------------------------------------------------- */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
}
.choice:active, .choice.selected { border-color: var(--green); background: var(--green-soft); }
.choice .chev { color: var(--muted); }

/* Photo capture -------------------------------------------------------- */
.photo-slot {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.photo-slot.filled { border-style: solid; border-color: var(--green); padding: 8px; }
.photo-slot img { max-width: 100%; border-radius: 8px; display: block; }
.photo-slot .cam { color: var(--green); display: flex; }
.photo-hint { font-size: 13px; color: var(--muted); }

/* Banners -------------------------------------------------------------- */
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.warn > div + div { margin-top: 4px; }
.banner.info { background: var(--green-soft); color: var(--green-dark); }

/* Campo determinado pelo documento (não editável) --------------------- */
select:disabled, input:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}
.hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.banner.err { background: #fdecec; color: #a12626; }

/* Campo essencial por preencher (extração parcial / validação) ---------- */
label.field.missing > input,
label.field.missing > select {
  border-color: #d64545;
  background: #fdf3f3;
}
label.field.missing > input:focus,
label.field.missing > select:focus {
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}

/* Loading -------------------------------------------------------------- */
.loader { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 40px; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--green-soft); border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.big-emoji { font-size: 56px; text-align: center; }
.center { text-align: center; }
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Guest app — resumo da reserva + onde fazer o check-in ---------------- */
.stay-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
}
.stay-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--green);
  margin-bottom: 8px;
}
.stay-house { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.stay-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 14px;
}
.stay-dates > div {
  background: var(--green-soft); border-radius: 12px; padding: 10px 12px;
}
.stay-lbl {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  margin-bottom: 2px;
}
.stay-dates b { font-size: 15px; color: var(--ink); }
.stay-office { color: var(--ink); line-height: 1.5; margin-bottom: 12px; }
.map-wrap {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  margin-bottom: 12px; line-height: 0;
}
.map-wrap iframe { width: 100%; height: 200px; border: 0; display: block; }
.stay-card a.btn { display: block; text-align: center; text-decoration: none; }

/* Guest app — home (cartão de estadia estilo cartão de embarque) --------- */
.home-hi {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.01em; margin: 4px 0 2px;
}
.home-hi .sun { font-size: 22px; }
.banner.ok { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }

.pass {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-top: 14px;
}
.pass-top {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff; padding: 18px;
}
.pass-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.72);
}
.pass-house { font-size: 20px; font-weight: 800; line-height: 1.25; margin-top: 6px; }
.pass-perf {
  position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 14px;
}
.pass-perf::before, .pass-perf::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 50%;
}
.pass-perf::before { left: -25px; }
.pass-perf::after { right: -25px; }
.pass-dates {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 16px 22px 18px;
}
.pass-dates .right { text-align: right; }
.pass-lbl {
  display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 3px;
}
.pass-dates b { font-size: 16px; color: var(--ink); }
.pass-arrow { color: var(--green); font-size: 18px; font-weight: 800; }

.cta-card {
  background: var(--green-soft); border: 1px solid #cfe6e0;
  border-radius: var(--radius); padding: 18px; margin-top: 14px; text-align: center;
}
.cta-text { color: var(--green-dark); font-weight: 600; line-height: 1.45; margin: 0 0 14px; }

.done-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-top: 14px;
}
.done-ic { font-size: 30px; line-height: 1; }
.done-card .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Guest app — hero da casa (foto ou fundo) ------------------------------ */
.hero {
  position: relative; height: 240px; margin-top: 6px;
  border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow);
}
.hero-ph {
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(150deg, var(--green) 0%, var(--green-dark) 60%, #063f36 100%);
}
.hero-scrim {
  position: absolute; inset: 0; padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(6,32,28,.80) 0%, rgba(6,32,28,.20) 44%, transparent 68%);
}
.hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.82);
}
.hero-house {
  color: #fff; font-size: 22px; font-weight: 800; line-height: 1.2;
  margin-top: 4px; text-shadow: 0 1px 14px rgba(0,0,0,.4);
}
.dates-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dates-card .right { text-align: right; }

/* Botão voltar (aparece durante o formulário) --------------------------- */
.topbar-left { display: flex; align-items: center; gap: 8px; }
.back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--green); font-size: 24px; line-height: 1;
  padding: 2px 4px 2px 0; margin: 0;
}
.back-btn:active { color: var(--green-dark); }

/* Loader de arranque — bola grande no meio do ecrã ---------------------- */
.boot-loader {
  min-height: 65vh; display: flex; align-items: center; justify-content: center;
}
.spinner.big {
  width: 68px; height: 68px; border-width: 6px;
}

/* Guest app — home (redesenho profissional, sem emojis nem botões atoa) -- */
.hero-loc {
  align-self: flex-start; margin-top: 10px;
  color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45); padding-bottom: 1px;
}
.stay-meta {
  display: flex; margin-top: 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); overflow: hidden;
}
.stay-meta .meta { flex: 1; padding: 16px 18px; }
.meta-lbl {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.meta-val { font-size: 16px; font-weight: 700; color: var(--ink); }
.meta-sep { width: 1px; background: var(--line); }

/* Painel destacado do CTA (ação principal) */
.cta-panel {
  margin-top: 22px; padding: 20px 18px; text-align: center;
  background: var(--green-soft); border: 1px solid #cfe6e0; border-radius: var(--radius);
}
.cta-panel .cta-note {
  margin: 0 0 14px; font-size: 14px; line-height: 1.5;
  font-weight: 600; color: var(--green-dark);
}

/* Cartão de localização do check-in (mapa limpo + morada) */
.place-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.osm-map { height: 190px; width: 100%; background: var(--green-soft); }
.osm-map .leaflet-container { font: inherit; }
.place-body { padding: 16px 18px; }
.place-tel {
  display: block; margin-top: 8px; color: var(--ink);
  font-weight: 600; text-decoration: none;
}
.place-card .link { display: block; }

.done {
  display: flex; align-items: flex-start; gap: 14px; margin-top: 22px;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white);
}
.done-mark {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); position: relative; margin-top: 1px;
}
.done-mark::after {
  content: ""; position: absolute; left: 9px; top: 5px;
  width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.done-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.done-sub { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.place { margin-top: 30px; }
.place-title {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.place-addr { margin: 0 0 14px; line-height: 1.55; color: var(--ink); }
.place-name { font-weight: 700; }
.link {
  display: inline-block; margin-top: 12px;
  color: var(--green-dark); font-size: 14px; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--green-soft); padding-bottom: 1px;
}

/* Ecrã de idioma */
.lang-title { text-align: center; margin-top: 26px; }

/* Ecrã "link necessário" (URL sem link / link inválido) */
.nolink { margin-top: 44px; text-align: center; }
