/* Painel da plataforma. As declarações publicadas têm CSS próprio,
   isolado em cada template — nada daqui vaza para lá. */

:root {
  --bg: #0f0d12;
  --bg-soft: #17141b;
  --bg-card: #1d1922;
  --line: #2e2836;
  --text: #f2ecf4;
  --muted: #a79fb0;
  --accent: #e0567f;
  --accent-soft: rgba(224, 86, 127, .14);
  --ok: #4ec98a;
  --bad: #ef6b6b;
  --wait: #e6b451;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* O [hidden] do navegador é `display: none`, mas qualquer regra nossa com
   display explícito (como .btn) vence por especificidade e o elemento
   reaparece. Isto garante que esconder pelo JS funcione sempre. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(224, 86, 127, .16), transparent 60%),
    radial-gradient(800px 400px at 90% 0%, rgba(120, 88, 220, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1080px, 92vw); margin-inline: auto; }
.main { flex: 1; padding: 32px 0 64px; }

/* --- topo --- */
.topbar { border-bottom: 1px solid var(--line); background: rgba(15, 13, 18, .8); backdrop-filter: blur(8px);
          position: sticky; top: 0; z-index: 50; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: .94rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.btn { color: #fff; }

/* --- botões --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid transparent;
  padding: 10px 18px; border-radius: 999px; font: 600 .95rem/1 var(--font);
  cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--lg { padding: 14px 26px; font-size: 1rem; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.linklike { background: none; border: 0; color: var(--muted); font: inherit; font-size: .94rem;
            cursor: pointer; padding: 0; }
.linklike:hover { color: var(--text); }
.linklike--danger { color: var(--bad); }
.inline { display: inline; }

/* --- textos --- */
.page-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 8px 0 6px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin: 0 0 24px; }
.section-title { font-size: 1.3rem; margin: 40px 0 16px; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }
.back { color: var(--muted); font-size: .9rem; }
.big-emoji { font-size: 3rem; }

/* --- hero --- */
.hero { padding: 56px 0 24px; max-width: 720px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.03em; }
.hero__sub { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 48px 0 8px; }
.step { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step__n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
           background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.step h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* --- grade de modelos --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
        overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card__cover { font-size: 2.6rem; padding: 26px 20px; text-align: center;
               background: linear-gradient(140deg, var(--accent) 0%, transparent 120%); filter: saturate(.9); }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__head h3 { margin: 0; font-size: 1.05rem; }
.card__tagline { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tag { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
       background: var(--line); color: var(--muted); white-space: nowrap; }
.tag--free { background: rgba(78, 201, 138, .16); color: var(--ok); }
.tag--premium { background: var(--accent-soft); color: var(--accent); }
.tag--wait { background: rgba(230, 180, 81, .16); color: var(--wait); }

/* --- painéis e formulários --- */
.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel--narrow { max-width: 460px; margin-inline: auto; }
.panel__foot { margin: 20px 0 0; color: var(--muted); font-size: .9rem; }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.field__label em { color: var(--accent); font-style: normal; }
.field__help { color: var(--muted); font-size: .8rem; }
.field__err { color: var(--bad); font-size: .82rem; }

/* Um seletor por exclusão em vez de lista de tipos: quando eu acrescentar um
   campo novo (foi o que aconteceu com o `time`, que ficou branco no meio do
   formulário escuro), ele já nasce com a mesma cara. */
.form input:not([type=color]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
.linkbox input, textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; color: var(--text); font: inherit; font-size: .95rem;
  /* Faz o Chrome desenhar o ícone de calendário/relógio em tema escuro. */
  color-scheme: dark;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* O relógio e o calendário nativos ficam apagados no fundo escuro. */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(1); opacity: .55; cursor: pointer;
}
input[type=date]:hover::-webkit-calendar-picker-indicator,
input[type=time]:hover::-webkit-calendar-picker-indicator { opacity: .9; }
textarea { resize: vertical; }
textarea.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .88rem; }
input[type=color] { width: 64px; height: 40px; padding: 3px; background: var(--bg);
                    border: 1px solid var(--line); border-radius: 10px; }

/* --- micro-upgrades --- */
.extras { display: flex; flex-direction: column; gap: 10px; }
.extra { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center;
         border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; }
.extra:hover { border-color: var(--accent); }
.extra--on { border-color: var(--accent); background: var(--accent-soft); }
.extra input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.extra__txt { display: flex; flex-direction: column; gap: 2px; }
.extra__txt small { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.extra__preco { font-weight: 700; color: var(--accent); white-space: nowrap; }

.panel--sutil { background: transparent; border-style: dashed; }

/* --- respostas recebidas --- */
.respostas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.resposta { display: flex; gap: 14px; align-items: flex-start;
            border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.resposta__reacao { font-size: 1.6rem; line-height: 1.2; }
.resposta__corpo { flex: 1; min-width: 0; }
.resposta__msg { margin: 0 0 4px; overflow-wrap: anywhere; }
.resposta__quando { font-size: .76rem; color: var(--muted); }

@media (max-width: 560px) {
  .extra { grid-template-columns: 22px 1fr; }
  .extra__preco { grid-column: 2; }
}

/* Ações menos usadas da tela do link pronto: presentes, mas discretas. */
.acoes-secundarias { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
                     margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* --- data + hora lado a lado --- */
.duo { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }
.duo__part { display: flex; flex-direction: column; gap: 4px; }
.duo__cap { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* --- blocos repetíveis (momentos) --- */
.repeater { display: flex; flex-direction: column; gap: 8px; }
.repeater__head,
.repeater__row { display: grid; grid-template-columns: 160px 1fr 38px; gap: 8px; align-items: center; }
.repeater__head { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
                  color: var(--muted); padding-bottom: 2px; }
.repeater__row { background: rgba(255, 255, 255, .02); border: 1px solid var(--line);
                 border-radius: 12px; padding: 8px; }
.repeater__row:focus-within { border-color: var(--accent); }
.repeater__row input { background: var(--bg); }

.repeater__del { width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
                 background: transparent; border: 1px solid var(--line); color: var(--muted);
                 font-size: 1.2rem; line-height: 1; }
.repeater__del:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }
.repeater__del:disabled { opacity: .3; cursor: not-allowed; }

.repeater__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.repeater__foot .field__help { margin: 0; flex: 1; min-width: 180px; }
[data-repeater-add]:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 560px) {
  .duo { grid-template-columns: 1fr; }
  .repeater__head { display: none; }
  .repeater__row { grid-template-columns: 1fr 38px; grid-template-areas: "data del" "texto texto"; }
  .repeater__row input[type=date] { grid-area: data; }
  .repeater__row input[type=text] { grid-area: texto; }
  .repeater__del { grid-area: del; }
}

/* A barra de ação acompanha a rolagem: com os blocos de momentos o formulário
   fica longo, e o botão de salvar não pode ficar perdido lá embaixo. */
.form__actions {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  position: sticky; bottom: 0; z-index: 5;
  margin-top: 8px; padding: 14px 0 16px;
  background: linear-gradient(to top, var(--bg) 62%, rgba(15, 13, 18, 0));
}

/* Contador de caracteres dos campos com limite. */
.contador { font-size: .76rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.contador--cheio { color: var(--wait); }

.legenda-obrigatorio { font-size: .78rem; color: var(--muted); margin: 0 0 18px; }
.legenda-obrigatorio em { color: var(--accent); font-style: normal; }
.danger { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* --- alertas --- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: .93rem; border: 1px solid; }
.alert--ok   { background: rgba(78, 201, 138, .1);  border-color: rgba(78, 201, 138, .35);  color: #a9e9c7; }
.alert--bad  { background: rgba(239, 107, 107, .1); border-color: rgba(239, 107, 107, .35); color: #f4b3b3; }
.alert--wait { background: rgba(230, 180, 81, .1);  border-color: rgba(230, 180, 81, .35);  color: #f0d6a0; }

/* --- listagem --- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
             flex-wrap: wrap; margin-bottom: 24px; }
.list { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 16px; align-items: flex-start; background: var(--bg-card);
       border: 1px solid var(--line); border-left: 3px solid var(--accent);
       border-radius: var(--radius); padding: 18px 20px; }
.row__emoji { font-size: 1.8rem; line-height: 1; }
.row__main { flex: 1; min-width: 0; }
.row__main h3 { margin: 0 0 4px; font-size: 1.02rem; }
.row__meta { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox input { font-size: .85rem; color: var(--muted); }
.linkbox--big { margin: 20px 0; }
.linkbox--big input { font-size: 1rem; color: var(--text); }
.share { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.empty { text-align: center; padding: 60px 20px; background: var(--bg-soft);
         border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- editor com prévia --- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 28px; align-items: start; }

/* Ao criar, ainda não existe declaração salva para pré-visualizar ao lado.
   Sem isto o formulário fica encolhido à esquerda, com 440px de vazio. */
.editor--sozinho { grid-template-columns: minmax(0, 760px); justify-content: center; }
.editor__form { min-width: 0; }
.editor__preview { position: sticky; top: 84px; }
.preview__bar { display: flex; justify-content: space-between; align-items: center;
                font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
#preview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius);
           background: #fff; }
.preview__hint { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .editor__preview { position: static; }
  #preview { height: 480px; }
  .row { flex-wrap: wrap; }
  .row__side { flex-direction: row; align-items: center; width: 100%; }
}

/* --- rodapé --- */
.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .85rem; }
.footer p { margin: 0; }
