@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Jost:wght@300;400;500;600&display=swap');

:root {
  /* Painel da Zair: versão clara (branco, dourado e tons pastel), no mesmo
     espírito do site. Base copiada do painel do Fabio, que é escuro. */
  --bg: #f7f3ee;
  --bg-panel: #ffffff;
  --bg-input: #fbf8f4;
  --border: rgba(47,42,38,.12);
  --text: #2f2a26;
  --text-muted: #7a716a;
  --gold: #9c7a45;
  --gold-soft: rgba(176,141,87,.14);
  --danger: #b5524a;
  --success: #4f8a5c;
  --warn: #b07d22;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}
h1, h2, h3, .serif { font-family: 'Cormorant Garamond', serif; font-weight: 600; letter-spacing: .01em; }
a { color: var(--gold); }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 32px; text-align: center;
}
.login-card .brand { color: var(--gold); font-size: 22px; letter-spacing: .06em; margin-bottom: 6px; }
.login-logo { display: block; width: 200px; height: auto; margin: 0 auto 14px; }
.login-card p.sub { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.login-card input { width: 100%; margin-bottom: 14px; }
.login-card button { width: 100%; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-panel); border-right: 1px solid var(--border);
  padding: 26px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px 22px; border-bottom: 1px solid var(--border); }
.sidebar .brand { font-size: 19px; color: var(--gold); letter-spacing: .05em; }

.nav-toggle {
  display: none; flex-shrink: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: transparent;
  cursor: pointer; transition: background .2s ease, border-color .2s ease;
}
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--gold); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle:hover { border-color: var(--gold); background: rgba(47,42,38,.03); }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sidebar-menu { flex: 1; display: flex; flex-direction: column; }
.sidebar-menu nav { flex: 1; padding-top: 14px; }
.sidebar-menu nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none;
  color: var(--text-muted); font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 400; padding: 11px 24px;
  cursor: pointer; border-left: 2px solid transparent; transition: all .15s ease;
}
.sidebar-menu nav button:hover { color: var(--text); background: rgba(47,42,38,.04); }
.sidebar-menu nav button.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-soft); }
.sidebar-menu .logout { padding: 14px 24px; border-top: 1px solid var(--border); }
.sidebar-menu .logout button { background: none; border: none; color: var(--text-muted); font-size: 12.5px; cursor: pointer; letter-spacing: .04em; }
.sidebar-menu .logout button:hover { color: var(--danger); }

.main { flex: 1; padding: 34px 44px 80px; max-width: 980px; }
.main header.page-head { margin-bottom: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.main header.page-head h1 { font-size: 30px; margin: 0; }
.main header.page-head p { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0; }

/* ---------- Cards / lists ---------- */
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 24px; }
.panel h2 { font-size: 20px; margin: 0 0 18px; }
.item-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.item-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 8px;
}
.item-row .thumb { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: #efe8dc; flex-shrink: 0; }
.item-row .thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 10px; }
.item-row .info { flex: 1; min-width: 0; }
.item-row .info .title { font-size: 14.5px; color: var(--text); }
.item-row .info .sub { font-size: 12px; color: var(--text-muted); }
.item-row .actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty-hint { color: var(--text-muted); font-size: 13.5px; padding: 10px 2px; }

/* No celular os botoes desciam para a linha de baixo? Nao: .actions tem
   flex-shrink 0 e cinco botoes lado a lado, entao a linha empurrava a largura
   da PAGINA para 550px num aparelho de 390px. O efeito era o painel inteiro
   parecer com zoom, os botoes passando da lateral e o nome do casal com zero
   de largura, quebrando uma palavra por linha. Aqui os botoes ganham uma
   linha so deles e se dividem o espaco. Vale para todas as telas que usam
   .item-row: casamentos, posts, depoimentos, associacoes, documentos. */
@media (max-width: 640px) {
  .item-row { flex-wrap: wrap; }
  .item-row .info { flex: 1 1 140px; }
  .item-row .actions { flex: 1 0 100%; flex-wrap: wrap; gap: 8px; }
  .item-row .actions button { flex: 1 1 auto; min-width: 84px; }
}

