/* SAC Social — estilo único, mobile-first.
   Celular (padrão) -> menu inferior fixo | tablet (>= 768px) -> barra lateral só com ícones |
   desktop (>= 1100px) -> menu lateral com textos. Tema claro/escuro por variáveis. */

/* ------------------------------------------------------------------ cores */
:root {
  --azul: #004afd;          /* azul do ícone oficial (contraste 6,2:1 com branco) */
  --azul-escuro: #0039c6;
  --azul-suave: #e5edff;
  --verde: #2e7d32;
  --verde-vivo: #22c55e;
  --verde-suave: #e6f6ea;
  --vermelho: #c62828;
  --vermelho-suave: #fdecea;
  --ambar: #8a5a00;
  --ambar-suave: #fff4d6;
  --fundo: #f3f6fb;
  --superficie: #ffffff;
  --texto: #0f1b2d;
  --texto-suave: #4a5a70;
  --borda: #d5deea;
  --foco: #22c55e;
  --sombra: 0 1px 3px rgba(15, 27, 45, .08), 0 4px 16px rgba(15, 27, 45, .06);
  --raio: 14px;
  --menu-altura: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --azul: #6b9bff; --azul-escuro: #4f84f5; --azul-suave: #15264a;
    --verde: #34d399; --verde-vivo: #34d399; --verde-suave: #0f2f25;
    --vermelho: #ff6b6b; --vermelho-suave: #3a1717; --ambar: #ffcf66; --ambar-suave: #3a2c0c;
    --fundo: #0b1220; --superficie: #121c2e; --texto: #e6edf7; --texto-suave: #9fb0c8; --borda: #24324a;
    --sombra: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --azul: #6b9bff; --azul-escuro: #4f84f5; --azul-suave: #15264a;
  --verde: #34d399; --verde-vivo: #34d399; --verde-suave: #0f2f25;
  --vermelho: #ff6b6b; --vermelho-suave: #3a1717; --ambar: #ffcf66; --ambar-suave: #3a2c0c;
  --fundo: #0b1220; --superficie: #121c2e; --texto: #e6edf7; --texto-suave: #9fb0c8; --borda: #24324a;
  --sombra: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fundo); color: var(--texto);
  overflow-x: hidden; overflow-wrap: anywhere;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--azul); text-underline-offset: 2px; }
h1, h2 { line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 6px; }
.icone { width: 24px; height: 24px; flex: none; }
.pular { position: absolute; left: -9999px; top: 0; }
.pular:focus { left: 8px; top: 8px; z-index: 100; background: var(--superficie); padding: .5rem 1rem; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.so-desktop { display: none !important; }

/* ------------------------------------------------------------------ estrutura */
.conteudo {
  width: 100%; max-width: 640px; margin: 0 auto;
  padding: 1rem 1rem calc(var(--menu-altura) + 1.5rem + env(safe-area-inset-bottom));
}
.sem-menu .conteudo { padding-bottom: 2rem; }
.conteudo-auth { max-width: 460px; padding-top: 1.5rem; }
.rodape { text-align: center; color: var(--texto-suave); font-size: .8rem; padding: 0 1rem 1.5rem; }
.com-menu .rodape { padding-bottom: calc(var(--menu-altura) + 1rem + env(safe-area-inset-bottom)); }
.rodape p { margin: .25rem 0; }
.versao { opacity: .8; }

.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .5rem 1rem; padding-top: calc(.5rem + env(safe-area-inset-top));
  background: var(--superficie); border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: .5rem; color: var(--texto); text-decoration: none; font-size: 1.15rem; }
.marca strong { color: var(--verde); }
.logo-app { border-radius: 22%; }          /* ícone oficial (S branco sobre azul #004AFD) */

/* menu inferior fixo (celular) */
.menu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--menu-altura) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--superficie); border-top: 1px solid var(--borda);
}
.menu > a, .menu .botao-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 48px; min-height: 48px; color: var(--texto-suave); text-decoration: none; font-size: .7rem;
}
.menu > a[aria-current="page"] { color: var(--azul); font-weight: 600; }
.menu > a[aria-current="page"] .avatar-menu { outline: 2px solid var(--azul); }
.menu-marca { display: none !important; }
.menu-criar .icone { width: 30px; height: 30px; color: var(--verde); }
.menu-criar span { display: none; }

/* ------------------------------------------------------------------ componentes */
.cartao {
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 1.25rem; margin-bottom: 1rem;
}
.cartao-auth { padding: 1.5rem 1.25rem; }
.marca-auth { text-align: center; margin-bottom: 1.25rem; }
.marca-auth img { margin: 0 auto .5rem; }
.marca-auth h1 { margin: 0; font-size: 1.6rem; }
.marca-auth strong { color: var(--verde); }
.slogan { color: var(--texto-suave); font-style: italic; margin: .15rem 0 0; }

