/* Cofre de Acessos: base visual herdada do LupaHub (lupa_hub/sistema/src/styles.css).
   DM Sans no texto, Sora nos títulos, azul de marca, raio de 4px, superfícies planas
   com borda de 1px. Claro ou escuro segue o sistema operacional. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fontes/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fontes/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fontes/sora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fontes/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --radius: 4px;
  --background: oklch(0.985 0.005 248);
  --foreground: oklch(0.21 0.025 264);
  --surface: oklch(1 0 0);
  --primary: oklch(0.546 0.215 262);
  --primary-hover: oklch(0.5 0.215 262);
  --primary-foreground: oklch(1 0 0);
  --accent: oklch(0.94 0.018 250);
  --accent-foreground: oklch(0.5 0.19 263);
  --secondary: oklch(0.958 0.012 250);
  --muted: oklch(0.965 0.011 250);
  --muted-foreground: oklch(0.5 0.02 262);
  --destructive: oklch(0.58 0.22 25);
  --destructive-foreground: oklch(1 0 0);
  --destructive-soft: oklch(0.96 0.03 25);
  --destructive-ink: oklch(0.5 0.2 25);
  --success: oklch(0.6 0.13 158);
  --success-ink: oklch(0.46 0.11 158);
  --success-soft: oklch(0.95 0.04 158);
  --warning: oklch(0.72 0.15 78);
  --warning-soft: oklch(0.96 0.05 85);
  --warning-ink: oklch(0.45 0.1 70);
  --border: oklch(0.925 0.012 250);
  --border-strong: oklch(0.86 0.016 255);
  --input: oklch(0.925 0.012 250);
  --ring: oklch(0.546 0.215 262);
  --shadow-pop: 0 12px 32px -8px oklch(0 0 0 / 0.16), 0 2px 6px oklch(0 0 0 / 0.07);
  --font-sans: "DM Sans", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "DM Sans", ui-sans-serif, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: oklch(0.16 0.02 264);
    --foreground: oklch(0.96 0.01 250);
    --surface: oklch(0.21 0.025 264);
    --primary: oklch(0.72 0.18 262);
    --primary-hover: oklch(0.78 0.16 262);
    --primary-foreground: oklch(0.18 0.03 264);
    --accent: oklch(0.3 0.05 262);
    --accent-foreground: oklch(0.85 0.15 262);
    --secondary: oklch(0.26 0.02 264);
    --muted: oklch(0.26 0.02 264);
    --muted-foreground: oklch(0.72 0.02 264);
    --destructive: oklch(0.65 0.21 25);
    --destructive-foreground: oklch(0.18 0.04 25);
    --destructive-soft: oklch(0.3 0.07 25);
    --destructive-ink: oklch(0.82 0.11 25);
    --success: oklch(0.7 0.14 158);
    --success-ink: oklch(0.78 0.13 158);
    --success-soft: oklch(0.3 0.06 158);
    --warning: oklch(0.78 0.15 78);
    --warning-soft: oklch(0.32 0.06 80);
    --warning-ink: oklch(0.88 0.12 85);
    --border: oklch(0.3 0.02 264);
    --border-strong: oklch(0.38 0.025 264);
    --input: oklch(0.3 0.02 264);
    --ring: oklch(0.65 0.18 262);
    --shadow-pop: 0 16px 40px -10px oklch(0 0 0 / 0.55), 0 2px 8px oklch(0 0 0 / 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font: 400 14px/1.5 var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--primary);
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-foreground); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: color-mix(in oklch, var(--primary) 26%, transparent); color: var(--foreground); }
::placeholder { color: var(--muted-foreground); opacity: 1; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius); }
* { scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.93em; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--foreground);
  font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primario { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-perigo { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); }
.btn-fantasma { background: transparent; border-color: transparent; color: var(--muted-foreground); }
.btn-largo { width: 100%; height: 40px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--secondary); }
  .btn-primario:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
  .btn-perigo:hover:not(:disabled) { background: color-mix(in oklch, var(--destructive) 88%, black); }
  .btn-fantasma:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
}

/* Campos */
.campo-texto {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--surface); color: var(--foreground);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.campo-texto { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
select.campo-texto { padding-right: 28px; }
.campo-texto:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 22%, transparent); }
.rotulo { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); }
/* Código do autenticador: grande, centralizado, dígitos espaçados (o recuo à esquerda compensa o espaço depois do último dígito). */
.campo-codigo {
  height: 52px; padding: 0 0 0 0.3em; text-align: center;
  font: 600 20px/1 var(--font-mono); letter-spacing: 0.3em; font-variant-numeric: tabular-nums;
}
.campo-dica { font-size: 12px; font-weight: 400; color: var(--muted-foreground); line-height: 1.45; }

