/* ══════════════════════════════════════════════════════
   Convite Studio — editor + pré-visualização
   ══════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Cores da interface do editor (fixas) */
  --ui-bg:      #f4f2ee;
  --ui-panel:   #ffffff;
  --ui-border:  #e5e1d8;
  --ui-text:    #2c2a26;
  --ui-soft:    #8a857a;
  --ui-accent:  #55684a;
  --ui-accent2: #36422f;
  --ui-radius:  14px;

  /* Cores do CONVITE (mudam com a personalização) */
  --prim:   #55684a;
  --fundo:  #f5efe4;
  --accent: #c8924a;
  --fonte-nomes: 'Great Vibes';

  --prim-dark:   color-mix(in srgb, var(--prim) 72%, black);
  --prim-soft:   color-mix(in srgb, var(--prim) 55%, var(--fundo));
  --fundo-deep:  color-mix(in srgb, var(--fundo) 88%, var(--prim));
}

html, body {
  min-height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ui-bg);
  color: var(--ui-text);
}


button { font-family: inherit; }

/* ── Barra de topo ────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ui-border);
}

/* Logótipo desenhado + a linha que diz o que isto é. Em coluna,
   porque o logótipo é largo e deitado. */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand small { display: block; color: var(--ui-soft); font-size: 0.74rem; }

.topbar-actions { display: flex; gap: 8px; }

/* ── Botões ───────────────────────────────────────────── */
.btn {
  border: none;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(54, 66, 47, 0.28);
}
.btn.ghost {
  background: transparent;
  color: var(--ui-soft);
  border: 1px solid var(--ui-border);
}
.btn.ghost:hover { color: var(--ui-text); background: #fff; }
.btn.small { padding: 8px 14px; font-size: 0.8rem; width: 100%; }

/* ── Layout principal ─────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
  align-items: start;
}

/* ── Painel editor ────────────────────────────────────── */
.panel {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(44, 42, 38, 0.06);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--ui-border);
  background: #faf9f6;
}
.tab {
  padding: 13px 6px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ui-soft);
  cursor: pointer;
  transition: color 0.15s;
}
.tab:hover { color: var(--ui-text); }
.tab.active { color: var(--ui-accent2); border-bottom-color: var(--ui-accent); background: #fff; }

.tab-page { display: none; padding: 16px; }
.tab-page.active { display: block; }

.tab-intro {
  font-size: 0.84rem;
  color: var(--ui-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ── Grupos (accordion) ───────────────────────────────── */
.group {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}
.group summary {
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '▾'; color: var(--ui-soft); font-size: 0.8rem; transition: transform 0.2s; }
.group[open] summary::after { transform: rotate(180deg); }
.group[open] summary { border-bottom: 1px dashed var(--ui-border); }

.group-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 11px; }

/* ── Campos ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ui-soft);
}
.field input, .field textarea, .guest-form input {
  padding: 10px 12px;
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ui-text);
  background: #fdfcfa;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .guest-form input:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.12);
}
.field textarea { resize: vertical; line-height: 1.45; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }

.hint-text { font-size: 0.75rem; color: var(--ui-soft); line-height: 1.45; }

/* ── Temas prontos ────────────────────────────────────── */
.tema-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tema-opt {
  padding: 11px 8px;
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  background: #fdfcfa;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ui-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tema-opt:hover { border-color: var(--ui-accent); }
.tema-opt.active {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 8%, white);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.12);
}

/* ── Switch Save the Date ─────────────────────────────── */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8rem;
  color: var(--ui-soft);
  line-height: 1.45;
  padding: 10px 11px;
  border: 1px dashed var(--ui-border);
  border-radius: 10px;
  cursor: pointer;
}
.switch-row input { accent-color: var(--ui-accent); width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.switch-row strong { color: var(--ui-text); }

/* ── Escolha de fontes ────────────────────────────────── */
.font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.font-opt {
  padding: 12px 8px 10px;
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  background: #fdfcfa;
  font-size: 1.25rem;
  color: var(--ui-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.font-opt:hover { border-color: var(--ui-accent); }
.font-opt.active {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 8%, white);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.12);
}

/* ── Paletas de cores ─────────────────────────────────── */
.palette-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pal {
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  background: #fdfcfa;
  padding: 9px 6px 7px;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s;
}
.pal i {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
}
.pal em {
  flex-basis: 100%;
  text-align: center;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ui-soft);
  margin-top: 2px;
}
.pal:hover { border-color: var(--ui-accent); }
.pal.active { border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.12); }

