/* NOT ONE Marketing — estilos compartilhados por todas as páginas do portal. */

/* ---- Tokens ----
   --bg, --teal, --teal-hover e --cyan são sobrescritos pelo tema do cliente (shared.js).
   Com fundo claro, shared.js adiciona .light-bg no <html> e os tokens de texto invertem. */
:root {
  --bg: #0a252d;
  --teal: #125c6f;
  --teal-hover: #18728a;
  --cyan: #22d3ee;

  --fg: #fff;
  --fg-dim: rgba(255, 255, 255, .7);
  --fg-faint: rgba(255, 255, 255, .55);
  --label: var(--cyan);
  --hint: rgba(165, 243, 252, .6);
  --line: rgba(255, 255, 255, .12);
  --surface: rgba(255, 255, 255, .04);
  --field: rgba(255, 255, 255, .08);
  --field-line: rgba(255, 255, 255, .2);
  --bar: rgba(0, 0, 0, .18);

  --gap: 6px;
}
:root.light-bg {
  --fg: #0f172a;
  --fg-dim: rgba(15, 23, 42, .7);
  --fg-faint: rgba(15, 23, 42, .6);
  --label: #0f172a;
  --hint: rgba(15, 23, 42, .65);
  --line: rgba(0, 0, 0, .12);
  --surface: rgba(255, 255, 255, .35);
  --field: rgba(0, 0, 0, .06);
  --field-line: rgba(0, 0, 0, .2);
  --bar: rgba(255, 255, 255, .35);
}

/* ---- Base ---- */
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Montserrat', system-ui, sans-serif;
}
main { flex: 1; width: 100%; max-width: 76rem; margin: 0 auto; padding: 16px 12px 0; }
footer { margin: 28px 0 20px; text-align: center; font-size: 12px; color: var(--fg-faint); }