/* ---------- Fixar (pin) ---------- */
.list-subhead {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  margin: 2px 2px 2px; padding-top: 2px;
}
.list-subhead:first-child { margin-top: 0; }
.item-row.pinned-row { border-color: var(--gold-soft); }
.item-row.pinned-row.dragging { opacity: .4; }
.item-row .drag-handle { color: var(--text-muted); font-size: 16px; line-height: 1; cursor: grab; flex-shrink: 0; user-select: none; }
.item-row .drag-handle:active { cursor: grabbing; }

/* ---------- Publicado / não publicado (visível só por link direto) ---------- */
.item-row.unpublished-row { border-color: var(--danger); opacity: .8; }
.badge-unpublished {
  display: inline-block; font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--danger); border: 1px solid var(--danger); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}

/* ---------- Abas de idioma (SEO) ---------- */
.seo-lang-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
code { background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; color: var(--text-muted); letter-spacing: .03em; margin-bottom: 5px; margin-top: 14px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=date], input[type=password], input[type=email], textarea, select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: 'Jost', sans-serif; font-size: 14px; padding: 10px 12px; border-radius: 7px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input[type=file] { width: 100%; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; }

/* Campos multilíngues (título/resumo/parágrafo do blog — ver posts.js) —
   uma linha PT/EN/ES por campo, com uma etiqueta pequena identificando o
   idioma antes do input. */
.lang-field { display: flex; flex-direction: column; gap: 8px; }
.lang-row { display: flex; align-items: center; gap: 8px; }
.lang-row input { flex: 1; }
/* Linhas de idioma com caixa de texto alta (FAQ e Processo): a etiqueta PT/EN/ES
   sobe para o topo em vez de ficar centralizada no meio do paragrafo. */
.lang-row textarea { flex: 1; }
.lang-row--alto { align-items: flex-start; }
.lang-row--alto .lang-tag { margin-top: 10px; }

/* Cards que abrem e fecham das telas de FAQ e Processo. Com 12 perguntas
   abertas de uma vez a pagina fica interminavel, entao cada item nasce
   fechado mostrando so o texto em portugues. */
.lt-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; margin-bottom: 10px; }
.lt-card[open] { padding-bottom: 16px; }
.lt-summary { cursor: pointer; padding: 14px 0; font-size: 14px; list-style: none; }
.lt-summary::-webkit-details-marker { display: none; }
.lt-summary::before { content: '\25B8'; color: var(--gold); margin-right: 10px; display: inline-block; transition: transform .15s ease; }
.lt-card[open] .lt-summary::before { transform: rotate(90deg); }
.lt-acoes { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.lt-acoes button { padding: 7px 14px; font-size: 12px; }
/* A caixa de texto cresce sozinha (ver ajustarAltura em js/listaTrilingue.js),
   entao a barra de rolagem interna nao tem mais motivo de existir. */
.lt-card textarea { overflow-y: hidden; }
.lang-tag {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--gold);
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px; text-align: center; min-width: 28px;
}

