/* =========================================================================
   Portal de Transferências — UNIAVAN
   Marca: grafite #1D1D1B · verde vivo #1BCE1E · verde-texto #0E8C12
   Vanilla CSS, mobile-first, sem framework, sem CDN.
   ========================================================================= */

/* o atributo [hidden] deve sempre esconder, mesmo com display:flex/grid nas classes */
[hidden] { display: none !important; }

:root {
  --graphite: #1D1D1B;
  --graphite-dark: #1C1C1A;
  --green: #1BCE1E;         /* acento vivo — nunca em texto pequeno sobre branco */
  --green-text: #0E8C12;    /* verde legível (AA) para texto/links sobre claro */
  --green-deep: #0B6E0E;    /* estados hover de acento */
  --bg: #F4F6F3;
  --surface: #FFFFFF;
  --line: #E1E4DE;
  --line-strong: #CBD0C7;
  --ink: #1D1D1B;
  --ink-soft: #595C56;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(29,29,27,.04), 0 12px 30px -18px rgba(29,29,27,.22);
  --shadow-focus: 0 0 0 3px rgba(27,206,30,.28);
  --sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --maxw: 780px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a {
  color: var(--green-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: currentColor; }

/* Foco visível e acessível em toda a interface */
:focus-visible {
  outline: 2px solid var(--green-text);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Cabeçalho ---------- */
.site-header {
  background: var(--graphite-dark);
  color: #fff;
  padding: 22px 20px 26px;
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand-row img {
  height: 34px;
  width: auto;
}
.brand-row .brand-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
  border-left: 1px solid rgba(255,255,255,.22);
  padding-left: 12px;
  line-height: 1.3;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5.2vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.12;
  max-width: 20ch;
}
.site-header .subtitle {
  margin: 10px 0 0;
  color: rgba(255,255,255,.72);
  font-size: .98rem;
  max-width: 52ch;
}
.site-header h1 .accent { color: var(--green); }

/* ---------- Contêiner principal ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 22px 24px;
}

/* ---------- Barra de progresso (stepper) ---------- */
.stepper {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  gap: 4px;
}
.stepper__item {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  position: relative;
}
.stepper__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin: 0 auto 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
/* linha de conexão entre os passos */
.stepper__item::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line-strong);
  z-index: 0;
}
.stepper__item:first-child::before { display: none; }
.stepper__label {
  font-size: .72rem;
  color: var(--ink-soft);
  letter-spacing: .01em;
  line-height: 1.25;
  display: block;
  padding: 0 2px;
}
/* estado: concluído */
.stepper__item.is-done .stepper__dot {
  background: var(--green-text);
  border-color: var(--green-text);
  color: #fff;
}
.stepper__item.is-done::before { background: var(--green-text); }
/* estado: atual */
.stepper__item.is-current .stepper__dot {
  background: var(--graphite);
  border-color: var(--graphite);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(29,29,27,.08);
}
.stepper__item.is-current .stepper__label {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Passos do formulário ---------- */
.step { display: none; }
.step.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.step__head { margin-bottom: 18px; }
.step__eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-text);
  margin: 0 0 4px;
}
.step__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.step__desc {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: .95rem;
}

/* ---------- Campos ---------- */
.grid { display: grid; gap: 16px; }
@media (min-width: 560px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
}
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: .78rem; color: var(--ink-soft); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: #9AA096; }

select {
  padding-right: 38px;
  cursor: pointer;
}
/* caret do select desenhado em CSS puro (sem data-URI — respeita img-src 'self') */
.select-wrap { position: relative; display: block; min-width: 0; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-text);
  box-shadow: var(--shadow-focus);
}

/* estado inválido */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.field .error-msg {
  font-size: .78rem;
  color: var(--danger);
  min-height: 0;
  display: none;
}
.field.has-error .error-msg { display: block; }

/* ---------- Upload ---------- */
/* Duas zonas obrigatórias (histórico e ementas). A numeração no título é informação, não enfeite:
   diz que são dois envios distintos, e não um mesmo campo repetido. */