.campo { margin-bottom: 1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .35rem; }
input[type="text"], input[type="tel"], input[type="password"], input[type="file"], input[type="date"], select {
  width: 100%; min-height: 48px; padding: .7rem .85rem; font: inherit; font-size: 1rem;
  color: var(--texto); background: var(--fundo); border: 1px solid var(--borda); border-radius: 10px;
}
input[type="file"] { padding: .6rem; }
input:focus, select:focus { border-color: var(--azul); outline: 3px solid var(--azul-suave); outline-offset: 0; }
.campo-erro input { border-color: var(--vermelho); }
.entrada-codigo { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.dica { color: var(--texto-suave); font-size: .85rem; margin: .35rem 0 0; }
.erro { color: var(--vermelho); font-size: .88rem; margin: .35rem 0 0; font-weight: 600; }
.senha-caixa { position: relative; }
.senha-caixa input { padding-right: 5.5rem; }
.mostrar-senha {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 76px; border: 0; border-radius: 8px;
  background: transparent; color: var(--azul); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.campo-check .check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--verde); }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
  min-height: 48px; padding: .7rem 1.2rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
}
.botao-primario { background: var(--azul); color: #fff; }
.botao-primario:hover { background: var(--azul-escuro); }
/* tema escuro: azul mais claro, então o texto do botão fica escuro (contraste 6,8:1) */
:root[data-tema="escuro"] .botao-primario, :root[data-tema="escuro"] .abas a[aria-current="page"] { color: #06142b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .botao-primario, :root:not([data-tema="claro"]) .abas a[aria-current="page"] { color: #06142b; }
}
.botao-secundario { background: transparent; color: var(--azul); border-color: var(--azul); }
.botao-perigo { background: transparent; color: var(--vermelho); border-color: var(--vermelho); }
.botao-pequeno { width: auto; min-height: 44px; padding: .45rem .9rem; font-size: .9rem; }
.botao-link { background: none; border: 0; color: var(--azul); font: inherit; cursor: pointer; padding: .5rem; min-height: 44px; }
.botao-icone {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: var(--texto); cursor: pointer;
}
.form-secundario { margin-top: .75rem; }
.alternativa { text-align: center; margin: 1rem 0 0; }
.tema-flutuante { display: block; margin: 0 auto; color: var(--texto-suave); }

.mensagens { margin-bottom: 1rem; }
.aviso { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 .5rem; border-left: 4px solid; }
.aviso-ok { background: var(--verde-suave); border-color: var(--verde); }
.aviso-erro { background: var(--vermelho-suave); border-color: var(--vermelho); }
.aviso-info { background: var(--azul-suave); border-color: var(--azul); }

.avatar { border-radius: 50%; object-fit: cover; background: var(--azul-suave); width: 44px; height: 44px; }
.avatar-menu { width: 26px; height: 26px; }
.avatar-grande { width: 96px; height: 96px; }
.perfil-topo { display: flex; align-items: center; gap: 1rem; }
.perfil-topo .avatar-grande { width: 88px; height: 88px; }
.perfil-topo h1 { margin-bottom: .35rem; }
.boas-vindas { text-align: center; }
.boas-vindas .avatar { margin: 0 auto 1rem; }

.etiquetas { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.etiqueta { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--azul-suave); color: var(--azul); }
.etiqueta-verificada { background: var(--verde-suave); color: var(--verde); }
.etiqueta-pendente { background: var(--ambar-suave); color: var(--ambar); }
.etiqueta-bloqueada { background: var(--vermelho-suave); color: var(--vermelho); }

.dados { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.dados dt { color: var(--texto-suave); }
.dados dd { margin: 0; font-weight: 600; }
.lista-check { padding-left: 1.2rem; margin: 0; }
.lista-check li { margin-bottom: .35rem; }
.lista-check li::marker { color: var(--verde); }

.vazio { text-align: center; color: var(--texto-suave); }
.vazio h1 { color: var(--texto); }
.vazio-icone { display: flex; justify-content: center; margin-bottom: .75rem; color: var(--azul); }
.vazio-icone .icone { width: 56px; height: 56px; }
.vazio img { margin: 0 auto 1rem; }

/* admin */
.abas { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .25rem; }
.abas a { white-space: nowrap; padding: .55rem .9rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; border: 1px solid var(--borda); color: var(--texto); }
.abas a[aria-current="page"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.lista-contas { list-style: none; padding: 0; margin: 0; }
.conta { display: grid; grid-template-columns: 44px 1fr; gap: .75rem; padding: .9rem 0; border-top: 1px solid var(--borda); }
.conta-dados { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.conta-dados span { color: var(--texto-suave); font-size: .86rem; }
.conta-acoes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.form-linha { display: flex; gap: .5rem; }
.form-linha select { width: auto; min-height: 44px; }
.paginacao { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }
.tabela-rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tabela th, .tabela td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela .detalhes { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; min-width: 12rem; }
.texto-legal h2 { margin-top: 1.25rem; }
/* moderação e denúncia */
textarea { width: 100%; padding: .7rem .85rem; font: inherit; color: var(--texto); background: var(--fundo); border: 1px solid var(--borda); border-radius: 10px; resize: vertical; }
.opcoes { border: 1px solid var(--borda); border-radius: 10px; padding: .5rem .9rem; margin: 0 0 1rem; }
.opcoes legend { font-weight: 600; padding: 0 .3rem; }
.opcao { display: flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; }
.opcao input[type="radio"], .opcao input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--azul); }
.entrada-dias { width: 5rem; min-height: 40px; padding: .3rem .5rem; font: inherit; color: var(--texto); background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; }
.acoes-decisao { display: flex; flex-wrap: wrap; gap: .5rem; }
.imagem-moderacao { width: 100%; max-width: 320px; height: auto; border-radius: 12px; border: 1px solid var(--borda); margin: .5rem 0 1rem; }
.texto-moderacao { background: var(--fundo); border-left: 4px solid var(--azul); padding: .6rem .9rem; border-radius: 6px; }
.lista-simples { padding-left: 1.1rem; margin: 0 0 1rem; }
.lista-simples li { margin-bottom: .4rem; }
.subtitulo { font-size: 1rem; margin: .75rem 0 .4rem; }
.form-inline { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-left: .25rem; }
.hash { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; word-break: break-all; }
.avatar-texto { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--azul); }
.foto-pendente { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .6rem; border: 1px dashed var(--ambar); border-radius: 10px; }
.foto-pendente p { margin: 0; }
.regras-foto { margin: 0 0 1rem; padding: .75rem 1rem .75rem 2rem; background: var(--azul-suave); border-radius: 10px; font-size: .9rem; }
.regras-foto li { margin-bottom: .25rem; }
.link-convite { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; word-break: break-all; user-select: all; margin: 0; }

/* ------------------------------------------------------------------ tablet: barra lateral só com ícones */
@media (min-width: 768px) {
  :root { --menu-largura: 84px; }
  .topo { display: none; }
  .so-desktop { display: flex !important; }
  .so-celular { display: none !important; }
  .com-menu { padding-left: var(--menu-largura); }
  .com-menu .conteudo { padding: 1.5rem 1.5rem 2rem; max-width: 688px; }
  .com-menu .rodape { padding-bottom: 1.5rem; }
  .menu {
    top: 0; right: auto; width: var(--menu-largura); height: auto; flex-direction: column;
    justify-content: flex-start; gap: .25rem; padding: 1rem .5rem; border-top: 0; border-right: 1px solid var(--borda);
  }
  .menu > a, .menu .botao-link { flex: none; min-height: 56px; border-radius: 12px; font-size: .68rem; }
  .menu > a:hover, .menu .botao-link:hover { background: var(--azul-suave); }
  .menu-marca { display: flex !important; justify-content: center; margin-bottom: 1rem; }
  .menu-marca span { display: none; }
  .menu-criar span { display: block; }
  .menu-rodape { margin-top: auto; flex-direction: column; gap: .25rem; }
  .menu-rodape form { display: contents; }
  .conta { grid-template-columns: 44px 1fr auto; align-items: center; }
  .conta-acoes { grid-column: auto; justify-content: flex-end; }
  .botao { width: auto; min-width: 12rem; }
  .cartao-auth .botao, .cartao-auth form .botao { width: 100%; }
}

/* ------------------------------------------------------------------ desktop: menu lateral com textos */
@media (min-width: 1100px) {
  :root { --menu-largura: 248px; }
  .menu { padding: 1.25rem .9rem; }
  .menu > a, .menu .botao-link {
    flex-direction: row; justify-content: flex-start; gap: .9rem; padding: .6rem .9rem; font-size: 1rem; min-height: 48px;
  }
  .menu-marca { justify-content: flex-start !important; padding: 0 .9rem !important; }
  .menu-marca span { display: inline; font-size: 1.3rem; }
  .menu-criar .icone { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  .botao, .menu > a { transition: background-color .15s, color .15s; }
}