.custom-colors { margin-top: 2px; }
.color-field input[type="color"] {
  padding: 2px;
  height: 38px;
  cursor: pointer;
}

/* ── Selos ────────────────────────────────────────────── */
.seal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.seal-opt {
  aspect-ratio: 1;
  border: 1.5px solid var(--ui-border);
  border-radius: 50%;
  background: #fdfcfa;
  font-size: 1.15rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.seal-opt:hover { transform: scale(1.08); border-color: var(--ui-accent); }
.seal-opt.active { border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.14); }
.seal-opt[data-selo="mono"] { font-size: 0.72rem; font-weight: 700; font-family: 'Playfair Display', serif; }

/* ── Convidados ───────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: #faf9f6;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.stat strong { display: block; font-size: 1.35rem; color: var(--ui-accent2); }
.stat span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ui-soft); }
.stat.ok strong { color: #3e7d47; }

.guest-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.guest-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.guest-list:empty::after {
  content: 'Ainda sem convidados — adiciona o primeiro! 🎉';
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ui-soft);
  padding: 18px 8px;
  border: 1.5px dashed var(--ui-border);
  border-radius: 10px;
}
.guest {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #fdfcfa;
}
.guest .g-info { flex: 1; min-width: 0; }
.guest .g-nome { font-size: 0.87rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest .g-meta { font-size: 0.72rem; color: var(--ui-soft); }
.guest select {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 0.74rem;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}
.guest select.st-confirmado { background: #e8f3e9; border-color: #b3d4b7; color: #2c5e33; }
.guest select.st-recusou    { background: #faeaea; border-color: #e3bcbc; color: #8a3232; }
.guest .g-del {
  border: none;
  background: none;
  color: #b98484;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.guest .g-del:hover { background: #faeaea; }

/* ── Extras (checkboxes) ──────────────────────────────── */
.extras label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #fdfcfa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.extras label:hover { border-color: var(--ui-accent); }
.extras label:has(input:checked) {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 7%, white);
}
.extras input { accent-color: var(--ui-accent); width: 16px; height: 16px; }

/* ══════════════════════════════════════════════════════
   PRÉ-VISUALIZAÇÃO — o "telemóvel"
   ══════════════════════════════════════════════════════ */
.preview-area {
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.pv-switch {
  display: flex;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
/* Um só estilo para os dois pares de botões (modo e dispositivo).
   Ícones em SVG traçado — os emoji ficavam desalinhados e cada
   sistema desenhava o seu. */
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  padding: 8px 15px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ui-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.pv-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pv-btn:hover { color: var(--ui-text); }
.pv-btn.active {
  background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent2));
  color: #fff;
}
.pv-btn.active svg { stroke-width: 1.9; }

.autosave { font-size: 0.74rem; color: var(--ui-soft); opacity: 0; transition: opacity 0.3s; }
.autosave.show { opacity: 1; }

.phone {
  width: min(390px, 92vw);
  border-radius: 42px;
  padding: 12px;
  background: #1c1c1e;
  box-shadow:
    0 30px 70px rgba(28, 28, 30, 0.35),
    inset 0 0 0 2px #3a3a3c;
  transition: width 0.35s ease, border-radius 0.35s ease;
}
.phone-screen {
  border-radius: 32px;
  overflow: hidden;
  height: min(700px, 72vh);
  overflow-y: auto;
  background: var(--fundo);
  position: relative;
  scrollbar-width: none;
}
.phone-screen::-webkit-scrollbar { display: none; }