/* Telas de entrada (login da equipe e senha mestra) */
.porta {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.porta-cartao {
  width: min(380px, 100%); display: grid; gap: 18px;
  padding: 30px 28px 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
}
.porta-marca { display: flex; align-items: center; gap: 12px; }
.porta-marca svg { width: 40px; height: 40px; flex: none; }
.porta-marca h1 { font-size: 20px; line-height: 1.2; }
.porta-marca p { font-size: 12.5px; color: var(--muted-foreground); }
.porta-texto { color: var(--muted-foreground); font-size: 13px; line-height: 1.55; }
.porta form { display: grid; gap: 14px; }
.porta-rodape { font-size: 12px; color: var(--muted-foreground); line-height: 1.5; }
.porta { align-content: center; gap: 16px; }
.porta-cartao.largo { width: min(480px, 100%); }
.porta-form { display: grid; gap: 14px; }
.porta-fora { max-width: 380px; text-align: center; font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
fieldset.rotulo { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset:disabled .campo-texto { opacity: 0.55; }

/* Ajuda recolhida na tela do código */
.ajuda { border-top: 1px solid var(--border); padding-top: 14px; font-size: 13px; }
.ajuda summary { cursor: pointer; color: var(--muted-foreground); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ajuda summary:hover { color: var(--foreground); }
.ajuda p { margin-top: 8px; color: var(--muted-foreground); line-height: 1.55; }
.ajuda strong { color: var(--foreground); font-weight: 600; }

/* Etapa: ícone em quadrado de destaque, título e explicação */
.etapa { display: flex; align-items: flex-start; gap: 12px; }
.etapa-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent); color: var(--accent-foreground); }
.etapa-ic .ic { width: 20px; height: 20px; }
.etapa h2 { font-size: 15px; line-height: 1.35; }
.etapa p { margin-top: 3px; color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }
.etapa p strong { color: var(--foreground); font-weight: 600; }

/* Ativação em passos numerados */
.passos-ativacao { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.passos-ativacao > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; row-gap: 8px; align-items: center; }
.passo-num {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 10px;
  background: var(--accent); color: var(--accent-foreground); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.passo-titulo { font-weight: 600; line-height: 1.35; }
.passo-corpo { grid-column: 2; display: grid; gap: 12px; }
.passo-texto { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }
.passo-ok { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--success-soft); color: var(--success-ink); font-size: 13px; font-weight: 500; line-height: 1.45; }
.passo-ok .ic { margin-top: 1px; }

/* QR ao lado da chave */
.cadastro {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted);
}
.cadastro img { width: 148px; height: 148px; border: 1px solid var(--border); border-radius: 3px; }
.cadastro-chave { display: grid; gap: 8px; min-width: 0; }
.cadastro-rotulo { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.45; }
.chave-texto {
  display: block; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font: 600 15px/1.5 var(--font-mono); letter-spacing: 0.04em; overflow-wrap: anywhere; color: var(--foreground);
}
.cadastro-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.cadastro-acoes .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.copiado { border-color: var(--success); color: var(--success-ink); }
/* "Abrir no autenticador" só faz sentido no próprio celular */
.so-toque { display: none !important; }
@media (hover: none) and (pointer: coarse) { .so-toque { display: inline-flex !important; } }
@media (max-width: 460px) {
  .cadastro { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cadastro-acoes { justify-content: center; }
}
.aviso-erro {
  padding: 9px 11px; border-radius: var(--radius);
  background: var(--destructive-soft); color: var(--destructive-ink); font-size: 13px;
}
.aviso-info {
  padding: 9px 11px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-foreground); font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; }
}

/* Diálogo: só para o que precisa de foco protegido (senha mestra, exclusão) */
.dialogo {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--foreground);
  box-shadow: var(--shadow-pop);
  opacity: 1; transform: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), overlay 180ms allow-discrete, display 180ms allow-discrete;
}
@starting-style { .dialogo[open] { opacity: 0; transform: scale(0.97); } }
.dialogo::backdrop { background: oklch(0.2 0.03 264 / 0.42); }
.dialogo-corpo { display: grid; gap: 14px; padding: 22px 22px 18px; }
.dialogo h2 { font-size: 20px; line-height: 1.3; }
.dialogo-texto { color: var(--muted-foreground); line-height: 1.55; }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* Aviso flutuante (entra e sai pelo mesmo lado) */
.aviso-flutuante {
  position: fixed; left: 50%; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px 9px 14px; border-radius: 6px;
  background: var(--foreground); color: var(--background);
  font-size: 13px; font-weight: 500;
  translate: -50% 140%; opacity: 0; pointer-events: none;
  transition: translate 240ms var(--ease-out), opacity 240ms var(--ease-out);
}
.aviso-flutuante.visivel { translate: -50% 0; opacity: 1; pointer-events: auto; }
.aviso-acao {
  border: 0; border-radius: var(--radius); padding: 4px 8px;
  background: color-mix(in oklch, var(--background) 16%, transparent); color: var(--background);
  font-weight: 600; cursor: pointer;
}
