/* =========================================================
   Edital Animal SP — área do participante (login, painel, documentos, mensagens)
   Depende de main.css, paginas.css, form.css e ongs.css.
   ========================================================= */

/* ---------- Login e recuperação ---------- */
.auth { max-width: 520px; margin-inline: auto; display: grid; gap: 16px; }
.auth__title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2rem, 5vw, 2.7rem); line-height: 0.95; }
.auth__lead { color: var(--ink-700); }
.auth__note { padding: 10px 14px; border-radius: 12px; background: #eef3ff; color: var(--blue-800); font-weight: 650; font-size: 0.92rem; }
.auth .errors { margin-bottom: 0; }
.auth__forgot { justify-self: start; margin-top: -4px; font-size: 0.9rem; font-weight: 700; color: var(--blue); text-underline-offset: 3px; }
.auth__submit { width: 100%; margin-top: 6px; }
.auth__demo { font-size: 0.82rem; color: var(--muted); text-align: center; }
.auth__alt { padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: 0.94rem; color: var(--ink-700); }
.auth__alt a { color: var(--blue); font-weight: 750; text-underline-offset: 3px; }
.auth__back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 0.88rem; font-weight: 700; color: var(--ink-700); text-decoration: none; }
.auth__back svg { width: 18px; height: 18px; }
.auth__back:hover { color: var(--blue); }
.auth__step { display: grid; gap: 16px; }
.auth__steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: rs; }
.auth__steps li {
  counter-increment: rs; padding-top: 10px; border-top: 4px solid rgba(11, 11, 15, 0.1);
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.auth__steps li::before { content: counter(rs) '. '; }
.auth__steps li.is-now { border-color: var(--blue); color: var(--ink); }
.auth__steps li.is-done { border-color: var(--ok); color: var(--ink-700); }
.code-input { letter-spacing: 0.5em; font-variant-numeric: tabular-nums; text-align: center; font-size: 1.4rem !important; font-weight: 700; }
.auth__resend { justify-self: center; font-size: 0.9rem; }
.auth__done { justify-items: center; text-align: center; }
.auth__done:focus { outline: none; }

/* ---------- Topo da área ---------- */
.page-hero--area { padding-bottom: clamp(84px, 9vw, 120px); }
.area-top { display: grid; gap: 22px; }
.area-top__id { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 22px); }
.area-top__hello { font-size: 0.86rem; font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.area-top__name { font-size: clamp(2rem, 5.6vw, 4rem); margin-top: 2px; }
.area-top__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; font-size: 0.88rem; font-weight: 650; color: rgba(255, 255, 255, 0.8); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: 0.8rem; font-weight: 800; }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill--analise { background: var(--yellow); color: var(--ink); }
.status-pill--ok { background: #d9f5e4; color: #0b5d2f; }
.status-pill--erro { background: #fde2e1; color: #9b1c1c; }

.area-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.area-tabs::-webkit-scrollbar { display: none; }
.area-tabs__link {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 99px;
  font-size: 0.92rem; font-weight: 750; color: rgba(255, 255, 255, 0.82); text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.area-tabs__link:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.area-tabs__link.is-active { background: var(--white); color: var(--ink); }
.area-tabs__link--out { margin-left: auto; color: rgba(255, 255, 255, 0.6); }
/* Celular: as abas quebram linha em vez de rolar de lado (o "Sair" ficava fora da tela) */
@media (max-width: 639px) {
  .area-tabs { flex-wrap: wrap; row-gap: 6px; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .area-tabs__link { padding: 9px 12px; }
}
@media (max-width: 380px) {
  .area-tabs { gap: 2px; }
  .area-tabs__link { padding: 8px 10px; font-size: 0.86rem; gap: 6px; }
}
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: 0.74rem; font-weight: 800; }

/* ---------- Estrutura ---------- */
.area {
  position: relative; z-index: 2;
  margin-top: clamp(-78px, -6vw, -52px);
  padding-bottom: clamp(64px, 9vw, 120px);
  display: grid; gap: 18px;
}
.area--narrow { max-width: calc(880px + var(--gutter) * 2); }
.area__grid { display: grid; gap: 18px; align-items: start; }
.area__main, .area__side { display: grid; gap: 18px; min-width: 0; }
@media (min-width: 1024px) {
  .area__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
}

.phase-switch {
  justify-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 6px 6px 14px; border-radius: 99px; background: var(--white);
  box-shadow: 0 14px 30px -20px rgba(3, 14, 60, 0.6);
  font-size: 0.82rem; font-weight: 650; color: var(--muted);
}
.phase-switch a { padding: 6px 12px; border-radius: 99px; color: var(--ink); text-decoration: none; font-weight: 750; }
.phase-switch a.is-active { background: var(--ink); color: var(--white); }

.card {
  min-width: 0; display: grid; gap: 14px; align-content: start;
  padding: clamp(18px, 3vw, 28px); border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line);
}
.card--ink { background: var(--ink); color: rgba(255, 255, 255, 0.8); border-color: var(--ink); }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__title { font-size: 1.12rem; font-weight: 800; line-height: 1.25; color: var(--ink); }
.card--ink .card__title { color: var(--white); }
.card__sub { font-size: 0.86rem; color: var(--muted); }
.card__link { font-size: 0.88rem; font-weight: 750; color: var(--blue); text-underline-offset: 3px; }

/* Próximo passo (destaque da fase de inscrição) */
.next-step {
  display: grid; gap: 14px; align-items: center;
  padding: clamp(18px, 3vw, 26px); border-radius: var(--radius);
  background: var(--yellow); color: var(--ink);
}
@media (min-width: 640px) { .next-step { grid-template-columns: auto minmax(0, 1fr) auto; } }
.next-step__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--yellow); }
.next-step__icon svg { width: 24px; height: 24px; }
.next-step__title { font-size: 1.12rem; font-weight: 800; line-height: 1.25; }
.next-step p { margin-top: 4px; font-size: 0.94rem; }
.next-step .btn--primary { background: var(--ink); color: var(--yellow); }
.next-step .btn--primary::before { background: var(--blue); }
.next-step .btn--primary:hover { color: var(--white); }

