/* Telas de acesso: login, cadastro, aguardando aprovação e 404. */
:root {
  --g1: #0a78d6; --g2: #0556a8; --g3: #02336f;
  --btn: #042a55; --btn-hover: #021d3d;
  --focus: #8fd3ff;
  --ink: #0b1b33; --ink-soft: #4a5a75;
}
body[data-theme="papyrus"]   { --g1:#2f8a88; --g2:#1f6668; --g3:#12434a; --btn:#7c3420; --btn-hover:#622616; --focus:#ffd2b3; }
body[data-theme="marble"]    { --g1:#8a5670; --g2:#613b50; --g3:#3a2030; --btn:#38192a; --btn-hover:#270f1c; --focus:#ffe3a0; }
body[data-theme="sepia"]     { --g1:#5a4338; --g2:#3a2b24; --g3:#1d1512; --btn:#8a4630; --btn-hover:#6f3623; --focus:#ffc4a8; }
body[data-theme="byzantine"] { --g1:#343a66; --g2:#212443; --g3:#0f1022; --btn:#6f5220; --btn-hover:#573f17; --focus:#ffe0a0; }
body[data-theme="patina"]    { --g1:#2f5a4c; --g2:#1e3b33; --g3:#0e1d19; --btn:#245a45; --btn-hover:#194333; --focus:#b4f0d6; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Figtree", system-ui, sans-serif;
  color: #fff;
  background: radial-gradient(120% 100% at 55% 40%, var(--g1) 0%, var(--g2) 46%, var(--g3) 100%) fixed;
  overflow-x: hidden;
}
::selection { background: var(--focus); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Marcas atendidas: flutuam atrás do cartão e se afastam do cursor */
.marcas { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.marca-peca { position: absolute; left: 0; top: 0; display: grid; place-items: center; will-change: transform; }
.marca-peca img { width: 80%; height: 66%; object-fit: contain; opacity: .92; }

.palco {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

/* Cartão de vidro */
.cartao {
  width: min(404px, 100%);
  padding: 24px 40px 26px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .20);
  background: linear-gradient(165deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .06)), rgba(2, 38, 86, .30);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 26px 60px rgba(0, 14, 45, .38);
  animation: entrar .5s cubic-bezier(.16, 1, .3, 1);
}
@keyframes entrar { from { transform: translateY(14px); } to { transform: none; } }

.cartao-topo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.marca { grid-column: 2; display: grid; justify-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.marca img { width: 62px; height: 62px; border-radius: 50%; box-shadow: 0 10px 22px rgba(0, 14, 45, .40); }
.ferramentas { grid-column: 3; justify-self: end; display: flex; gap: 4px; margin: -8px -24px 0 0; }

.icone-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 0;
  border: 0; border-radius: 10px;
  color: #fff; background: transparent;
  font: 700 12px "Figtree", sans-serif;
  cursor: pointer;
  transition: background-color .18s ease;
}
.icone-btn:hover { background: rgba(255, 255, 255, .16); }
.icone-btn svg { width: 19px; height: 19px; }

h1 { margin: 18px 0 4px; font-size: 25px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
.apoio { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: #e4f1ff; text-wrap: pretty; }

.campo { margin-bottom: 14px; }
.campo label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.entrada { position: relative; }
.entrada input {
  width: 100%; height: 44px;
  padding: 0 13px;
  border: 2px solid transparent; border-radius: 8px;
  background: #fff; color: var(--ink);
  font: 500 15px "Figtree", sans-serif;
  caret-color: var(--btn);
}
.entrada input::placeholder { color: #5a6881; }
.entrada input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.entrada.com-olho input { padding-right: 46px; }
.entrada .icone-btn { position: absolute; top: 4px; right: 4px; color: var(--ink-soft); }
.entrada .icone-btn:hover { background: #e8eef8; color: var(--ink); }
.campo.invalido input { border-color: #c4262e; }

.regras { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.regras li {
  display: flex; align-items: center; gap: 6px;
  min-height: 24px;
  padding: 3px 10px 3px 8px;
  border: 1px solid rgba(255, 255, 255, .34); border-radius: 99px;
  background: rgba(255, 255, 255, 0);
  color: #fff; font-size: 12px; font-weight: 600;
  transition: background-color .45s ease, border-color .45s ease, color .45s ease;
}
.regras li svg { flex: 0 0 12px; }
.regras li.ok { background: #fff; border-color: #fff; color: var(--ink); animation: confirmar .55s cubic-bezier(.16, 1, .3, 1); }
@keyframes confirmar { 45% { transform: scale(1.07); } }

.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.aviso { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: #fff0f0; color: #8f1620; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.aviso svg { flex: 0 0 18px; width: 18px; height: 18px; }

.botao {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 6px;
  border: 0; border-radius: 8px;
  background: var(--btn); color: #fff;
  font: 700 15px "Figtree", sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 14, 45, .30);
  transition: background-color .18s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.botao:hover { background: var(--btn-hover); transform: translateY(-1px); }
.botao:active { transform: translateY(0); }
.botao:disabled { cursor: wait; transform: none; }
.botao.sucesso { background: #fff; color: #0a6a3c; cursor: default; }
.botao.secundario { margin-top: 10px; background: transparent; border: 1px solid rgba(255, 255, 255, .45); box-shadow: none; }
.botao.secundario:hover { background: rgba(255, 255, 255, .14); }
.giro { width: 17px; height: 17px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.troca { margin: 18px 0 0; text-align: center; font-size: 13.5px; color: #e4f1ff; }
.troca button { padding: 2px; border: 0; background: none; color: #fff; font: 700 13.5px "Figtree", sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Etapas da aprovação */
.etapas { list-style: none; margin: 0 0 18px; padding: 0; }
.etapas li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 16px; font-size: 14px; }
.etapas li:last-child { padding-bottom: 0; }
.etapas li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 29px; bottom: 3px; width: 2px; background: rgba(255, 255, 255, .35); }
.etapas i { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .55); border-radius: 50%; }
.etapas .feita i { background: #fff; border-color: #fff; color: #0a6a3c; }
.etapas .atual i { border-color: #fff; box-shadow: 0 4px 14px rgba(0, 14, 45, .35); }
.etapas .atual i::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.etapas strong { display: block; }
.etapas small { display: block; margin-top: 2px; font-size: 12.5px; color: #e4f1ff; }
.conta { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 20, 55, .34); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.conta strong { display: block; }

.codigo { margin: 18px 0 0; text-align: center; font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.centro { text-align: center; }

/* Diálogos */
.veu { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(1, 18, 44, .62); }
.dialogo { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .22); background: linear-gradient(165deg, var(--g2), var(--g3)); box-shadow: 0 30px 70px rgba(0, 10, 32, .5); }
.dialogo header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.dialogo h2 { margin: 0 0 4px; font-size: 19px; }
.dialogo header p { margin: 0 0 16px; font-size: 13.5px; color: #e4f1ff; }
.opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcoes.uma { grid-template-columns: 1fr; }
.opcao { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 12px; background: rgba(255, 255, 255, .07); color: #fff; font: 600 14px "Figtree", sans-serif; text-align: left; cursor: pointer; }
.opcao:hover { background: rgba(255, 255, 255, .15); }
.opcao[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--ink); }
.opcao[aria-pressed="true"]::after { content: ""; width: 6px; height: 11px; margin: -3px 3px 0 auto; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.amostra { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); }

@media (max-width: 760px) {
  .cartao { padding: 20px 22px 22px; border-radius: 18px; }
  .ferramentas { margin-right: -10px; margin-top: -6px; flex-direction: column; }
  .entrada input { font-size: 16px; height: 48px; }
  .botao { min-height: 48px; }
}
@media (max-width: 380px) { .opcoes { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .cartao, .regras li.ok { animation: none; }
  .botao, .regras li { transition: none; }
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .cartao { background: var(--g2); }
}

/* O contêiner das ferramentas usa .user-area para o i18n.js encaixar o botão de idioma. */
.ferramentas .hecar-language-trigger.is-header-control {
  width: auto; min-width: 36px; height: 36px; margin: 0; padding: 0 6px; gap: 0;
  border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: #fff;
}
.ferramentas .hecar-language-trigger svg { display: none; }
.ferramentas .hecar-language-trigger:hover { background: rgba(255, 255, 255, .16); color: #fff; transform: none; }
.ferramentas .hecar-language-trigger:focus-visible { box-shadow: none; outline: 3px solid var(--focus); }

.cartao .hidden { display: none; }
.aviso.error-msg { display: none; }

/* Avisos do sistema */
.system-toast-container { position: fixed; top: 18px; right: 18px; z-index: 9999; display: grid; pointer-events: none; }
.system-toast {
  max-width: min(400px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.45;
  box-shadow: 0 16px 36px rgba(0, 14, 45, .35); overflow-wrap: anywhere;
  opacity: 0; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease;
}
.system-toast.show { opacity: 1; transform: none; }
.system-toast.is-success { color: #0a6a3c; }
.system-toast.is-error { color: #8f1620; }

/* Seletor de paleta (compartilhado com o ERP; aqui só muda a aparência destas telas) */
.acesso-page .modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; }
.acesso-page .theme-picker-overlay {
  --picker-surface: var(--g3);
  --picker-soft: color-mix(in srgb, var(--g3) 86%, #fff);
  --picker-text: #fff;
  --picker-muted: #e4f1ff;
  --picker-line: rgba(255, 255, 255, .22);
  --picker-primary: var(--focus);
}
.acesso-page .theme-picker-modal { font-family: "Figtree", system-ui, sans-serif; }
.acesso-page .theme-picker-modal .theme-picker-done { color: #0b1b33 !important; }
.acesso-page .theme-picker-eyebrow { display: none; }
.acesso-page .theme-picker-heading p { font-size: 13px; }
.acesso-page .theme-option-copy strong { font-size: 14px; }
.acesso-page .theme-option-copy small { font-size: 12px; }
.acesso-page .theme-picker-current { font-size: 12px; }
.acesso-page .theme-picker-done { font-size: 13px !important; }

/* Seletor de idioma */
.acesso-page .hecar-language-overlay {
  --bg-card: var(--g3);
  --bg-main: color-mix(in srgb, var(--g3) 86%, #fff);
  --text-main: #fff;
  --text-muted: #e4f1ff;
  --border: rgba(255, 255, 255, .22);
  --primary: var(--focus);
  font-family: "Figtree", system-ui, sans-serif;
}
.acesso-page .hecar-language-eyebrow { display: none; }
.acesso-page .hecar-language-code, .acesso-page .hecar-language-check { color: var(--ink); }
.acesso-page .hecar-language-code { background: #fff; }
.acesso-page .hecar-language-options > button:focus-visible,
.acesso-page .hecar-language-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .system-toast { transition: none; }
}