.upload-zone + .upload-zone { margin-top: 22px; }
.upload-zone__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
}
.upload-zone__hint {
  font-size: .85rem;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.45;
}
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  background: #FBFCFA;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--green-text);
  background: rgba(27,206,30,.05);
}
.dropzone__icon {
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  color: var(--green-text);
}
.dropzone strong { color: var(--ink); }
.dropzone__note { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface);
}
.file-item__icon { color: var(--green-text); flex: 0 0 auto; width: 20px; height: 20px; }
.file-item__meta { min-width: 0; flex: 1 1 auto; }
.file-item__name {
  font-size: .88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-item__size { font-family: var(--mono); font-size: .74rem; color: var(--ink-soft); }
.file-remove {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  line-height: 0;
}
.file-remove:hover { color: var(--danger); background: var(--danger-bg); }

.upload-summary {
  margin-top: 12px;
  font-size: .84rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.upload-summary .count { font-family: var(--mono); }
.upload-summary.is-over { color: var(--danger); font-weight: 600; }

/* ---------- Consentimento ---------- */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
}
.consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--green-text);
  cursor: pointer;
}
.consent label { font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }
.consent.has-error { border-color: var(--danger); background: var(--danger-bg); }

/* ---------- Revisão ---------- */
.review {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}
.review__group-title {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.review dl { margin: 0; }
.review__row {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.review__row:last-child { border-bottom: none; }
.review__row dt { color: var(--ink-soft); margin: 0; }
.review__row dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

/* ---------- Ações / navegação ---------- */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}
.actions .spacer { flex: 1 1 auto; }

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary {
  background: var(--graphite);
  color: #fff;
  border-color: var(--graphite);
}
.btn--primary:hover:not(:disabled) { background: #000; }
.btn--primary .arrow { color: var(--green); }

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

.btn--full { width: 100%; justify-content: center; }

/* ---------- Tela de sucesso ---------- */
.success { text-align: center; padding: 12px 6px 6px; }
.success__badge {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(27,206,30,.12);
  color: var(--green-text);
  display: flex; align-items: center; justify-content: center;
}
.success h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.success p { color: var(--ink-soft); margin: 0 auto 20px; max-width: 46ch; }
.protocol-box {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 auto 22px;
  max-width: 340px;
}
.protocol-box .protocol-label {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 6px;
}
.protocol-box .protocol-value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  color: var(--graphite);
  letter-spacing: .02em;
}
.success .email-note {
  font-size: .84rem;
  color: var(--ink-soft);
  background: rgba(27,206,30,.06);
  border: 1px solid rgba(27,206,30,.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-width: 46ch;
  margin: 0 auto 22px;
}

/* ---------- Alerta de erro de envio ---------- */
.submit-error {
  display: none;
  margin-top: 16px;
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .9rem;
}
.submit-error.is-visible { display: block; }

/* spinner do botão */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Acompanhamento ================= */
.track__protocol {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--graphite);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
}
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-text); }
.status-pill[data-tone="ok"]      { background: rgba(27,206,30,.1); border-color: rgba(27,206,30,.3); color: var(--green-deep); }
.status-pill[data-tone="ok"] .dot { background: var(--green-text); }
.status-pill[data-tone="bad"]     { background: var(--danger-bg); border-color: #F5C2BD; color: var(--danger); }
.status-pill[data-tone="bad"] .dot{ background: var(--danger); }
.status-pill[data-tone="wait"] .dot { background: #C58A0A; }

.track__head {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.track__lead { color: var(--ink-soft); font-size: .95rem; margin: 0 0 20px; }

.timeline { list-style: none; margin: 0; padding: 4px 0 0 4px; }
.timeline__item {
  position: relative;
  padding: 0 0 20px 26px;
  border-left: 2px solid var(--line);
}
.timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -7px; top: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green-text);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.timeline__item:first-child::before { background: var(--graphite); }
.timeline__action { font-weight: 600; font-size: .95rem; }
.timeline__at { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); margin-top: 2px; }

.track__empty, .track__loading {
  text-align: center; color: var(--ink-soft);
  padding: 30px 10px; font-size: .95rem;
}

.back-link { margin-top: 22px; font-size: .9rem; }

/* ---------- Rodapé ---------- */
.site-footer {
  background: var(--graphite-dark);
  color: rgba(255,255,255,.62);
  padding: 22px 20px;
  font-size: .82rem;
}
.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: rgba(255,255,255,.82); }
.site-footer .sep { color: rgba(255,255,255,.28); }

/* ---------- utilidades ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Ajustes finos para telas estreitas (>=360px sem overflow) ---------- */
@media (max-width: 440px) {
  .card { padding: 20px 15px; }
  .stepper__label { font-size: .62rem; }
  .site-header { padding: 20px 16px 22px; }
  .review__row { grid-template-columns: 1fr; gap: 2px; }
  .review__row dt { font-size: .78rem; }
  .actions { gap: 8px; }
  .btn { padding: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