/* ---- Cabeçalho do portal ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bar); }
.site-header > div { display: flex; align-items: center; gap: 16px; max-width: 76rem; margin: 0 auto; padding: 12px; }
.brand-group { display: flex; align-items: center; gap: 16px; margin-right: auto; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.ws-select { max-width: 11rem; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.client-badge { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 16px; border-left: 1px solid var(--field-line); }
.client-badge img { display: block; max-width: 120px; max-height: 32px; object-fit: contain; }
.client-badge span { display: none; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--teal-hover), var(--cyan)); color: var(--bg); font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.brand-name small { font-size: 9px; font-weight: 600; letter-spacing: .32em; color: var(--label); }
.menu-btn { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--fg); cursor: pointer; }
.menu-btn:hover { background: var(--field-line); }
.menu-btn svg, .drawer-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Menu lateral (abre pelo ícone ☰) */
.drawer-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.drawer-overlay.open { opacity: 1; visibility: visible; transition: opacity .2s; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80; display: flex; flex-direction: column;
  width: min(19rem, 86vw); padding: 14px 12px; overflow-y: auto;
  background: var(--bg); color: var(--fg); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0, 0, 0, .4);
  transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s;
}
.drawer.open { transform: translateX(0); visibility: visible; transition: transform .22s ease; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.drawer-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--fg-dim); cursor: pointer; }
.drawer-close:hover { background: var(--field); color: var(--fg); }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a { padding: 11px 14px; border-radius: 10px; border-left: 4px solid transparent; font-size: 15px; font-weight: 600; color: var(--fg-dim); text-decoration: none; }
.drawer-nav a:hover, .drawer-nav a:focus-visible { background: var(--field); color: var(--fg); outline: 0; }
.drawer-nav a.active { border-left-color: var(--cyan); background: var(--field); color: var(--fg); }
body.no-scroll { overflow: hidden; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--field-line); background: var(--field); font: inherit; font-size: 12px; font-weight: 700; color: inherit; cursor: pointer; }
.avatar:hover { background: var(--field-line); }
.menu-who { padding: 8px 10px 6px; font-size: 12px; font-weight: 600; color: #6b7280; word-break: break-all; }

/* ---- Painel (caixa de conteúdo) ---- */
.panel { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.page-head { text-align: center; margin-bottom: 14px; }
h1 {
  display: inline-block; padding: 0 8px 4px; border-bottom: 3px solid var(--fg); border-radius: 4px;
  font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 800; letter-spacing: .025em; text-transform: uppercase;
}
h1[contenteditable] { cursor: text; }
h1:focus { outline: 2px solid var(--cyan); }
.hint { margin-top: 4px; font-size: 12px; color: var(--hint); }

.client { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 12px; }
.client img { display: block; max-width: 180px; max-height: 56px; object-fit: contain; }
.client span { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---- Botões, filtros, menu flutuante ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 600; color: #fff;
  background: var(--teal); border: 1px solid rgba(6, 182, 212, .3);
  transition: background .15s;
}
.btn:hover { background: var(--teal-hover); }
.btn svg { width: 16px; height: 16px; }
.icon-btn { padding: 6px 8px; }
.filter { width: auto; padding: 6px 10px; border-radius: 8px; font: inherit; font-weight: 600; background: var(--field); color: var(--fg); border: 1px solid var(--field-line); }
.filter option { color: #111827; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px;
  border-radius: 10px; background: #fff; color: #1f2937; box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
.menu button:hover { background: #f3f4f6; }
.menu button.danger-item { color: #dc2626; }
.menu button.danger-item:hover { background: #fef2f2; }
.menu hr { margin: 4px 0; border: 0; border-top: 1px solid #e5e7eb; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; }
.toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar > div:first-child { flex-wrap: nowrap; flex-shrink: 0; }

/* ---- Ícones de tipo de post e etiquetas de status ---- */
.icon { flex: none; width: 13px; height: 13px; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--s) 15%, #fff); color: var(--s); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ---- Janelas (dialog) e formulários ---- */
dialog {
  width: min(30rem, calc(100% - 32px)); padding: 24px; margin: auto;
  border: 0; border-radius: 12px; background: #fff; color: #1f2937;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .5);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.modal-head h2 { font-size: 20px; color: #0a252d; }
.close { padding: 4px; border: 0; border-radius: 8px; background: none; color: #9ca3af; cursor: pointer; }
.close:hover { color: #4b5563; }
.close svg { width: 24px; height: 24px; display: block; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: #6b7280; }
input, select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; color: #1f2937;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
textarea { resize: none; }
input[type="color"] { width: 48px; height: 38px; padding: 2px; cursor: pointer; }
.row { display: flex; align-items: center; gap: 10px; }
.muted-text { font-size: 13px; color: #6b7280; }
.logo-preview { display: grid; place-items: center; width: 140px; height: 70px; border: 1px dashed #d1d5db; border-radius: 8px; background: #f3f4f6; color: #9ca3af; font-size: 12px; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.small-btn { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #374151; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.small-btn:hover { background: #f3f4f6; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.modal-actions div { display: flex; gap: 8px; }
.modal-actions button { padding: 8px 14px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.modal-actions .del { color: #dc2626; font-weight: 600; }
.modal-actions .del:hover { background: #fef2f2; }
.modal-actions .cancel { color: #4b5563; }
.modal-actions .cancel:hover { background: #f3f4f6; }
.modal-actions .save { padding: 8px 20px; background: var(--teal); color: #fff; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.modal-actions .save:hover { background: var(--teal-hover); }

/* ---- Janela de post: formulário + pré-visualização ---- */
dialog.wide { width: min(64rem, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.editor-body { display: grid; gap: 20px; }
.preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.preview > label { margin: 0; }
.pv-frame { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; background: #0f172a; overflow: hidden; }
.pv-frame.r916 { width: min(100%, 15.75rem); margin-inline: auto; aspect-ratio: 9 / 16; }
.pv-frame.r11 { aspect-ratio: 1 / 1; }
.pv-frame.drop { outline: 3px dashed var(--teal); outline-offset: -6px; }
.pv-frame img, .pv-frame video { width: 100%; height: 100%; object-fit: contain; background: #0f172a; }
.pv-empty { padding: 16px; text-align: center; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .65); }
.pv-nav { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: #6b7280; }
.pv-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-thumb { position: relative; width: 52px; height: 52px; }
.pv-thumb > button:first-child { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #e5e7eb; overflow: hidden; cursor: pointer; font-size: 16px; }
.pv-thumb.active > button:first-child { border-color: var(--teal); }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pv-thumb .pv-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: #dc2626; color: #fff; font-size: 12px; line-height: 18px; cursor: pointer; }
.pv-caption { max-height: 6.5rem; overflow: auto; font-size: 13px; color: #374151; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-note { min-height: 1.2em; font-size: 12px; color: #6b7280; }
.pv-note.warn { color: #b91c1c; }

.check-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; text-transform: none; color: #374151; cursor: pointer; }
.check-line input { width: auto; }
.autosave { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: #15803d; }
.autosave.warn { color: #b91c1c; }

/* ---- Janela de post: comentários ---- */
.comments { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.comments h3 { margin-bottom: 8px; font-size: 14px; color: #0a252d; }
.comments h3 span { color: #6b7280; font-weight: 500; }
.cm-list { display: flex; flex-direction: column; gap: 10px; max-height: 15rem; margin: 0 0 12px; padding: 0; overflow-y: auto; list-style: none; }
.cm-item { padding: 9px 12px; border-radius: 10px; background: #f3f4f6; font-size: 13px; }
.cm-empty { font-size: 13px; color: #6b7280; }
.cm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 3px; }
.cm-role { padding: 0 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.cm-head time { margin-left: auto; font-size: 11px; color: #6b7280; }
.cm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.cm-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cm-images img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid #d1d5db; }
.cm-form textarea { font-size: 13px; }
.cm-staged { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.cm-staged li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: #e5e7eb; font-size: 12px; }
.cm-staged button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: #9ca3af; color: #fff; line-height: 18px; cursor: pointer; }
.cm-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.cm-send { padding: 7px 16px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cm-send:disabled { opacity: .5; cursor: default; }
.cm-tools { display: flex; gap: 12px; margin-top: 6px; }
.cm-tools button { padding: 0; border: 0; background: none; color: #4b5563; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.cm-tools button:hover { color: var(--teal); text-decoration: underline; }
.cm-tools .cm-del:hover { color: #dc2626; }
.cm-replies { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid #d1d5db; list-style: none; }
.cm-reply { background: #fff; border: 1px solid #e5e7eb; }
.cm-replying { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 5px 10px; border-radius: 8px; background: #eff6ff; color: #1e40af; font-size: 12px; }
.cm-replying button { margin-left: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { background: #f9fafb; color: #374151; cursor: default; }

/* ---- Barra de modo / publicação ---- */
.mode-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.mode-bar.client-view { border-color: var(--cyan); }
.mode-bar .seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--field); }
.mode-bar .seg button { padding: 6px 14px; border: 0; border-radius: 8px; background: none; color: var(--fg-dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mode-bar .seg button[aria-pressed="true"] { background: var(--teal-hover); color: #fff; }
.mode-status { flex: 1 1 14rem; font-size: 12px; font-weight: 600; color: var(--fg-dim); }
.mode-status.warn { color: #facc15; }
:root.light-bg .mode-status.warn { color: #b45309; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---- Aviso de sincronização com o servidor (cloud.js) ---- */
.cloud-banner { position: fixed; left: 50%; bottom: 16px; z-index: 95; display: flex; align-items: center; gap: 12px; max-width: min(40rem, calc(100% - 24px)); padding: 10px 14px; transform: translateX(-50%); border-radius: 10px; background: #92400e; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.cloud-banner[data-kind="error"] { background: #b91c1c; }
.cloud-banner[data-kind="info"] { background: #15803d; }
.cloud-banner button { flex: none; padding: 0 4px; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }

/* ---- Responsivo ---- */
@media (min-width: 640px) {
  .client-badge span { display: block; }
  :root { --gap: 8px; }
  main { padding: 24px 24px 0; }
  .site-header > div { padding: 12px 24px; }
  .panel { padding: 22px; }
}
@media (min-width: 820px) {
  .editor-body { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
}

/* ---- Impressão ----
   Papel sempre branco (economiza tinta e evita a moldura branca do @page em volta de um fundo colorido),
   margens definidas só pelo @page e nenhum elemento com altura em vh/vw. */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  .no-print { display: none !important; }
  :root {
    --bg: #fff !important; --fg: #111827 !important; --fg-dim: #374151 !important; --fg-faint: #4b5563 !important;
    --label: #111827 !important; --hint: #4b5563 !important; --line: #d1d5db !important; --surface: transparent !important;
    --field: transparent !important; --field-line: #d1d5db !important;
  }
  html, body { background: #fff !important; color: #111827 !important; }
  body { display: block; min-height: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  main { max-width: none; margin: 0; padding: 0; }
  .panel { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .page-head { margin-bottom: 3mm; }
  h1 { padding: 0 2mm 1mm; border-bottom-width: 2px; font-size: 16pt; }
  .client { margin-bottom: 3mm; }
  .client img { max-height: 12mm; }
}