/* Barra de browser — só aparece no modo computador */
.browser-bar {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 9px;
}
.browser-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.browser-bar .dot.r { background: #ff5f57; }
.browser-bar .dot.y { background: #febc2e; }
.browser-bar .dot.g { background: #28c840; }
.browser-bar .url {
  flex: 1;
  margin-left: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #cfcdc8;
  font-size: 0.74rem;
  padding: 5px 14px;
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Modo computador ─────────────────────────────────── */
.phone.desktop {
  width: min(820px, 100%);
  border-radius: 16px;
  padding: 0 8px 8px;
}
.phone.desktop .browser-bar { display: flex; }
.phone.desktop .phone-screen {
  border-radius: 8px 8px 12px 12px;
  height: min(560px, 62vh);
}

/* No PC o convite fica centrado com largura de cartão, como no site real */
.phone.desktop .pv-invite-scene {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 40px 28px 48px;
}
.phone.desktop .pv-invite-scene.active { display: flex; }
.phone.desktop .pv-invite-scene > * { width: 100%; max-width: 500px; }
.phone.desktop .pv-names { font-size: 4rem; }
.phone.desktop .pv-envelope {
  width: min(46%, 340px);
  margin-bottom: 10px;
}

/* ── Cenas ────────────────────────────────────────────── */
.pv-scene { display: none; min-height: 100%; }
.pv-scene.active { display: block; animation: sceneIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pv-envelope-scene.active { display: flex; }

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Elementos partilhados do convite ─────────────────── */
.pv-eyebrow {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--prim-soft);
}
.pv-names {
  font-family: var(--fonte-nomes), cursive;
  font-size: 3rem;
  font-weight: 400;
  color: var(--prim-dark);
  line-height: 1.15;
  margin: 8px 0 2px;
  overflow-wrap: break-word;
}
.pv-divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px auto; }
.pv-divider span {
  height: 1px; width: 46px;
  background: linear-gradient(to right, transparent, var(--accent));
}
.pv-divider span:last-of-type { background: linear-gradient(to left, transparent, var(--accent)); }
.pv-divider i { color: var(--accent); font-style: normal; font-size: 0.95rem; }

/* ── Cena: envelope ───────────────────────────────────── */
.pv-envelope-scene {
  position: relative;
  min-height: 100%;
  padding: 44px 20px 40px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--prim) 12%, transparent), transparent 50%),
    var(--fundo);
  text-align: center;
}

.pv-hint {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--prim-soft);
  margin-top: 10px;
}

.pv-envelope {
  position: relative;
  width: min(78%, 280px);
  aspect-ratio: 3 / 2;
  border: none;
  background: none;
  cursor: pointer;
  margin-bottom: 26px;
  animation: pvFloat 3.8s ease-in-out infinite;
  filter: drop-shadow(0 22px 34px color-mix(in srgb, var(--prim-dark) 30%, transparent));
}
@keyframes pvFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.pv-env-front {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--prim) 38%, #d9d9cd),
    color-mix(in srgb, var(--prim) 50%, #c9c9bb));
  overflow: hidden;
}
.pv-env-front::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 58%;
  background: rgba(0, 0, 0, 0.05);
  clip-path: polygon(0 100%, 50% 2%, 100% 100%);
}
.pv-flap {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 58%;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--prim) 46%, #d3d3c5),
    color-mix(in srgb, var(--prim) 55%, #c2c2b2));
  clip-path: polygon(0 0, 50% 84%, 100% 0);
  transform-origin: top;
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 5;
}
.pv-envelope.open .pv-flap { transform: rotateX(180deg); }

.pv-seal {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: radial-gradient(circle at 34% 28%,
    color-mix(in srgb, var(--accent) 60%, white),
    var(--accent) 55%,
    color-mix(in srgb, var(--accent) 70%, black));
  box-shadow:
    0 7px 22px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 8px rgba(0, 0, 0, 0.22);
  outline: 2.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 4px;
  transition: transform 0.25s ease;
}
.pv-envelope:hover .pv-seal { transform: translate(-50%, -50%) scale(1.07); }
.pv-seal .mono-txt {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* ── Cena: convite ────────────────────────────────────── */
.pv-invite-scene {
  padding: 30px 18px 34px;
  background:
    linear-gradient(color-mix(in srgb, var(--fundo) 94%, transparent), var(--fundo-deep)),
    var(--fundo);
  text-align: center;
}

.pv-card-header { margin-bottom: 16px; }

.pv-msg {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.55;
  color: color-mix(in srgb, var(--prim-dark) 80%, var(--fundo));
  max-width: 300px;
  margin: 10px auto 0;
}
.pv-data {
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--prim-dark);
  margin-top: 12px;
}

.pv-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--prim) 16%, var(--fundo)),
      color-mix(in srgb, var(--accent) 18%, var(--fundo)));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--prim-dark) 22%, transparent);
  background-size: cover;
  background-position: center;
}
.pv-photo-placeholder {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.6;
  color: color-mix(in srgb, var(--prim-dark) 55%, var(--fundo));
}
.pv-photo.has-img .pv-photo-placeholder { display: none; }