button, .btn {
  font-family: 'Jost', sans-serif; font-size: 13px; letter-spacing: .04em; cursor: pointer;
  border-radius: 7px; padding: 10px 18px; border: 1px solid var(--gold); background: transparent; color: var(--gold);
  transition: all .15s ease;
}
button:hover, .btn:hover { background: var(--gold); color: #fff; }
button.primary { background: var(--gold); color: #fff; }
button.primary:hover { opacity: .88; background: var(--gold); }
button.ghost { border-color: var(--border); color: var(--text-muted); }
button.ghost:hover { border-color: var(--danger); color: var(--danger); background: transparent; }
button.small { padding: 6px 12px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:disabled:hover { background: transparent; color: var(--gold); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0; }
.gallery-grid .g-item { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: #efe8dc; border: 2px solid transparent; }
.gallery-grid .g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-grid .g-item.cover { border-color: var(--gold); }
.gallery-grid .g-item .g-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65);
  color: #fff; border: none; font-size: 12px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center;
}
.gallery-grid .g-item .g-cover-btn {
  position: absolute; bottom: 3px; left: 3px; right: 3px; font-size: 9px; padding: 3px 4px; letter-spacing: 0;
  background: rgba(0,0,0,.65); color: #fff; border: none; border-radius: 4px;
}
.gallery-grid .g-item.cover .g-cover-btn { background: var(--gold); color: #fff; }
.gallery-grid .g-item .g-section-btn {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65);
  border: none; font-size: 11px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; opacity: .55;
}
.gallery-grid .g-item .g-section-btn.has-section { background: var(--gold); opacity: 1; }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg-panel); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  color: var(--text); padding: 13px 18px; border-radius: 8px; font-size: 13.5px; max-width: 340px; box-shadow: 0 10px 30px rgba(47,42,38,.15); z-index: 999; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
/* Avisos (ex.: foto menor que o recomendado) sao emitidos como toast 'warn'.
   Sem esta regra, eles apareciam com a borda dourada padrao, visualmente
   iguais a uma mensagem de sucesso. */
.toast.warn { border-left-color: var(--warn); }

.publish-box { text-align: center; padding: 44px 20px; }
.publish-box .big-btn { font-size: 15px; padding: 16px 40px; }
.publish-log { text-align: left; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px;
  margin-top: 22px; font-size: 12.5px; color: var(--text-muted); max-height: 220px; overflow-y: auto; font-family: monospace; white-space: pre-wrap; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(47,42,38,.15); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.upload-progress { margin-top: 12px; }
.upload-progress-text { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.upload-progress-track { width: 100%; height: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0%; background: var(--gold); transition: width .15s ease; }

/* align-items:start e o detalhe que mais encurtou esta tela. Sem ele, as
   celulas de uma mesma linha do grid esticavam todas ate a altura da mais
   alta: o card do hero (que carrega o selo de premio dentro) forcava os
   vizinhos a 1195px, com o de baixo vazio. */
/* As colunas seguem a largura DISPONIVEL, nao a da janela: o painel tem o
   menu lateral ocupando espaco, entao uma media query pela janela erra a
   conta. Com minmax, as duas grades (a de cima e a de baixo) sempre caem no
   mesmo numero de colunas e ficam alinhadas entre si e com a faixa do selo. */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-items: stretch; }
/* Os cards de uma mesma fileira terminam na mesma altura (align-items:stretch
   acima), senao quem tem o botao "Remover" fica ~46px mais baixo que os
   vizinhos. Isso so e seguro porque nenhum card carrega mais conteudo que os
   outros: o selo de premio, que era o caso extremo (1195px contra 259px),
   virou faixa propria. O conteudo continua colado no topo. */
.profile-slot { display: flex; flex-direction: column; align-items: stretch; }
.profile-slot .preview { flex: none; }
.profile-slot input[type=file] { margin-top: auto; }
/* Seletor de corte da faixa (capas do Blog, Processo e Para Cerimonialistas). */
.corte-rotulo { font-size: 11.5px; color: var(--text-muted); margin: 10px 0 4px; display: block; }
.corte-select { width: 100%; font-size: 12px; padding: 7px 8px; }
.profile-slot input[type=file] + button { margin-top: 8px; }
.profile-slot { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.profile-slot .preview { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; background: #efe8dc; margin-bottom: 8px; }
.profile-slot .label { font-size: 13px; color: var(--text); }
.profile-slot input[type=file] { font-size: 11.5px; width: 100%; margin-top: 8px; }

/* Cabecalho do card: rotulo a esquerda, "?" a direita. */
.slot-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.slot-info {
  flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; line-height: 1;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: transparent; color: var(--text-muted);
}
/* A regra geral de button:hover pinta o fundo de dourado; aqui o "?" e so
   um contorno, entao o fundo continua transparente nos dois estados. */
.slot-info:hover, .slot-info.is-open { border-color: var(--gold); color: var(--gold); background: transparent; }
/* A dica de tamanho ideal, recolhida por padrao. */
.slot-hint {
  font-size: 11.5px; line-height: 1.5; color: var(--text-muted);
  background: rgba(47,42,38,.05); border-radius: 6px; padding: 8px 10px; margin-top: 8px;
}
/* Faixa do selo de premio: largura inteira, entre a linha de cima e o resto
   das imagens. Duas linhas: as tres legendas ocupando a largura toda, e
   embaixo o logo com os dois botoes ao lado dele, um ao lado do outro. */
.selo-faixa { margin-top: 14px; }
.selo-legendas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.selo-legendas .lang-row { gap: 8px; }
.selo-legendas input { flex: 1; min-width: 0; }

/* A linha de baixo repete as MESMAS tres colunas da linha das legendas, para
   as duas terminarem na mesma borda: logo na primeira, o seletor de arquivo
   na segunda e o botao de remover na terceira, encostado a direita. */
.selo-logo-linha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.selo-cel { display: flex; align-items: center; gap: 10px; min-width: 0; }
.selo-cel--fim { justify-content: flex-end; }
.selo-logo-linha .label { margin: 0; white-space: nowrap; }
.selo-logo-linha input[type=file] { width: 100%; margin: 0; font-size: 11.5px; }
.selo-logo-img { max-height: 40px; max-width: 90px; object-fit: contain; background: rgba(47,42,38,.06); border-radius: 6px; }
.selo-logo-vazio { font-size: 12px; color: var(--text-muted); }

@media (max-width: 780px) {
  .selo-legendas { grid-template-columns: 1fr; }
  .selo-logo-linha { grid-template-columns: 1fr; }
  .selo-cel--fim { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 40;
    border-right: none; border-bottom: 1px solid var(--border); padding: 0;
    background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .sidebar-top { padding: 13px 16px; border-bottom: none; position: relative; }
  .nav-toggle { display: flex; }

  .sidebar-menu {
    position: absolute; top: 100%; left: 12px; right: 12px; z-index: 45;
    background: rgba(255,255,255,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 45px rgba(47,42,38,.18);
    max-height: 0; opacity: 0; transform: translateY(-6px); overflow: hidden; pointer-events: none;
    transition: max-height .28s ease, opacity .2s ease, transform .2s ease;
  }
  .sidebar-menu.is-open {
    max-height: min(72vh, 480px); opacity: 1; transform: translateY(0); overflow-y: auto; pointer-events: auto;
    margin-bottom: 10px;
  }
  .sidebar-menu nav { padding: 8px 6px 4px; display: flex; flex-direction: column; gap: 2px; }
  .sidebar-menu nav button { border-left: none; border-radius: 10px; padding: 12px 14px; }
  .sidebar-menu nav button.active { border-left-color: transparent; }
  .sidebar-menu .logout { padding: 8px 14px 10px; margin: 4px 6px 0; border-top: 1px solid var(--border); }
  .main { padding: 24px; }
}


/* TRANSFERENCIA DE ARQUIVOS */
.tf-barra { height: 8px; border-radius: 999px; background: rgba(47,42,38,.1); overflow: hidden; }
.tf-barra-cheia { height: 100%; width: 0; background: var(--gold); transition: width .25s ease; }
.tf-status { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.tf-status span:first-child { color: var(--gold); font-weight: 600; }

.tf-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.tf-item-topo { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tf-link { display: flex; gap: 8px; margin-top: 12px; }
.tf-link input { flex: 1; min-width: 0; font-size: 12px; }
.tf-link button { flex: none; }
.tf-acoes { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tf-acoes input { flex: 1; min-width: 180px; font-size: 12px; }
.tf-acoes button { flex: none; padding: 8px 14px; font-size: 12px; }
@media (max-width: 640px) {
  .tf-item-topo { flex-direction: column; gap: 8px; }
  .tf-item-topo > div:last-child { text-align: left !important; }
  .tf-link, .tf-acoes { flex-direction: column; align-items: stretch; }
}
