/* ===========================================================================
   Tipografia, estrutura e componentes de base.
   =========================================================================== */

/* --- Tipos ---------------------------------------------------------------- */

.h1-hero {
  font: 700 clamp(32px, 4.6vw, 60px) / 1.03 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.h1 {
  font: 700 clamp(28px, 5vw, 40px) / 1.12 var(--font-display);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.h2 {
  font: 700 clamp(24px, 3.2vw, 34px) / 1.14 var(--font-display);
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

.h3 {
  font: 700 clamp(20px, 2.4vw, 26px) / 1.2 var(--font-display);
  color: var(--ink);
}

.card-title { font: 700 18px/1.25 var(--font-display); color: var(--ink-2); }

.lead {
  font: 400 17px/1.6 var(--font-ui);
  color: var(--body);
  max-width: 52ch;
  text-wrap: pretty;
}

.text { font-size: 14.5px; line-height: 1.62; color: var(--body); text-wrap: pretty; }
.help { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

.rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1.3 var(--font-ui);
}

/* Losango: quadrado rotacionado. Substitui os emoji da versão antiga, que
   eram o principal ruído visual. */
.dia {
  width: 7px;
  height: 7px;
  flex: none;
  transform: rotate(45deg);
  background: currentColor;
  border-radius: 1px;
}

.dia--8 { width: 8px; height: 8px; }
.dia--9 { width: 9px; height: 9px; }

/* --- Estrutura ------------------------------------------------------------ */

.stripe {
  display: flex;
  height: 4px;
}
.stripe > i { flex: 1; }
.stripe > i:nth-child(1) { background: var(--brand-red); }
.stripe > i:nth-child(2) { background: var(--brand-orange); }
.stripe > i:nth-child(3) { background: var(--brand-green); }
.stripe > i:nth-child(4) { background: var(--brand-blue); }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--surface-alt-2);
  border-bottom: 1px solid var(--line);
}

/* min-height 44px: alvo de toque mínimo exigido pelo handoff. */
.brand { display: flex; align-items: center; gap: 14px; text-align: left; min-height: 44px; }
.brand__logo { height: 30px; width: auto; }
.brand__div { width: 1px; height: 30px; background: var(--line-2); }
.brand__name { display: block; font: 700 16px/1.2 var(--font-display); color: var(--ink); white-space: nowrap; }
.brand__tag { display: block; font-size: 12.5px; line-height: 1.3; color: var(--muted); }

.header__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--action);
  /* A linha vem de box-shadow, não de border-bottom: com o alvo de 44px, a
     borda ficaria descolada do texto. */
  box-shadow: inset 0 -1px 0 var(--action-soft-border);
}
.header__link:hover { color: var(--action-hover); box-shadow: inset 0 -1px 0 var(--action); }

.page { display: none; }
.page.is-active { display: block; }

.wrap { max-width: 1160px; margin: 0 auto; padding: clamp(32px, 5vw, 56px) 20px 80px; }
.wrap--form { max-width: 800px; }
.wrap--done { max-width: 680px; }
.wrap--track { max-width: 760px; }
.wrap--panel { max-width: 1180px; }
.wrap--login { max-width: 420px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
}

.card--pad { padding: clamp(20px, 4vw, 30px); }

.footer {
  background: var(--surface-alt-2);
  border-top: 1px solid var(--line);
  padding: 26px 20px;
  text-align: center;
}

/* --- Botões ---------------------------------------------------------------
   Alvo mínimo de 48px em todos; nunca abaixo de 44px.                       */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-cta);
  font: 700 15px/1 var(--font-ui);
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
    transform 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary { background: var(--action); color: #fff; box-shadow: var(--sh-cta); }
.btn--primary:hover:not(:disabled) {
  background: var(--action-hover);
  transform: translateY(-1px);
  box-shadow: var(--sh-cta-hover);
}

.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--action-hover-border); color: var(--action); }

.btn--quiet { background: none; color: var(--muted); min-height: 44px; padding: 10px 14px; }
.btn--quiet:hover:not(:disabled) { color: var(--ink-2); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #9E1928; }

.btn--lg { min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn--sm { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* Desabilitado é visual, não semântico: a validação explica o que falta. */
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Chips ---------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font: 700 12.5px/1.2 var(--font-ui);
  white-space: nowrap;
  border: 1px solid transparent;
}

.chip--live { background: var(--success-soft-bg); color: var(--success-text); }
.chip--info { background: var(--action-soft-bg); color: var(--action-on-soft); }
.chip--warn { background: var(--warning-soft-bg); color: var(--warning-text); }
.chip--danger { background: var(--danger-soft-bg); color: var(--danger); border-color: var(--danger-soft-border); }
.chip--neutral { background: var(--surface-muted); color: var(--muted); }
/* Caso reaberto pela resposta do colaborador. */
.chip--retorno { background: var(--warning-soft-bg); color: var(--warning-text); border-color: #F3D3B4; }
/* Ticket interno: oculto do comitê. */
.chip--interno { background: oklch(0.93 0.02 300); color: oklch(0.38 0.09 300); border-color: oklch(0.86 0.04 300); }

.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  flex: none;
  animation: softPulse 2.4s ease-in-out infinite;
}

/* --- Campos --------------------------------------------------------------- */

.field { display: block; }

.field__label {
  display: block;
  font: 500 14px/1.3 var(--font-ui);
  color: var(--ink-3);
  margin-bottom: 7px;
}
.field__label span { color: var(--muted); font-weight: 400; }
.field__label .req { color: var(--danger); font-weight: 700; }

.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--action-hover-border); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--action-soft-bg);
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft-bg);
}

.textarea { min-height: 168px; resize: vertical; font-family: inherit; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B5F58' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.field__help { display: block; font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-top: 6px; }
.field__help--error { color: var(--danger); font-weight: 600; }

.counter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.counter .mono.is-met { color: var(--success-text); }

.grid-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* --- Caixas de aviso ------------------------------------------------------ */

.note {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  border-radius: var(--r-inner);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--action-soft-bg-2);
  border: 1px solid var(--action-soft-border);
  color: var(--action-on-soft);
}
.note .dia { margin-top: 6px; }
.note--muted { background: var(--surface-muted); border-color: var(--line); color: var(--body); }
.note--warn { background: var(--warning-soft-bg); border-color: #F3D3B4; color: var(--warning-text); }
.note--danger { background: var(--danger-soft-bg); border-color: var(--danger-soft-border); color: var(--danger); }
.note--ok { background: var(--success-soft-bg); border-color: #CFE6B4; color: var(--success-text); }

/* --- Utilidades ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.is-hidden { display: none !important; }
.rise { animation: riseIn 420ms var(--ease) backwards; }
.pop { animation: popIn 380ms var(--ease) backwards; }

.loading { padding: 40px 0; text-align: center; font-size: 14px; color: var(--muted); }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--r-input);
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(60, 45, 40, 0.25);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Sem media queries no handoff: tudo colapsa por flex-wrap e auto-fit.
   As poucas exceções abaixo tratam o que não colapsa sozinho. */
@media (max-width: 560px) {
  .header { padding: 14px 16px; }
  .wrap { padding-inline: 16px; }
}
