:root {
  --paper: #f3f7f7;
  --paper-2: #ffffff;
  --ink: #1c3333;
  --muted: #3d5555;
  --faint: #5d7373;
  --line: #d3e3e3;
  --pine: #0a6060;
  --pine-mid: #0b9292;
  --foam: #e5f4f4;
  --foam-ink: #0a6060;
  --amber-bg: #fff1dc;
  --amber-ink: #8a4b10;
  --slate-bg: #e7eef3;
  --slate-ink: #1d4a66;
  --danger: #8c2f2a;
  --danger-bg: #fdecea;
  --shadow: 0 16px 40px rgba(48, 36, 18, 0.06);
  --serif: "Poppins", "Avenir Next", "Segoe UI", sans-serif;
  --sans: "Poppins", "Avenir Next", "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

body.sheet-open { overflow: hidden; }

.frame { min-height: 100dvh; }

.frame-note { display: none; }

.status-bar { display: none; }

.stage {
  min-height: 100dvh;
  background: var(--paper);
}

#app {
  min-height: 100dvh;
  position: relative;
}

.screen {
  min-height: 100dvh;
  padding: 0 20px calc(28px + var(--safe-b));
  display: flex;
  flex-direction: column;
}

.marca-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px 22px;
  padding: calc(12px + var(--safe-t)) 16px 12px 18px;
  background: var(--pine);
  position: sticky;
  top: 0;
  z-index: 4;
}

.logo-hsvp {
  height: 74px;
  width: auto;
  max-width: 70%;
  display: block;
}

