/* VIDEREVOX — design system compartilhado.
   Cores extraídas dos PDFs de design e da documentação para devs. */
:root {
  --vdx-bg:        #0a1628;
  --vdx-bg-deep:   #050d18;
  --vdx-panel:     #0f2036;
  --vdx-panel-2:   #16293f;
  --vdx-sidebar:   #05080f;
  --vdx-card:      #ffffff;
  --vdx-ink:       #111827;
  --vdx-ink-soft:  #4b5563;
  --vdx-line:      #d8dee7;

  --vdx-green:     #10b981;
  --vdx-green-2:   #16a92f;
  --vdx-blue:      #3b82f6;
  --vdx-cyan:      #29abe2;
  --vdx-cyan-2:    #1ea7e8;
  --vdx-amber:     #d4c214;
  --vdx-orange:    #f39c12;
  --vdx-red:       #e6263a;
  --vdx-magenta:   #c92d8d;
  --vdx-white:     #ffffff;

  --vdx-radius:    10px;
  --vdx-radius-sm: 6px;
  --vdx-shadow:    0 10px 30px rgba(0,0,0,.35);
  --vdx-font:      "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--vdx-font);
  background: var(--vdx-bg);
  color: var(--vdx-white);
  -webkit-font-smoothing: antialiased;
}

/* Fundo padrão dos apps (gradiente que substitui as fotos do mockup) */
.vdx-backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 700px at 50% 0%, rgba(41,171,226,.16), transparent 60%),
    radial-gradient(900px 600px at 20% 100%, rgba(16,185,129,.10), transparent 60%),
    linear-gradient(180deg, #0b1a2e 0%, #060e1b 100%);
}

/* Logotipo com padrão braille (reproduz o logo dos PDFs) */
.vdx-logo { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; user-select: none; }
.vdx-logo .braille { display: block; height: 14px; }
.vdx-logo .wordmark {
  font-weight: 700; letter-spacing: .14em; color: #fff; line-height: 1;
  display: inline-flex; align-items: center; gap: .02em;
}
.vdx-logo .wordmark .eye {
  display: inline-flex; align-items: center; justify-content: center;
  width: .82em; height: .82em; border: .1em solid currentColor; border-radius: 50%;
  position: relative; top: .02em;
}
.vdx-logo .wordmark .eye::after { content: ""; width: .3em; height: .3em; background: currentColor; border-radius: 50%; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--vdx-radius-sm); cursor: pointer;
  font: inherit; font-weight: 600; padding: 12px 20px; color: #fff;
  transition: filter .15s ease, transform .05s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green { background: var(--vdx-green-2); }
.btn-blue  { background: var(--vdx-cyan); }
.btn-primary { background: var(--vdx-blue); }
.btn-red   { background: var(--vdx-red); }
.btn-ghost { background: transparent; border: 1px solid var(--vdx-cyan); color: var(--vdx-cyan); }
.btn-sm    { padding: 7px 12px; font-size: 13px; }
.btn-lg    { padding: 16px 28px; font-size: 17px; }
.btn-block { width: 100%; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > label { font-size: 13px; color: #cbd5e1; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; font: inherit; padding: 12px 14px;
  border-radius: var(--vdx-radius-sm); border: 1px solid transparent;
  background: #0b1220; color: #fff;
}
.input::placeholder, .textarea::placeholder { color: #93a3b8; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--vdx-cyan); outline-offset: 1px; }
.input.is-valid { border-color: var(--vdx-green); background: #0d2118; }
.input.is-invalid { border-color: var(--vdx-red); }
.field-error { color: #ff8b95; font-size: 12px; min-height: 15px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9fb3c8 50%), linear-gradient(135deg, #9fb3c8 50%, transparent 50%); background-position: right 18px center, right 13px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.textarea { min-height: 96px; resize: vertical; }

/* Toggle (switch) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 46px; height: 24px; border-radius: 999px; background: #6b7280;
  position: relative; transition: background .18s ease; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--vdx-green-2); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { outline: 2px solid var(--vdx-cyan); outline-offset: 2px; }

/* Cartões e tags */
.card { background: var(--vdx-card); color: var(--vdx-ink); border-radius: var(--vdx-radius); padding: 18px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; }
.tag-green { background: var(--vdx-green-2); }
.tag-blue  { background: var(--vdx-cyan); }
.tag-pink  { background: var(--vdx-magenta); }
.tag-amber { background: #c9b30c; }

/* Barra de progresso */
.progress { background: #e5e7eb; border-radius: 999px; height: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--vdx-cyan); border-radius: 999px; transition: width .3s ease; }

/* Toast */
#vdx-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.vdx-toast {
  background: #10233b; color: #fff; border-left: 4px solid var(--vdx-green);
  padding: 13px 18px; border-radius: 8px; box-shadow: var(--vdx-shadow); max-width: 380px; font-size: 14px;
  animation: vdxIn .2s ease;
}
.vdx-toast.error { border-left-color: var(--vdx-red); }
.vdx-toast.info  { border-left-color: var(--vdx-cyan); }
@keyframes vdxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Modal */
.vdx-modal-backdrop { position: fixed; inset: 0; background: rgba(3,8,15,.72); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 20px; }
.vdx-modal { background: #3d4450; color: #fff; border-radius: 12px; max-width: 1100px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--vdx-shadow); }

/* Acessibilidade */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--vdx-cyan); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--vdx-green-2); color: #fff; padding: 10px 16px; z-index: 999; }
.skip-link:focus { left: 8px; top: 8px; }

/* Modo alto contraste (FAB Acessibilidade Ativa) */
body.vdx-a11y { --vdx-ink-soft: #1a1a1a; }
body.vdx-a11y .card { border: 2px solid #000; }
body.vdx-a11y .btn { outline: 2px solid #fff; }
body.vdx-a11y .input, body.vdx-a11y .select, body.vdx-a11y .textarea { border-color: #fff; }
body.vdx-a11y { font-size: 17px; }

/* FAB de acessibilidade */
.vdx-fab {
  position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--vdx-blue); border: 3px solid rgba(255,255,255,.25); color: #fff;
  display: grid; place-items: center; cursor: pointer; z-index: 800; box-shadow: var(--vdx-shadow);
}
.vdx-fab.on { background: var(--vdx-orange); }

.muted { color: #9fb3c8; }
.center { text-align: center; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
[hidden] { display: none !important; }

/* Estado de rede (offline-first) — barra fina no topo, fora do fluxo do conteúdo.
   Fica escondida quando há conexão e nada pendente. */
.vdx-net {
  position: fixed; top: 0; left: 0; right: 0; z-index: 950;
  transform: translateY(-100%); transition: transform .18s ease;
  padding: 9px 16px; text-align: center;
  font-size: 14px; font-weight: 600; line-height: 1.3;
  color: #1a1200; background: var(--vdx-amber);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.vdx-net.show { transform: none; }
.vdx-net.sync { background: var(--vdx-cyan); color: #04202c; }
body.vdx-a11y .vdx-net { font-size: 17px; padding: 12px 16px; border-bottom: 3px solid #000; }
@media (prefers-reduced-motion: reduce) { .vdx-net { transition: none; } }
