:root {
  --ink: #15121C;
  --paper: #F6F3EE;
  --card: #FFFFFF;
  --line: #DCD6CC;
  --divider: #EFEAE2;
  --muted: #5E5868;
  --lime: #D9FF45;
  --coral: #FF6B4A;
  --lilac: #B9A8FF;
  /* Roxo fixo da marca (o --poster-bg muda com o tema de cada convite). */
  --purple: #2A1F5C;
  --warning: #8E2A16;
  --poster-bg: #2A1F5C;
  --poster-ink: #D9FF45;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px 20px;
}

.brand { display: inline-flex; text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }

.content {
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#dynamic { display: flex; flex-direction: column; gap: 20px; }

/* Pôster */
.poster {
  position: relative;
  min-height: 300px;
  border-radius: 24px;
  background: var(--poster-bg);
  color: var(--poster-ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.poster-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 1.6px; }
.poster-title {
  margin: 24px 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 13vw, 56px);
  line-height: 0.92;
  letter-spacing: -1.5px;
  overflow-wrap: anywhere;
}
.poster-title.dark { color: var(--ink); }
.poster-host { margin: 0; font-size: 14px; opacity: 0.9; }

/* Mural: recados de quem organiza */
.blast {
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.blast small { display: block; font-weight: 700; font-size: 12px; letter-spacing: 1px; }
.blast-item { overflow-wrap: anywhere; }
.blast-item + .blast-item { border-top: 1px solid rgba(0, 0, 0, 0.15); padding-top: 10px; }
.blast-item p { margin: 0; font-size: 15px; }
.blast-time { font-size: 12px; opacity: 0.7; }
.blast .blast-more { align-self: flex-start; color: var(--ink); padding: 0; }

/* Infos */
.info { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; gap: 12px; align-items: center; }
.info-icon {
  width: 40px; height: 40px; border-radius: 12px; background: #EAE5DC;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-title { font-weight: 700; font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }

h2 { font-family: var(--display); font-weight: 600; font-size: 20px; margin: 0; }

/* RSVP */
.rsvp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.pill {
  min-height: 52px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--card); font-weight: 700; font-size: 15px;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--lime); border-color: var(--ink); }

/* Lista de quem vai */
.people { display: flex; align-items: center; gap: 12px; }
.avatars { display: flex; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.avatars .avatar + .avatar { margin-left: -10px; }
.avatar.more { background: var(--ink); color: var(--paper); font-size: 12px; }

/* Cards */
.card { background: var(--card); border-radius: 20px; padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; }
.card-head h2 { font-size: 18px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; border-top: 1px solid var(--divider);
}
.row-name { font-size: 15px; font-weight: 500; }
.btn-small {
  min-height: 36px; padding: 0 14px; border-radius: 18px; border: none;
  background: var(--lime); font-weight: 700; font-size: 14px;
}
.btn-link { background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 8px; }

.input {
  width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); padding: 0 14px; font-size: 16px;
}

.btn-primary {
  width: 100%; min-height: 56px; border-radius: 28px; border: none;
  background: var(--ink); color: var(--lime); font-weight: 700; font-size: 17px;
}
.btn-primary:disabled { opacity: 0.6; }

/* Folha de confirmação */
dialog.sheet {
  border: none; padding: 0; margin: auto auto 0; width: 100%; max-width: 480px;
  background: var(--paper); border-radius: 28px 28px 0 0; color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(21, 18, 28, 0.45); }
/* Aberta sem modal enquanto o reCAPTCHA do SMS roda: fica presa embaixo, como a modal. */
dialog.sheet:not(:modal) { position: fixed; inset: auto 0 0; margin: 0 auto; z-index: 10; box-shadow: 0 -8px 32px rgba(21, 18, 28, 0.25); }
.sheet-body { padding: 12px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.handle { width: 44px; height: 5px; border-radius: 3px; background: #CFC8BC; align-self: center; }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0; letter-spacing: -0.5px; }
.field label, .field-label {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 6px; text-transform: uppercase;
}
.phone { display: flex; gap: 8px; }
.phone .prefix {
  min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); display: flex; align-items: center; font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--card); font-weight: 700; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--lime); border-color: var(--ink); }
.stepper { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 0 6px 0 14px; }
.stepper button { width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); font-size: 20px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
.hint.center { text-align: center; margin: 0; }

/* Entrar com Google na resposta: a vantagem em destaque, o "só com o nome" logo abaixo */
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 24px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; font-size: 15px;
}
.btn-google:disabled { opacity: 0.6; }
.google-box .btn-google { width: 100%; }
.signed-in { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.signed-in svg { flex: none; margin-top: 1px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.3; }
.error { color: var(--warning); font-size: 14px; margin: 0; }

.not-found { max-width: 480px; margin: 0 auto; padding-top: 40px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Agenda (Fase 1.3) */
.calendar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -8px; }
.btn-secondary {
  min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1.5px solid var(--ink);
  background: var(--card); font-weight: 700; font-size: 15px;
}

/* Páginas legais e rodapé (Fase 1.5) */
.legal { gap: 12px; }
.legal h2 { margin-top: 16px; }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.legal p { margin: 0; line-height: 1.55; }
.site-footer {
  max-width: 480px; margin: 0 auto; padding: 8px 16px 32px;
  display: flex; gap: 16px; font-size: 13px; color: var(--muted);
}
.site-footer a { color: var(--muted); }

/* Chamada para criar o próprio convite (Fase 2.2) */
.cta-card { background: var(--purple); color: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.cta-card h2 { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; color: var(--lime); }
.cta-card .muted { color: var(--paper); opacity: 0.9; }
.cta-card .btn-google { align-self: flex-start; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-host { background: var(--lime); color: var(--ink); }
.cta-host h2 { color: var(--ink); font-size: 20px; }
.cta-host .muted { color: var(--ink); }
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 24px; background: var(--lime); color: var(--ink); font-weight: 700; text-decoration: none; align-self: flex-start;
}
.cta-host .btn-cta { background: var(--ink); color: var(--lime); }

/* Enquete de data (Fase 3.2) */
.poll { display: flex; flex-direction: column; gap: 12px; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  min-height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px;
  font-weight: 700; font-size: 15px; text-align: left; text-transform: capitalize;
}
.poll-option[aria-pressed="true"] { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.poll-count { font-size: 13px; font-weight: 500; text-transform: none; opacity: 0.85; white-space: nowrap; }

/* Álbum de fotos (Fase 3.1) */
.album { display: flex; flex-direction: column; gap: 12px; }
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: 16px; overflow: hidden; }
.album-thumb { aspect-ratio: 1; padding: 0; border: none; background: var(--line); display: block; }
.album-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-upload { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; align-self: flex-start; }
dialog.viewer { border: none; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
dialog.viewer::backdrop { background: rgba(21, 18, 28, 0.92); }
dialog.viewer figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
dialog.viewer img { max-width: 96vw; max-height: 82vh; object-fit: contain; border-radius: 12px; display: block; margin: 0 auto; }
dialog.viewer figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--paper); font-size: 15px; padding: 0 8px; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-actions a, .viewer-actions button {
  min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--paper); background: transparent;
  color: var(--paper); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none;
}

/* Como chegar: Waze, Uber e mapas abrem direto no endereço */
.directions { display: flex; gap: 8px; flex-wrap: wrap; padding-left: 52px; }
.btn-directions { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); min-height: 40px; font-size: 14px; padding: 0 16px; }

/* Manutenção (painel → Manutenção) */
.maintenance { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 32px 20px; }
.maintenance h2 { margin: 0; }
.maintenance p { margin: 0; max-width: 32ch; }