/* Barra de progresso e status */
.meter { height: 8px; border-radius: 99px; background: rgba(11, 11, 15, 0.08); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 0.6s var(--ease-out); }
.state { flex: none; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 0.76rem; font-weight: 800; white-space: nowrap; }
.state--aprovado { background: #d9f5e4; color: #0b5d2f; }
.state--enviado { background: #eef3ff; color: var(--blue-800); }
.state--rejeitado { background: var(--danger-bg); color: var(--danger); }
.state--pendente { background: rgba(11, 11, 15, 0.07); color: var(--ink-700); }
.doc-mini { display: grid; }
.doc-mini li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-weight: 650; font-size: 0.95rem; }

/* Linha de etapas */
.steps-line { display: grid; gap: 0; }
.steps-line li { position: relative; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding-bottom: 18px; }
.steps-line li:last-child { padding-bottom: 0; }
.steps-line li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: rgba(11, 11, 15, 0.1); }
.steps-line li:last-child::before { display: none; }
.steps-line li.is-done::before { background: var(--ok); }
.steps-line__dot { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(11, 11, 15, 0.2); background: var(--white); }
.steps-line__dot svg { width: 14px; height: 14px; opacity: 0; color: var(--white); }
.steps-line li.is-done .steps-line__dot { background: var(--ok); border-color: var(--ok); }
.steps-line li.is-done .steps-line__dot svg { opacity: 1; }
.steps-line li.is-now .steps-line__dot { border-color: var(--blue); box-shadow: inset 0 0 0 5px var(--white); background: var(--blue); }
.steps-line strong { font-size: 0.96rem; font-weight: 750; }
.steps-line small { font-size: 0.84rem; color: var(--muted); }
.steps-line li.is-now strong { color: var(--blue); }
@media (min-width: 760px) {
  .steps-line { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .steps-line li { grid-template-columns: 1fr; row-gap: 8px; padding-bottom: 0; }
  .steps-line li::before { left: 28px; right: -10px; top: 13px; bottom: auto; width: auto; height: 2px; }
  .steps-line__dot { grid-row: auto; }
}

/* Link de votação */
.share-card p { font-size: 0.94rem; line-height: 1.5; }
.share-card__url { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: var(--yellow) !important; font-weight: 700; font-size: 0.86rem !important; overflow-wrap: anywhere; }
.share-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-card__actions .btn { flex: 1 1 130px; }

/* Mensagens (resumo no painel) */
.msg-mini { display: grid; }
.msg-mini li { border-top: 1px solid var(--line); }
.msg-mini a { display: grid; gap: 2px; padding: 12px 0 12px 16px; position: relative; text-decoration: none; }
.msg-mini a::before { content: ''; position: absolute; left: 0; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.msg-mini .is-unread a::before { background: var(--blue); }
.msg-mini strong { font-size: 0.94rem; font-weight: 650; line-height: 1.35; }
.msg-mini .is-unread strong { font-weight: 800; }
.msg-mini small { font-size: 0.8rem; color: var(--muted); }
.msg-mini a:hover strong { color: var(--blue); }

/* ---------- Votos ---------- */
.votes__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.votes__hero { display: grid; gap: 16px; }
@media (min-width: 640px) { .votes__hero { grid-template-columns: auto 1fr; align-items: end; gap: 28px; } }
.votes__total { display: grid; font-family: var(--font-display); font-size: clamp(3.4rem, 9vw, 5rem); line-height: 0.9; color: var(--ink); font-variant-numeric: tabular-nums; }
.votes__total small { font-family: var(--font-body); font-size: 0.86rem; font-weight: 650; color: var(--muted); margin-top: 6px; }
.votes__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.votes__stats div { padding: 10px 12px; border-radius: 14px; background: var(--paper); }
.votes__stats dt { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.votes__stats dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.votes__stats dd small { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.votes__goal { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #eef3ff; color: var(--blue-800); font-size: 0.92rem; }
.votes__goal svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--blue); }

/* Gráfico de barras: uma série, sem legenda (o título nomeia), dica no hover/foco */
.chart { margin: 4px 0 0; }
.chart__title { font-size: 0.86rem; font-weight: 750; color: var(--ink-700); margin-bottom: 12px; }
.chart__plot {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px;
  align-items: end; height: 150px; padding-top: 22px;
  border-bottom: 1px solid rgba(11, 11, 15, 0.18);
}
.chart__bar {
  position: relative; height: 100%; padding: 0; border: 0; background: transparent; cursor: default;
  display: flex; align-items: flex-end; justify-content: center;
}
.chart__bar::before {
  content: ''; display: block; width: min(70%, 22px); height: calc(var(--v) * 100%);
  border-radius: 4px 4px 0 0; background: var(--blue);
  transition: background-color 0.15s;
}
.chart__bar.is-today::before { background: var(--ink); }
.chart__bar:hover::before, .chart__bar:focus-visible::before { background: var(--blue-800); }
.chart__bar:focus-visible { outline: none; }
.chart__label {
  position: absolute; bottom: calc(var(--v) * 100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 0.74rem; font-weight: 800; color: var(--ink-700); font-variant-numeric: tabular-nums;
}
.chart__tip {
  position: absolute; z-index: 2; top: 0; transform: translate(-50%, -100%);
  padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--white);
  font-size: 0.78rem; font-weight: 700; white-space: nowrap; pointer-events: none;
}
.chart__axis { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; margin-top: 6px; }
.chart__axis span { font-size: 0.72rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Documentos ---------- */
.docs-intro p { color: var(--ink-700); font-size: 0.96rem; }
.docs-group { display: grid; gap: 12px; }
.docs-group__title { margin-top: 10px; font-size: 0.94rem; font-weight: 800; color: var(--ink-700); }
.doc-list { display: grid; gap: 10px; }
.upload {
  display: grid; gap: 14px; padding: 18px; border-radius: 18px;
  background: var(--white); border: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + var(--demo-h) + 20px);
  transition: border-color 0.2s var(--ease);
}
.upload:target, .upload.is-flash { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 70, 214, 0.14); }
.upload[data-status='rejeitado'] { border-color: rgba(180, 35, 24, 0.35); }
@media (min-width: 640px) { .upload { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.upload__info { display: grid; gap: 4px; min-width: 0; }
.upload__name { font-size: 1.02rem; font-weight: 800; }
.upload__help { font-size: 0.9rem; color: var(--ink-700); }
.upload__rules { font-size: 0.8rem; font-weight: 650; color: var(--muted); }
.upload__reason { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 0.88rem; font-weight: 650; }
.upload__reason svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.upload__file { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 0.86rem; font-weight: 650; color: var(--ink-700); overflow-wrap: anywhere; }
.upload__file svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.upload__view {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; margin-left: 4px; padding: 0 12px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 0.8rem; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.upload__view[hidden] { display: none; }
.upload__view svg { color: var(--yellow); }
.upload__view:hover { background: var(--blue); }
.upload__view:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.upload__progress { height: 6px; margin-top: 8px; border-radius: 99px; background: rgba(11, 11, 15, 0.08); overflow: hidden; }
.upload__progress span { display: block; height: 100%; background: var(--blue); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.25s linear; }
.upload__side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (min-width: 640px) { .upload__side { flex-direction: column; align-items: flex-end; } }
.upload__pick { cursor: pointer; }
.upload__pick:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Mensagens ---------- */
.inbox-bar { display: flex; gap: 8px; }
.inbox-bar .filter span { margin-left: 4px; }
.inbox { display: grid; gap: 10px; }
.msg { border-radius: 18px; background: var(--white); border: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + var(--demo-h) + 20px); }
.msg.is-priority { border-color: rgba(138, 90, 0, 0.35); }
.msg summary { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: start; padding: 16px 18px; cursor: pointer; list-style: none; }
.msg summary::-webkit-details-marker { display: none; }
.msg__dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: transparent; }
.msg.is-unread .msg__dot { background: var(--blue); }
.msg__head { display: grid; gap: 2px; }
.msg__title { font-weight: 650; line-height: 1.35; }
.msg.is-unread .msg__title { font-weight: 800; }
.msg__meta { font-size: 0.82rem; color: var(--muted); }
.msg__meta em { font-style: normal; font-weight: 800; color: #8a5a00; }
.msg__body { display: grid; gap: 12px; justify-items: start; padding: 0 18px 18px 40px; color: var(--ink-700); }
.msg__from { font-size: 0.8rem; color: var(--muted); }
.msg[open], .msg:has(details[open]) { border-color: rgba(11, 11, 15, 0.3); }

/* Botão de WhatsApp flutuante (regras base em main.css): no celular vira só o ícone,
   para não cortar o texto nem cobrir os status dos documentos; espaço no fim da página. */
@media (max-width: 640px) {
  .wa-float { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .area, .auth { padding-bottom: 96px; }
}
