/* ===== Cores: jardim de primavera + dourado da logo ===== */
:root {
  --folha: #2E8540;
  --folha-escura: #1F6A31;
  --folha-clara: #DDF2D6;
  --rosa: #F6A8C4;
  --rosa-clara: #FDE3EC;
  --sol: #FFD95E;
  --sol-clara: #FFF3C4;
  --lilas: #CDB9F2;
  --lilas-clara: #EDE5FB;
  --fundo: #F5FBEE;
  --texto: #2B3A2E;
  --texto-suave: #55645A;
  --ouro: linear-gradient(135deg, #B8860B 0%, #E9C85A 45%, #C9A227 100%);
  --ouro-solido: #B8860B;
  --erro: #B3261E;
  --erro-fundo: #FDE8E6;
  --fonte-titulo: "Fraunces", Georgia, "Times New Roman", serif;
  --fonte-corpo: "Nunito Sans", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 18px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fonte-corpo);
  color: var(--texto);
  line-height: 1.55;
  background-color: var(--fundo);
  background-image:
    radial-gradient(circle at 8% 10%, var(--rosa-clara) 0, transparent 32%),
    radial-gradient(circle at 95% 6%, var(--sol-clara) 0, transparent 30%),
    radial-gradient(circle at 90% 95%, var(--lilas-clara) 0, transparent 34%),
    radial-gradient(circle at 4% 92%, var(--folha-clara) 0, transparent 30%);
  background-attachment: fixed;
}

h1, h2 { font-family: var(--fonte-titulo); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.7rem; color: var(--folha-escura); }