.marca-local {
  margin: 0;
  text-align: right;
  color: #d7f3f3;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}

.marca-local strong {
  display: block;
  margin-bottom: 2px;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.marca-bar .texto { color: #f4fbfb; }

.fone {
  color: var(--pine);
  font-weight: 600;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--pine);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-mark svg { display: block; }

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.logo {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.hero-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(34px, 9vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-title em {
  font-style: italic;
  font-weight: 560;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16.5px;
  max-width: 34ch;
}

.card {
  background: var(--paper-2);
  border: 1px solid rgba(20, 56, 44, 0.08);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.card.has-error { border-color: #e7c4c0; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field + .field { margin-top: 14px; }

.field span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  outline: none;
  appearance: none;
}

input:focus {
  border-color: var(--pine-mid);
  box-shadow: 0 0 0 4px rgba(15, 106, 76, 0.14);
}

.senha-wrap { position: relative; }

.senha-wrap input {
  padding-right: 54px;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
}

.senha-wrap input::placeholder {
  letter-spacing: 0;
  font-weight: 400;
  text-transform: none;
}

input::placeholder { color: #7d9494; }

.olho {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.olho:focus-visible,
.texto:focus-visible,
.primario:focus-visible,
.secundario:focus-visible,
.perigo:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--pine-mid);
  outline-offset: 2px;
}

.alerta {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14.5px;
}

.primario,
.secundario,
.perigo,
.texto,
.chip {
  border: 0;
  touch-action: manipulation;
}

.primario {
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  border-radius: 16px;
  background: var(--pine);
  color: #f6fbf8;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primario:active { transform: scale(0.985); }

.primario:disabled {
  opacity: 0.72;
  transform: none;
}

.exemplos {
  margin-top: 22px;
}

.exemplos h2,
.bloco h2,
.agora-kicker,
.percurso-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.chip {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 60px;
}

.chip + .chip { margin-top: 8px; }

.chip strong { font-weight: 600; }

.chip span,
.fino,
.passo p,
.aviso,
.local-sub {
  color: var(--muted);
}

.chip span { font-size: 14px; }

.rodape-login {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.texto {
  background: none;
  padding: 8px 0;
  min-height: 44px;
  color: var(--pine-mid);
  font-weight: 600;
}

.fino { margin: 0; font-size: 13.5px; max-width: 36ch; }

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px -20px 18px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 20px 12px;
  background: var(--paper);
}

.topo .texto { padding-left: 0; }

.unidade {
  margin: 0;
  text-align: right;
  font-size: 13px;
  color: var(--faint);
  font-weight: 600;
}

.nome {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 11vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 560;
}

.sobrenome {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 7vw, 34px);
  font-weight: 560;
  letter-spacing: -0.03em;
  color: #3d5555;
}

.meta-idade {
  margin: 10px 0 14px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
}

.badge i {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: currentColor;
  display: block;
}

.badge.pinho { background: var(--foam); color: var(--foam-ink); }
.badge.ambar { background: var(--amber-bg); color: var(--amber-ink); }
.badge.slate { background: var(--slate-bg); color: var(--slate-ink); }

.badge.pinho i { animation: pulso 1.8s ease-out infinite; }

.fatos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}

.fato {
  background: var(--paper-2);
  border: 1px solid rgba(20, 56, 44, 0.08);
  border-radius: 16px;
  padding: 12px;
  min-height: 74px;
}

.fato small,
.agora-kicker,
.percurso-kicker { display: block; }

.fato small {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.fato strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
}

.local-largo { grid-column: 1 / -1; min-height: 0; }

.agora {
  margin-top: 8px;
  padding: 18px 16px 16px;
  border-radius: 22px;
  background: var(--pine);
  color: #f4faf6;
  box-shadow: 0 18px 36px rgba(20, 56, 44, 0.16);
}

.agora .agora-kicker { color: #b7dede; }

.agora p {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 560;
}

.agora .quando {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 13.5px;
  letter-spacing: 0;
  color: #d7eeee;
  font-weight: 500;
}

.percurso { margin-top: 22px; }

.passos {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.passos::before {
  content: "";
  position: absolute;
  left: 67px;
  top: 8px;
  bottom: 18px;
  width: 2px;
  background: #c5dbdb;
}

.passo {
  display: grid;
  grid-template-columns: 52px 20px 1fr;
  column-gap: 8px;
  padding-bottom: 16px;
  position: relative;
}

.passo time {
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  padding-top: 1px;
}

.no {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 99px;
  border: 2px solid var(--pine-mid);
  background: var(--paper);
  position: relative;
  z-index: 1;
  justify-self: center;
}

.passo.is-now .no {
  background: var(--pine-mid);
  box-shadow: 0 0 0 5px rgba(15, 106, 76, 0.16);
}

.passo strong { display: block; font-size: 16px; }

.passo p { margin: 2px 0 0; font-size: 14.5px; }

.passo.is-now .corpo {
  background: var(--foam);
  border-radius: 14px;
  padding: 8px 10px 10px;
  margin-top: -6px;
}

.atualizado {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 14px;
  color: var(--pine-mid);
  font-weight: 600;
}

.nota-fim {
  margin-top: 8px;
  color: var(--faint);
  font-size: 13.5px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.sec-head span { color: var(--faint); font-size: 13px; font-weight: 600; }

.pessoa {
  background: var(--paper-2);
  border: 1px solid rgba(20, 56, 44, 0.08);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.pessoa + .pessoa,
.fila-item + .fila-item { margin-top: 10px; }

.pessoa-topo {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pessoa h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.pessoa .sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.acoes {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.secundario,
.perigo {
  flex: 1;
  min-height: 46px;
  border-radius: 13px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
}

.perigo { color: var(--danger); background: #fff; }

.confirma {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.confirma p { margin: 0 0 10px; font-size: 14.5px; }

.fila-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px dashed #cfc4b4;
  border-radius: 18px;
  padding: 14px;
  min-height: 72px;
}

.fila-item strong { display: block; font-size: 17px; }

.fila-item span { color: var(--muted); font-size: 14px; }

.bloco { margin-top: 22px; }

.vazio {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.toast {
  margin-top: 14px;
  background: var(--foam);
  color: var(--foam-ink);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14.5px;
}

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(18, 28, 24, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: min(100%, 480px);
  max-height: 92%;
  overflow: auto;
  background: #fffdf8;
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(18px + var(--safe-b));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.12);
  animation: sobe 220ms ease-out;
}

.alca {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: #d3e2e2;
  margin: 4px auto 14px;
}

.sheet h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 560;
}

.sheet .quem {
  margin: 0 0 14px;
  color: var(--muted);
}

.senha-grande {
  margin: 0;
  background: var(--pine);
  color: #f4faf6;
  border-radius: 18px;
  text-align: center;
  font-size: 32px;
  letter-spacing: 0.16em;
  font-weight: 600;
  padding: 16px 8px 16px 14px;
}

.cpf-linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 4px 0;
  font-size: 15px;
}

.cpf-linha span { color: var(--faint); }

.recado {
  margin-top: 14px;
  background: #eef6f6;
  border-radius: 16px;
  padding: 12px 14px;
}

.recado small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recado p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.4;
}

.sheet .primario { margin-top: 14px; }

.sheet-acoes {
  display: flex;
  gap: 8px;
}

.sheet-acoes .primario,
.sheet-acoes .secundario { margin-top: 14px; }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 99px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  animation: gira 0.7s linear infinite;
}

@keyframes gira { to { transform: rotate(360deg); } }

@keyframes sobe {
  from { transform: translateY(16px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(13, 84, 60, 0.35); }
  100% { box-shadow: 0 0 0 8px rgba(13, 84, 60, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .badge.pinho i,
  .spinner,
  .sheet { animation: none; }
  .primario:active { transform: none; }
}

@media (min-width: 840px) {
  body {
    min-height: 100dvh;
    background:
      radial-gradient(900px 480px at 78% -10%, #d5eeee 0%, transparent 58%),
      radial-gradient(680px 420px at 0% 110%, #e7f3f3 0%, transparent 50%),
      #d5e6e6;
  }

  .frame {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
  }

  .frame-note {
    display: block;
    margin: 0;
    color: #0a6060;
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  .stage {
    position: relative;
    width: 390px;
    height: min(820px, calc(100dvh - 72px));
    min-height: 0;
    border-radius: 40px;
    border: 10px solid #0a6060;
    overflow: hidden;
    box-shadow:
      0 30px 70px rgba(16, 36, 28, 0.28),
      inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  .status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    padding: 0 22px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    background: var(--paper);
  }

  .status-dots {
    width: 16px;
    height: 10px;
    border-radius: 3px;
    border: 1.5px solid var(--ink);
    position: relative;
  }

  .status-dots::after {
    content: "";
    position: absolute;
    right: -3px;
    top: 2px;
    width: 2px;
    height: 4px;
    border-radius: 1px;
    background: var(--ink);
  }

  #app {
    height: calc(100% - 34px);
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .screen { min-height: 100%; }

  .topo { top: 0; }

  .sheet-back { position: absolute; }

  .sheet { width: 100%; }
}
