/* ─────────────────────────────────────────────────────────────────────────
   KIN · Download seguro — página estática, hospedada na Vercel.

   11/08/2026 — Diego testou o link real e achou a tela "feia, fora do
   padrão do sistema". Reescrita usando os MESMOS tokens de design do
   dashboard (src/styles/kin-tokens.css), a mesma fonte (IBM Plex Sans),
   os mesmos ícones (Material Symbols Outlined, nunca emoji) e a mesma
   marca "金" usada na barra lateral do app.

   2ª leva (mesmo dia): logo da EMPRESA que envia o documento em destaque
   (branding já decidido desde 14/07 — "página pode ser white-label"); a
   marca KIN vira um selo pequeno no canto superior esquerdo.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --jade:          #2DAA85;
  --jade-deep:     #1A7A5E;
  --washi:         #fafaf7;
  --surface:       #edeef1;
  --card:          #ffffff;
  --text-1:        #1C1C1E;
  --text-2:        #4A4A52;
  --text-3:        #8A8A96;
  --success:       #047857;
  --success-light: #d1fae5;
  --danger:        #b91c1c;
  --danger-light:  #fee2e2;
  --warning:       #b45309;
  --warning-light: #fef3c7;
  --border-subtle: #e7e8ea;

  --font:      'IBM Plex Sans', sans-serif;
  --font-jp:   'IBM Plex Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-card:  0 1px 2px rgba(10,14,20,.04), 0 4px 12px rgba(10,14,20,.03);
  --shadow-modal: 0 20px 60px rgba(0,0,0,.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 84px 16px 40px;
}

/* ── Marca KIN — selo pequeno no canto superior esquerdo (pedido do Diego:
   "o logo da KIN pode ir em outro lugar, bem em cima, na esquerda") ────── */
.kin-mark {
  position: absolute;
  top: 24px; left: 24px;
  display: flex; align-items: center; gap: 8px;
  opacity: .85;
}
/* Selo KIN oficial (SVG inline no index.html, K vazado) — mesmo selo do
   dashboard (src/components/brand/KinLogo.tsx). */
.kin-mark-badge { width: 26px; height: 26px; flex-shrink: 0; display: block; }
.kin-mark-badge svg { display: block; }
.kin-mark-text { line-height: 1.15; }
.kin-mark-name {
  font-family: var(--font); font-size: 12px; font-weight: 700;
  color: var(--text-2); letter-spacing: .02em;
}
.kin-mark-sub {
  font-family: var(--font-jp); font-size: 7.5px; font-weight: 300;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .16em;
  margin-top: 1px; white-space: nowrap;
}

.wrap { width: 100%; max-width: 460px; }

/* ── Logo da empresa remetente — onde antes ficava "KIN Financial
   Intelligence": é a marca que o destinatário reconhece (a empresa que
   mandou o e-mail), não a nossa. ─────────────────────────────────────── */
.empresa-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 18px;
  text-align: center;
}
.empresa-logo {
  max-height: 44px; max-width: 100%;
  object-fit: contain;
}
/* Nome/razão social — aparece SEMPRE, grande, com ou sem logo (pedido do
   Diego, 11/08/2026: "tem que ser grande sempre" — dá credibilidade,
   identifica quem está mandando o documento independente de ter imagem) */
.empresa-nome {
  font-family: var(--font); font-size: 20px; font-weight: 700;
  color: var(--text-1); letter-spacing: -.01em;
}