/* Nome da associação em dourado */
.nome-assoc {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  color: var(--ouro-solido);
  background: var(--ouro);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Campo de senha com botão Mostrar ===== */
.campo-senha { position: relative; }
.campo-senha input { padding-right: 6.4rem; }
.ver-senha {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  min-height: 44px; padding: 0 1rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--folha-clara); color: var(--folha-escura); font: 800 .95rem var(--fonte-corpo);
}
.ver-senha:hover { background: #C9E8BF; }

/* ===== Foco visível (teclado) ===== */
:focus-visible { outline: 3px solid var(--ouro-solido); outline-offset: 3px; }

/* ===== Telas centralizadas ===== */
.centro {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
  gap: .75rem;
}
.espera-texto { max-width: 30rem; font-size: 1.1rem; color: var(--texto-suave); margin: 0 0 1rem; }

.logo-grande { width: 150px; height: 150px; }
.logo-medio { width: 100px; height: 100px; }
.logo-pequeno { width: 40px; height: 40px; }
.logo-girando { width: 80px; height: 80px; animation: girar 6s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ===== Entrada ===== */
.entrada {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 2rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.entrada-marca { text-align: left; padding-left: 1rem; }
.entrada-marca .nome-assoc { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 1rem 0 .5rem; }
.frase { font-size: 1.2rem; color: var(--texto-suave); max-width: 24rem; margin: 0; }

/* Cantos em forma de pétala */
.petala { border-radius: 44px 10px 44px 10px; }

.entrada-form {
  background: #fff;
  padding: 2rem 1.75rem 2.25rem;
  box-shadow: 0 10px 30px rgba(46, 133, 64, .12), 0 0 0 3px var(--sol-clara);
  border-top: 6px solid #D4AF37;
}

.abas { display: flex; gap: .5rem; margin-bottom: 1.25rem; background: var(--folha-clara); padding: .35rem; border-radius: 999px; }
.aba {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font: 700 1rem var(--fonte-corpo); color: var(--folha-escura);
  padding: .7rem .5rem; border-radius: 999px; min-height: 48px;
}
.aba.ativa { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

label { display: block; font-weight: 700; margin: 1rem 0 .3rem; }
input, select, textarea {
  width: 100%; min-height: 54px;
  font: 400 1.1rem var(--fonte-corpo); color: var(--texto);
  padding: .6rem .9rem;
  border: 2px solid #BFD9B8; border-radius: 14px; background: #FCFFF9;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #D4AF37; box-shadow: 0 0 0 4px var(--sol-clara); }

.explica { color: var(--texto-suave); margin: 0 0 .5rem; }

.aviso {
  margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 12px;
  background: var(--erro-fundo); color: var(--erro); font-weight: 600;
}
.aviso.ok { background: var(--folha-clara); color: var(--folha-escura); }

/* ===== Botões ===== */
.botao {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: .7rem 1.5rem;
  font: 800 1.1rem var(--fonte-corpo);
  border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  width: 100%; margin-top: 1.25rem;
}
.botao:disabled { opacity: .65; cursor: wait; }
.botao-verde { background: var(--folha); color: #fff; }
.botao-verde:hover:not(:disabled) { background: var(--folha-escura); }
.botao-ouro { background: var(--ouro); color: #3D2B00; border-color: #A47A0A; }
.botao-ouro:hover:not(:disabled) { filter: brightness(1.06); }
.botao-borda { background: #fff; color: var(--folha-escura); border-color: var(--folha); width: auto; margin-top: 0; }
.botao-borda:hover { background: var(--folha-clara); }
.botao-pequeno { min-height: 44px; padding: .4rem 1rem; font-size: 1rem; }
.botao-rosa { background: var(--rosa-clara); color: #8A1F4A; border-color: var(--rosa); width: auto; margin-top: 0; min-height: 44px; padding: .4rem 1rem; font-size: 1rem; }
.botao-rosa:hover { background: var(--rosa); }

.link {
  display: block; margin: 1rem auto 0; background: none; border: 0; cursor: pointer;
  font: 700 1rem var(--fonte-corpo); color: var(--folha-escura); text-decoration: underline;
  min-height: 44px;
}

/* ===== Sistema ===== */
.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1.5rem;
  background: #fff;
  border-bottom: 4px solid #D4AF37;
}
.topo-marca { display: flex; align-items: center; gap: .6rem; }
.nome-topo { font-size: 1.35rem; }
.topo-usuaria { display: flex; align-items: center; gap: .9rem; font-weight: 700; }

.menu {
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding: .9rem 1.5rem 0; max-width: 64rem; margin: 0 auto;
}
.menu-item {
  border: 2px solid var(--folha); background: #fff; color: var(--folha-escura);
  font: 800 1.05rem var(--fonte-corpo);
  padding: .55rem 1.3rem; border-radius: 999px; cursor: pointer; min-height: 46px;
}
.menu-item.ativa { background: var(--folha); color: #fff; }
.contagem {
  display: inline-block; min-width: 1.6rem; padding: 0 .45rem; margin-left: .3rem;
  background: var(--sol); color: #5A4300; border-radius: 999px; font-size: .95rem; text-align: center;
}

.conteudo { max-width: 64rem; margin: 0 auto; padding: 1.5rem; }

.em-breve { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; }
.em-breve li {
  background: #fff; padding: 1rem 1.25rem; border-radius: 28px 8px 28px 8px;
  border-left: 8px solid var(--rosa); color: var(--texto-suave);
}
.em-breve li:nth-child(2) { border-left-color: var(--sol); }
.em-breve li:nth-child(3) { border-left-color: var(--lilas); }
.em-breve strong { display: block; color: var(--texto); font-size: 1.15rem; }

/* ===== Lista de usuárias ===== */
.lista { margin-top: 1rem; background: #fff; border-radius: 28px 8px 28px 8px; padding: .5rem 1.25rem; box-shadow: 0 6px 20px rgba(46,133,64,.08); }
.linha-usuaria {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 0; border-bottom: 1px solid #E3EEDF;
}
.linha-usuaria:last-child { border-bottom: 0; }
.linha-usuaria .quem { min-width: 0; }
.linha-usuaria .quem strong { display: block; font-size: 1.15rem; }
.linha-usuaria .quem span { color: var(--texto-suave); font-size: .95rem; overflow-wrap: anywhere; }
.linha-usuaria .acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.acoes .botao { width: auto; margin-top: 0; }
.selo {
  display: inline-block; padding: .15rem .7rem; border-radius: 999px; font-weight: 800; font-size: .9rem; margin-left: .4rem;
}
.selo-aguardando { background: var(--sol-clara); color: #6A4B00; }
.selo-aprovada { background: var(--folha-clara); color: var(--folha-escura); }
.selo-recusada, .selo-desativada { background: var(--rosa-clara); color: #8A1F4A; }
.selo-tesoureira { background: var(--lilas-clara); color: #4B2C8A; }
.vazio { padding: 1.5rem 0; color: var(--texto-suave); text-align: center; }

/* ===== Participantes ===== */
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.barra { display: flex; gap: .75rem; flex-wrap: wrap; align-items: stretch; margin: 1rem 0 .75rem; }
.campo-busca { flex: 1; min-width: 14rem; }
.botao-barra { width: auto; margin-top: 0; }
.opcao { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin: 0 0 .25rem; cursor: pointer; min-height: 44px; }
.opcao input { width: 26px; min-height: 26px; height: 26px; accent-color: var(--folha); }
.dica { margin: .3rem 0 0; color: var(--texto-suave); font-size: .95rem; }
.linha-usuaria .quem .detalhe { display: block; }

dialog { border: 0; padding: 0; background: transparent; width: calc(100% - 2rem); max-width: 30rem; max-height: 92vh; overflow: auto; }
dialog::backdrop { background: rgba(43, 58, 46, .5); }
.dialogo-caixa { background: #fff; padding: 1.5rem 1.5rem 1.75rem; border-top: 6px solid #D4AF37; }
.dialogo-acoes { display: flex; gap: .75rem; margin-top: 1.25rem; }
.dialogo-acoes .botao { margin-top: 0; flex: 1; width: auto; }

/* ===== Pagamentos ===== */
textarea { resize: vertical; font-family: var(--fonte-corpo); }
.cabeca-pag { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cabeca-pag h2 { margin: 0; }
.troca-ano { display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; font-family: var(--fonte-titulo); color: var(--folha-escura); }
.troca-ano .botao { font-size: 1.4rem; min-width: 48px; padding: 0 .8rem; line-height: 1; }

.faixa-mensalidade {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 1rem 0 .5rem; padding: .8rem 1.25rem; background: var(--sol-clara);
  border-left: 8px solid #D4AF37; font-weight: 700;
}
.legenda { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 0; margin: .5rem 0 0; font-size: .95rem; color: var(--texto-suave); }
.legenda li { display: flex; align-items: center; gap: .45rem; }
.amostra { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 .3rem; border-radius: 9px; font-weight: 800; font-size: .8rem; }
.amostra.cel-paga { background: var(--folha); color: #fff; border: 2px solid var(--folha-escura); }
.amostra.cel-coberta { background: var(--lilas-clara); color: #4B2C8A; border: 2px solid var(--lilas); }
.amostra.cel-atraso { background: var(--rosa-clara); color: #8A1F4A; border: 2px solid var(--rosa); }
.cel-retro-amostra { background: var(--ouro); color: #3D2B00; border: 1.5px solid #A47A0A; border-radius: 999px; }

.rolagem { overflow-x: auto; margin-top: 1rem; background: #fff; border-radius: 28px 8px 28px 8px; box-shadow: 0 6px 20px rgba(46,133,64,.08); padding-bottom: .5rem; }
.quadro { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.quadro th, .quadro td { padding: .45rem .2rem; text-align: center; }
.quadro thead th { font-size: .95rem; color: var(--folha-escura); padding-top: .8rem; }
.quadro .col-nome {
  position: sticky; left: 0; z-index: 1; background: #fff; text-align: left;
  min-width: 9.5rem; max-width: 12rem; padding: .5rem .9rem; font-weight: 700;
  border-right: 2px solid var(--folha-clara); overflow-wrap: anywhere;
}
.quadro .col-nome small { display: block; font-weight: 600; color: var(--texto-suave); font-size: .8rem; }
.quadro tbody tr + tr td, .quadro tbody tr + tr th { border-top: 1px solid #EDF5E9; }

.cel {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 54px; margin: 0 auto; padding: 0;
  border: 2px dashed #CFE3C8; border-radius: 14px; background: #FAFFF7; cursor: pointer;
  font: 800 .85rem var(--fonte-corpo); line-height: 1.15; color: var(--texto-suave);
}
.cel:hover { border-color: var(--folha); }
.cel:disabled { opacity: .6; cursor: wait; }
.cel-marca { font-size: 1.05rem; }
.cel-valor { font-size: .78rem; font-weight: 700; }
.cel-paga { background: var(--folha); border: 2px solid var(--folha-escura); color: #fff; }
.cel-coberta { background: var(--lilas-clara); border: 2px solid var(--lilas); color: #4B2C8A; }
.cel-atraso { background: var(--rosa-clara); border: 2px solid var(--rosa); color: #8A1F4A; }
.cel-fora { opacity: .45; }
.cel-retro {
  position: absolute; top: -9px; right: -7px; padding: 0 .4rem; line-height: 1.45;
  background: var(--ouro); color: #3D2B00; border: 1.5px solid #A47A0A; border-radius: 999px;
  font-size: .78rem; font-weight: 800;
}

.meses-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; }
.chip { position: relative; margin: 0; font-weight: 700; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-block; min-width: 58px; min-height: 44px; padding: .45rem .8rem; line-height: 1.7; text-align: center;
  border: 2px solid var(--lilas); border-radius: 999px; background: #fff;
}
.chip input:checked + span { background: var(--lilas); color: #2E1A5C; }
.chip input:disabled + span { opacity: .4; text-decoration: line-through; }
.chip input:focus-visible + span { outline: 3px solid var(--ouro-solido); outline-offset: 2px; }
.link-perigo { color: #8A1F4A; }
.rotulo-ano { display: block; margin: .8rem 0 .1rem; color: var(--folha-escura); font-family: var(--fonte-titulo); font-size: 1.1rem; }
#pag-mais-anos { margin: .6rem 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 1rem; max-width: calc(100% - 2rem);
  padding: .8rem 1.1rem; background: var(--folha-escura); color: #fff; font-weight: 700;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast .botao { width: auto; margin-top: 0; }

/* ===== Atalhos do início ===== */
.atalhos { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem; margin-top: 1rem; }
.atalho {
  text-align: left; cursor: pointer; background: #fff; padding: 1.1rem 1.25rem;
  border: 0; border-left: 8px solid var(--rosa); border-radius: 28px 8px 28px 8px;
  font: 400 1rem var(--fonte-corpo); color: var(--texto-suave); min-height: 84px;
  box-shadow: 0 4px 14px rgba(46,133,64,.08);
}
.atalho:nth-child(2) { border-left-color: var(--sol); }
.atalho:nth-child(3) { border-left-color: var(--lilas); }
.atalho:hover { box-shadow: 0 6px 18px rgba(46,133,64,.18); }
.atalho strong { display: block; font-size: 1.2rem; color: var(--texto); }

/* ===== Relatório ===== */
.folha {
  margin-top: 1rem; padding: 1.25rem; background: #fff;
  border-radius: 28px 8px 28px 8px; border-top: 6px solid #D4AF37;
  box-shadow: 0 6px 20px rgba(46,133,64,.1);
}
.folha-cabeca { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.folha-cabeca img { width: 64px; height: 64px; }
.folha-cabeca .nome-assoc { font-size: 1.5rem; }
.folha-cabeca h3 { margin: 0; font-family: var(--fonte-titulo); font-size: 1.25rem; color: var(--folha-escura); }
.folha-cabeca p { margin: 0; color: var(--texto-suave); font-size: .95rem; }
.rolagem-rel { margin-top: 0; box-shadow: none; border-radius: 0; background: none; padding-bottom: 0; }

.tabela-rel { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.tabela-rel th, .tabela-rel td { padding: .5rem .55rem; border-bottom: 1px solid #E3EEDF; text-align: right; white-space: nowrap; font-size: .92rem; }
.tabela-rel thead th { background: var(--folha-clara); color: var(--folha-escura); border-bottom: 2px solid #D4AF37; }
.tabela-rel .col-nome { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; white-space: normal; min-width: 9.5rem; max-width: 13rem; font-weight: 700; }
.tabela-rel thead .col-nome { background: var(--folha-clara); }
.tabela-rel .col-total { font-weight: 800; background: var(--sol-clara); }
.tabela-rel tfoot th, .tabela-rel tfoot td { font-weight: 800; background: var(--sol-clara); border-top: 3px double #B8860B; border-bottom: 0; }
.tabela-rel .sem-valor { color: #9AA89E; }
.tabela-rel small { display: block; font-weight: 600; color: var(--texto-suave); font-size: .8rem; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff !important; font-size: 11pt; }
  .topo, .menu, .so-tela, #toast, dialog { display: none !important; }
  .conteudo { max-width: none; padding: 0; }
  .folha { box-shadow: none; padding: 0; border-top: 0; }
  .rolagem-rel { overflow: visible; }
  .folha, .folha * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nome-assoc { background: none; -webkit-text-fill-color: #8A6508; color: #8A6508; }
  .tabela-rel th, .tabela-rel td { font-size: 8.5pt; padding: 3px 4px; border: 1px solid #B9C7B4; }
  .tabela-rel .col-nome { position: static; min-width: 0; max-width: none; white-space: normal; }
  .tabela-rel tr { page-break-inside: avoid; }
  .tabela-rel thead { display: table-header-group; }
  .tabela-rel tfoot { display: table-footer-group; }
}

/* ===== Celular ===== */
@media (max-width: 760px) {
  html { font-size: 17px; }
  .entrada { grid-template-columns: 1fr; padding: 1.25rem 1rem 2rem; gap: 1rem; }
  .entrada-marca { text-align: center; padding-left: 0; }
  .entrada-marca .frase { margin-inline: auto; }
  .logo-grande { width: 110px; height: 110px; }
  .topo, .menu, .conteudo { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-girando { animation: none; }
}