.pv-panel {
  margin-top: 14px;
  background: color-mix(in srgb, white 82%, var(--fundo));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 16px 15px 17px;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--prim-dark) 10%, transparent);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pv-panel-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--prim-soft);
}
.pv-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv-loc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  background: linear-gradient(135deg, var(--prim), var(--prim-dark));
  color: #fff;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--prim-dark) 30%, transparent);
}
.pv-loc-btn b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }

.pv-rsvp-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--prim-soft);
  margin-top: -4px;
}
.pv-fake-input {
  display: block;
  padding: 12px 14px;
  border: 1.5px solid color-mix(in srgb, var(--prim) 22%, var(--fundo));
  border-radius: 12px;
  background: color-mix(in srgb, white 70%, var(--fundo));
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  color: var(--prim-soft);
  text-align: left;
}
.pv-submit {
  display: block;
  padding: 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--prim), var(--prim-dark));
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--prim-dark) 28%, transparent);
}

.preview-note {
  font-size: 0.76rem;
  color: var(--ui-soft);
  text-align: center;
  max-width: 340px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   Modal de publicação
   ══════════════════════════════════════════════════════ */
.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(44, 42, 38, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-fundo[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow: 0 30px 80px rgba(28, 28, 30, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: modalIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 { font-size: 1.2rem; color: var(--ui-accent2); }
.modal-sub { font-size: 0.84rem; color: var(--ui-soft); line-height: 1.5; margin-top: -6px; }

.modal-fechar {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: #f0efe8;
  color: var(--ui-soft);
  font-size: 0.9rem;
  cursor: pointer;
}
.modal-fechar:hover { background: var(--ui-border); color: var(--ui-text); }

.pacotes { display: flex; flex-direction: column; gap: 9px; }
.pacote {
  position: relative;
  display: block;
  border: 1.5px solid var(--ui-border);
  border-radius: 14px;
  padding: 13px 15px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ui-text);
  transition: border-color 0.15s, background 0.15s;
}
.pacote:hover { border-color: var(--ui-accent); }
.pacote input { position: absolute; opacity: 0; pointer-events: none; }
.pacote:has(input:checked) {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 7%, white);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.12);
}
.p-cima { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.p-cima strong { font-size: 0.95rem; }
.p-preco { font-size: 1.05rem; font-weight: 700; color: var(--ui-accent2); font-style: normal; }
.pacote small { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--ui-soft); line-height: 1.45; }
.p-tag {
  position: absolute;
  top: -9px; right: 12px;
  background: linear-gradient(135deg, #ddb070, #a57338);
  color: #fff;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
}
.pacote.premium { border-style: dashed; }
.pacote.premium .p-preco { font-size: 0.85rem; color: var(--ui-soft); }

/* Aceitação dos termos. Fica registada no pedido, com data —
   é a prova de que o cliente aceitou a subcontratação do RGPD. */
.aceite {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ui-soft);
  cursor: pointer;
  margin-top: 4px;
}
.aceite input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--prim, #55684a);
  cursor: pointer;
}
.aceite a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.aceite a:hover { color: var(--ui-texto); }

.modal-erro {
  display: none;
  color: #8a3232;
  background: #faeaea;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.8rem;
  text-align: center;
}

/* ── Responsivo ───────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .preview-area { position: static; order: -1; }
  .phone-screen { height: 62vh; }
  .topbar { padding: 10px 14px; }
  .brand small { display: none; }
}

/* ── Alterações: marca clicável, Premium, selos e ícones ── */
a.brand { text-decoration: none; color: inherit; }
a.brand:hover .brand-logo { opacity: 0.75; }

.tab-badge {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #c8924a, #a86f2d);
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  vertical-align: middle;
}