.card {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

/* Selo pequeno "Download seguro" — não domina mais a tela, é só contexto */
.card-eyebrow {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: var(--washi);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em; color: var(--jade-deep);
}
.card-eyebrow .material-symbols-outlined { font-size: 15px; }

.card-body { padding: 26px 32px 26px; }

.loading { color: var(--text-3); font-size: 14px; margin: 0; }

.saudacao {
  font-family: var(--font); font-size: 16px; font-weight: 600;
  color: var(--text-1); margin: 0 0 6px;
}

.instrucao {
  font-family: var(--font); font-size: 14px; line-height: 1.6;
  color: var(--text-2); margin: 0 0 22px;
}

.erro {
  background: var(--danger-light);
  border: 1px solid rgba(185,28,28,.25);
  color: var(--danger);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
  margin-bottom: 18px;
  display: flex; align-items: flex-start; gap: 8px;
}
.erro .material-symbols-outlined { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.campo-senha-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
  margin: 0 0 8px;
}
.campo-senha-label .material-symbols-outlined { font-size: 15px; color: var(--jade-deep); }

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-1);
  background: var(--washi);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(45,170,133,.14);
}
input[type="text"]:disabled,
input[type="password"]:disabled { opacity: .55; cursor: default; }
input.cpf {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: .35em;
  text-align: center;
}

button.primary {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: var(--jade-deep);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, box-shadow .15s, transform .1s;
}
button.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 3px 10px rgba(45,170,133,.3);
}
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary:disabled { opacity: .5; cursor: default; }

.rodape {
  font-family: var(--font);
  font-size: 12px; line-height: 1.6;
  color: var(--text-3);
  margin: 20px 0 0;
  text-align: center;
}
.rodape b { color: var(--text-2); }

.validade {
  font-family: var(--font);
  font-size: 12px; line-height: 1.6;
  color: var(--text-3);
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.validade b { color: var(--text-2); font-weight: 600; }

.lista-intro {
  font-family: var(--font);
  font-size: 14px; line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 18px;
}

/* Selecionar todos + linha de ações em lote, acima da lista */
.lista-marcar-todos {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 2px 2px 12px;
  cursor: pointer;
}
.lista-marcar-todos input { width: 16px; height: 16px; accent-color: var(--jade-deep); cursor: pointer; }

.arquivo-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--washi);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font);
  color: var(--text-1);
  margin: 0 0 8px;
}
.arquivo-check { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--jade-deep); cursor: pointer; }

.arquivo-icone {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: rgba(26,122,94,.1);
  color: var(--jade-deep);
  display: grid; place-items: center;
}
.arquivo-icone .material-symbols-outlined { font-size: 19px; }
.arquivo-info { flex: 1; min-width: 0; }
.arquivo-tipo { display: block; font-size: 14px; font-weight: 600; color: var(--text-1); }
.arquivo-detalhe { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.arquivo-baixar-um {
  flex-shrink: 0;
  padding: 7px 12px;
  background: transparent;
  color: var(--jade-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.arquivo-baixar-um:hover:not(:disabled) { background: #fff; border-color: var(--jade); }
.arquivo-baixar-um:disabled { opacity: .6; cursor: default; }
.arquivo-baixar-um.feito { color: var(--success); border-color: transparent; background: var(--success-light); }

.lista-status { margin: 4px 0 0; }
.lista-status .erro { margin: 10px 0 0; }

/* Link mágico por pessoa (102) — a lista agrega vários envios, então
   agrupa por campanha/competência em vez de um array plano de arquivos.
   111 (12/08/2026): data completa (dia/mês/ano + hora) de cada envio, não
   só o mês — e a lista fica dentro de um container com altura máxima e
   rolagem própria (Diego: "quando tem muito documento fica tela gigante"). */
.lista-grupo-campanha { margin: 0 0 20px; }
.lista-grupo-campanha:last-child { margin-bottom: 0; }
.lista-grupo-titulo {
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  margin: 0 0 2px;
}
.lista-grupo-data {
  font-family: var(--font); font-size: 11px; color: var(--text-3);
  margin: 0 0 10px;
}
.lista-campanhas-scroll {
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 4px;
}

button.secundario {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  background: transparent;
  color: var(--jade-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
button.secundario:hover { background: var(--washi); border-color: var(--jade); }

.rodape-marca {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--text-3);
  margin: 22px 0 0;
}

@media (max-width: 400px) {
  .kin-mark { top: 16px; left: 16px; }
  .page { padding-top: 70px; }
}