.premium-banner {
  background: linear-gradient(135deg, #fdf7ec, #f6ecd8);
  border: 1px solid #e5d3ae;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #7a5c1e;
  margin-bottom: 14px;
}

.seal-opt.selo-upload { position: relative; }
.seal-opt .mini-badge {
  position: absolute;
  top: -6px; right: -6px;
  font-size: 0.7rem;
  font-style: normal;
}

#pvSealIcon .selo-img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.loc-icons { margin-top: 4px; }
.pv-loc-ic { font-style: normal; }

/* ── Tipo de evento (casamento / batizado / empresarial) ── */
.evento-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.evento-opt {
  padding: 10px 6px;
  border: 1.5px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ui-text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.evento-opt:hover { border-color: var(--ui-accent); }
.evento-opt.active {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.14);
  background: #f7f9f5;
}

/* ── Aba bloqueada (Detalhes = Premium) ─────────────────── */
.tab.bloqueada { color: var(--ui-soft); cursor: pointer; }
.tab.bloqueada:hover { color: #a86f2d; background: #fdf9f1; }

/* Logótipo no selo: cabe inteiro, sem recorte circular */
#pvSealIcon .selo-img.selo-logo {
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}

/* Extras dentro do modal Premium */
.modal .extras { display: flex; flex-direction: column; gap: 8px; }
.modal .extras label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.modal .extras input { accent-color: var(--ui-accent); width: 15px; height: 15px; flex-shrink: 0; }

/* Confirmação depois de enviar o pedido de orçamento */
.modal-sucesso {
  display: none;
  background: #eef4ea;
  border: 1px solid #cadcc0;
  color: #3d5a30;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.83rem;
  line-height: 1.5;
}

/* Aviso de que os campos do RSVP na pré-visualização são um desenho */
.pv-maqueta {
  margin-top: 9px;
  font-size: 0.62rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  color: var(--prim-soft);
  opacity: 0.85;
}

/* ── Ícones da interface (separadores, tipo de evento) ────
   Os selos e ornamentos continuam emoji de propósito: esses
   são conteúdo que vai para o convite, não decoração da app. */
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.tab svg, .evento-opt svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.active svg { stroke-width: 1.9; }

.evento-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--ui-soft);
}
.evento-opt svg { width: 19px; height: 19px; }
.evento-opt span { font-size: 0.74rem; }
.evento-opt.active { color: var(--ui-accent2); }

/* Temas: a cor do tema em vez de um emoji aleatório */
.tema-opt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tema-cor {
  width: 13px; height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Barra do modo de edição (aberto a partir do backoffice) */
.barra-edicao {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fdf7ec, #f6ecd8);
  border-bottom: 1px solid #e5d3ae;
  color: #7a5c1e;
  font-size: 0.84rem;
  padding: 10px clamp(14px, 4vw, 22px);
}
.barra-edicao[hidden] { display: none; }
.barra-edicao #edicaoTexto { flex: 1; min-width: 160px; }
.barra-edicao .btn { padding: 6px 13px; font-size: 0.78rem; width: auto; }

/* ══ Telemóvel ═════════════════════════════════════════════
   Havia só um corte aos 900px, pensado para tablet. Abaixo
   disso a barra de topo esmagava-se e os botões partiam o
   texto a meio. */
@media (max-width: 620px) {
  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .brand-logo { height: 21px; }
  .topbar-actions { gap: 6px; flex-shrink: 0; }
  /* o texto dos botões deixa de partir a meio */
  .topbar-actions .btn {
    padding: 9px 13px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .layout { padding: 14px; gap: 14px; }

  /* Pré-visualização primeiro: quem chega quer ver o convite antes de
     começar a mexer. (Já esteve ao contrário — o editor primeiro —
     mas quem experimentou queixou-se de abrir a página sem perceber
     o que estava a construir.) O botão de publicar fica no fim, a
     seguir a tudo o que há para preencher. */
  .preview-area { order: 0; }
  .panel { order: 1; }
  .phone-screen { height: 56vh; }

  .preview-toolbar { gap: 8px; justify-content: center; }
  .pv-btn { padding: 8px 12px; font-size: 0.78rem; }

  /* dois campos lado a lado a 390px ficam ilegíveis */
  .row2, .row3 { grid-template-columns: 1fr; }
  .evento-grid { grid-template-columns: 1fr 1fr 1fr; }
  .tema-grid { grid-template-columns: 1fr; }
  .seal-grid { grid-template-columns: repeat(5, 1fr); }
  .palette-grid { grid-template-columns: 1fr 1fr; }
  .font-grid { grid-template-columns: 1fr; }

  .tab { font-size: 0.8rem; padding: 12px 4px; }
  .modal { padding: 20px 16px; }
}

@media (max-width: 400px) {
  .brand small { display: none; }
  .seal-grid { grid-template-columns: repeat(4, 1fr); }
  .topbar-actions .btn { padding: 8px 11px; font-size: 0.74rem; }
}

/* ══ Modal: os filhos não podem ser esmagados ═══════════════
   A modal é um flex column com `overflow-y: auto`. Um filho com
   `overflow: hidden` — como `.group`, que embrulha os extras do
   Premium — passa a ter tamanho mínimo automático de ZERO, por
   isso o flexbox espremia-o em vez de deixar a modal rolar: a
   lista de extras encolhia até desaparecer e não havia forma de
   chegar ao fim dela, muito menos no telemóvel.

   `flex-shrink: 0` em todos os filhos devolve-lhes a altura real
   e é a modal que rola, como era suposto. */
.modal > * { flex-shrink: 0; }

/* ══ Assistente ════════════════════════════════════════════ */
.assistente-chamada {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  margin-bottom: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fdf7ec, #f6ecd8);
  border: 1px solid #e5d3ae;
  color: #7a5c1e;
}
.assistente-chamada span { font-weight: 700; font-size: 0.88rem; }
.assistente-chamada small { font-size: 0.76rem; opacity: 0.85; font-weight: 500; }
.assistente-chamada:hover { border-color: #d9b877; }

.passos { display: flex; gap: 6px; margin-bottom: 4px; }
.passos .passo {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--ui-border);
}
.passos .passo.actual { background: var(--ui-accent); }
.passos .passo.feito { background: color-mix(in srgb, var(--ui-accent) 45%, white); }

.assistente-grelha {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.assistente-opcao {
  border: 1.5px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
  padding: 11px 9px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.assistente-opcao:hover { border-color: var(--ui-accent); }
.assistente-opcao.escolhida {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(85, 104, 74, 0.14);
  background: #f7f9f5;
}
.assistente-legenda { font-size: 0.72rem; color: var(--ui-soft); }
.amostra-paleta { display: flex; gap: 3px; }
.amostra-paleta i {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.1);
  display: block;
}
.amostra-fonte {
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--ui-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.amostra-selo { font-size: 1.6rem; line-height: 1; }

.assistente-campos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.assistente-acoes {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.assistente-acoes .btn { width: auto; }

/* As três propostas do fim */
.propostas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.proposta {
  border: 1.5px solid var(--ui-border);
  border-radius: 14px;
  background: var(--fundo);
  padding: 18px 12px 20px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.proposta:hover {
  border-color: var(--prim);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(44, 42, 38, 0.12);
}
.proposta-selo { font-size: 1.5rem; line-height: 1; }
.proposta-eyebrow {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--prim);
  opacity: 0.75;
}
.proposta-nomes {
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--prim);
  overflow-wrap: anywhere;
}
.proposta-divisor { color: var(--accent); font-size: 0.85rem; }
.proposta-data {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.76rem;
  color: var(--prim);
  opacity: 0.8;
}

@media (max-width: 620px) {
  .assistente-campos { grid-template-columns: 1fr; }
  .propostas { grid-template-columns: 1fr; }
  .assistente-grelha { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); }
}

/* ══ Ementa (Premium) ══════════════════════════════════════ */
.ementa-lista { display: flex; flex-direction: column; gap: 7px; margin-bottom: 9px; }
.ementa-item { display: flex; gap: 6px; align-items: center; }
.ementa-item input {
  flex: 1;
  padding: 9px 11px;
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #fdfcfa;
  color: var(--ui-text);
}
.ementa-apagar {
  flex: 0 0 34px;
  height: 34px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: #fff;
  color: var(--ui-soft);
  cursor: pointer;
  font-size: 0.78rem;
}
.ementa-apagar:hover { border-color: #d9a08f; color: #8a3232; }
.ementa-nova { display: flex; gap: 6px; }
.ementa-nova input {
  flex: 1;
  padding: 9px 11px;
  border: 1.5px solid var(--ui-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #fdfcfa;
  color: var(--ui-text);
}
.ementa-nova .btn { width: auto; flex: 0 0 auto; white-space: nowrap; }
.premium-nota {
  border-top: 1px dashed var(--ui-border);
  padding-top: 10px;
  margin-top: 4px;
}

/* ══ Comparador de duas opções ═════════════════════════════ */
.modal-largo { max-width: 620px; }

/* `.btn.small` já traz `width: 100%` lá de cima — o que serve o botão
   "Comparar", que ocupa a linha toda, mas não os dois botões que ficam
   lado a lado dentro do comparador. Por isso aqui manda-se o tamanho
   de forma explícita, em vez de contar com o flex. */
.btn.comparar { margin-top: 4px; }

.comparador {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.comp-lado { display: flex; flex-direction: column; gap: 9px; }
.comp-etiqueta {
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  color: var(--ui-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.comp-cartao {
  background: var(--fundo, #f5efe4);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 22px 14px 24px;
  text-align: center;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.comp-eyebrow {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--prim, #55684a);
  opacity: 0.75;
}
.comp-nomes {
  font-size: 1.7rem;
  line-height: 1.25;
  color: var(--prim, #55684a);
  overflow-wrap: anywhere;
}
.comp-divider { display: flex; align-items: center; justify-content: center; gap: 8px; }
.comp-divider span {
  height: 1px; width: 32px;
  background: linear-gradient(to right, transparent, var(--accent, #c8924a));
}
.comp-divider span:last-of-type {
  background: linear-gradient(to left, transparent, var(--accent, #c8924a));
}
.comp-divider i { font-style: normal; color: var(--accent, #c8924a); font-size: 0.85rem; }
.comp-data {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  color: var(--prim, #55684a);
  opacity: 0.85;
}
.comp-acoes { display: flex; gap: 6px; }
.comp-acoes .btn { width: auto; white-space: nowrap; }
.comp-acoes .btn.primary { flex: 1 1 auto; }
.comp-acoes .btn.ghost { flex: 0 0 44px; padding: 8px 0; text-align: center; }

@media (max-width: 620px) {
  .comparador { grid-template-columns: 1fr; }
  .comp-cartao { min-height: 0; padding: 18px 14px 20px; }
  .comp-nomes { font-size: 1.45rem; }
}

/* Aviso por baixo de um campo com um valor impossível — aparece
   enquanto se escreve, não só ao carregar em publicar. */
.aviso-campo {
  background: #f6f0dd;
  border: 1px solid #e5d3ae;
  color: #7a5c1e;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.79rem;
  line-height: 1.5;
}
.field input.campo-mal { border-color: #d9a566; background: #fdf9f1; }

/* ── Resumo antes de publicar ─────────────────────────────── */
.resumo {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fdfcfa;
  padding: 13px 14px;
}
.resumo-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ui-soft);
  margin-bottom: 9px;
}
.resumo-lista {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.resumo-lista dt { color: var(--ui-soft); white-space: nowrap; }
.resumo-lista dd { font-weight: 500; overflow-wrap: anywhere; }
.resumo-lista dd.em-falta { color: #a86f2d; }
.resumo-falta {
  display: none;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--ui-border);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #7a5c1e;
}
@media (max-width: 620px) {
  .resumo-lista { grid-template-columns: 1fr; gap: 2px; }
  .resumo-lista dt { margin-top: 6px; font-size: 0.72rem; }
}

/* Botão de publicar no fim do editor — só no telemóvel, onde o
   do topo fica muito acima depois de se preencher tudo. */
.publicar-fim { display: none; }

@media (max-width: 620px) {
  .publicar-fim {
    display: block;
    margin-top: 14px;
    padding: 0 2px;
  }
  .publicar-fim .btn {
    width: 100%;
    padding: 15px 18px;
    font-size: 0.95rem;
  }
  .publicar-fim .nota {
    margin-top: 8px;
    font-size: 0.74rem;
    color: var(--ui-soft);
    text-align: center;
    line-height: 1.5;
  }
}

/* Retoques do telemóvel apanhados a rever o editor todo */
@media (max-width: 620px) {
  /* 3 linhas cortavam a mensagem a meio e obrigavam a rolar
     dentro de um campo que já está dentro de uma página que rola */
  #inMensagem { min-height: 92px; }
  #txtDescricao { min-height: 88px; }

  /* os emblemas ✨ e ⬆ saíam para fora do botão */
  .seal-opt.selo-upload { overflow: visible; }
  .seal-opt .mini-badge { top: -4px; right: -3px; font-size: 0.6rem; }
}
