/* ═══════════════════════════════════════════════════════════
   DLM-PDF Platform — style.css
   Responsabilidade: toda a estilização visual da plataforma
   ═══════════════════════════════════════════════════════════ */

/* ── Variáveis ── */
:root {
  --bg:       #080c14;
  --surface:  #0f1621;
  --surface2: #161e2e;
  --border:   #1c2a40;
  --accent:   #4f8ef7;
  --cyan:     #22d3ee;
  --green:    #10b981;
  --gold:     #f59e0b;
  --red:      #ef4444;
  --text:     #e2e8f0;
  --muted:    #4b6080;
  --mono:     'Space Mono', monospace;
  --sans:     'DM Sans', sans-serif;
  --display:  'Syne', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body + grid de fundo ── */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(79,142,247,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,142,247,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
header {
  position: relative; z-index: 10;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8,12,20,.92);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 1rem;
}

.logo {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .05em;
  margin-left: .1rem;
}

.chain-pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--cyan);
  border: 1px solid rgba(34,211,238,.25);
  padding: .22rem .65rem;
  border-radius: 99px;
  letter-spacing: .1em;
}

/* ══════════════════════════════════════════
   TABS
   ══════════════════════════════════════════ */
.tabs {
  position: relative; z-index: 5;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(8,12,20,.7);
  backdrop-filter: blur(8px);
}

.tab {
  padding: .9rem 2rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  text-transform: uppercase;
  user-select: none;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ══════════════════════════════════════════
   PANELS / LAYOUT
   ══════════════════════════════════════════ */
.panel { display: none; }
.panel.active { display: block; }

.cols {
  position: relative; z-index: 5;
  display: flex;
  flex-direction: row;
  min-height: calc(100vh - 110px);
}

.col-left {
  width: 380px;
  min-width: 380px;
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  background: rgba(15,22,33,.6);
  overflow: hidden;
  transition: width .3s ease, min-width .3s ease, padding .3s ease,
              opacity .3s ease, border-color .3s ease;
}

.cols.sidebar-hidden .col-left {
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

.col-right {
  flex: 1;
  min-width: 0;
  background: #0a0f18;
  display: flex; flex-direction: column;
}

/* Barra de controle persistente (sempre visível) */
.reader-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15,22,33,.95);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}

/* Botão toggle da sidebar */
.btn-sidebar-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: .32rem .7rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .06em;
  font-weight: 700;
  text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79,142,247,.08);
}

/* ══════════════════════════════════════════
   COMPONENTES GENÉRICOS
   ══════════════════════════════════════════ */

/* Section label */
.slabel {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: .55rem;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}

.card-title {
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .85rem;
  display: flex; align-items: center; gap: .5rem;
}

/* Drop zone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 2.2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .22s;
  background: rgba(15,22,33,.5);
}

.dropzone:hover,
.dropzone.over {
  border-color: var(--accent);
  background: rgba(79,142,247,.06);
}

.dropzone input { display: none; }
.dz-icon  { font-size: 2rem; margin-bottom: .5rem; display: block; }
.dz-title { font-size: .88rem; font-weight: 500; margin-bottom: .2rem; }
.dz-sub   { font-size: .73rem; color: var(--muted); }

/* File chip */
.file-chip {
  display: none;
  align-items: center; gap: .5rem;
  background: rgba(79,142,247,.09);
  border: 1px solid rgba(79,142,247,.3);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .73rem;
  color: var(--cyan);
  font-family: var(--mono);
  word-break: break-all;
  margin-top: .75rem;
}

/* Fields */
.field { margin-bottom: .85rem; }

.field label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .35rem;
  font-family: var(--mono);
  letter-spacing: .05em;
}

.field input,
.field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .8rem;
  font-size: .82rem;
  color: var(--text);
  font-family: var(--sans);
  outline: none;
  transition: border-color .2s;
}

.field input:focus,
.field select:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  width: 100%;
  padding: .68rem 1rem;
  border-radius: 9px;
  border: none;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #fff;
}
.btn-primary:hover:not(:disabled) { opacity: .85; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .3; cursor: not-allowed; transform: none; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #000;
}
.btn-gold:hover:not(:disabled) { opacity: .85; transform: translateY(-1px); }
.btn-gold:disabled { opacity: .3; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: .7rem;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ghost:disabled { opacity: .35; cursor: not-allowed; }

/* Steps */
.steps { display: flex; flex-direction: column; gap: .45rem; }

.step {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .8rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .76rem;
  transition: all .3s;
}

.step.active {
  border-color: rgba(79,142,247,.5);
  background: rgba(79,142,247,.07);
}
.step.done {
  border-color: rgba(16,185,129,.4);
  background: rgba(16,185,129,.06);
}
.step.fail {
  border-color: rgba(239,68,68,.4);
  background: rgba(239,68,68,.06);
}

.step-ico { font-size: .88rem; width: 18px; text-align: center; flex-shrink: 0; }
.step-txt { color: var(--muted); }
.step.active .step-txt { color: var(--text); }
.step.done   .step-txt { color: var(--green); }
.step.fail   .step-txt { color: var(--red); }

/* Info card */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  font-size: .75rem;
  display: none;
}

.info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: .38rem 0;
  border-bottom: 1px solid var(--border);
  gap: .5rem;
}
.info-row:last-child { border-bottom: none; }

.info-key {
  color: var(--muted);
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: .65rem;
}

.info-val {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--cyan);
  text-align: right;
  word-break: break-all;
}
.info-val.ok   { color: var(--green); }
.info-val.err  { color: var(--red); }
.info-val.gold { color: var(--gold); }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: .6rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}

/* Wallet badge */
.wallet-badge {
  display: none;
  align-items: center; gap: .5rem;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 8px;
  padding: .45rem .75rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--green);
  margin-top: .6rem;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   PAINEL DIREITO — ESTADOS
   ══════════════════════════════════════════ */
.right-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; color: var(--muted); padding: 3rem;
  text-align: center;
}

.empty-icon  { font-size: 3.5rem; opacity: .18; }
.empty-title { font-family: var(--display); font-size: 1.3rem; opacity: .4; }
.empty-sub   { font-size: .78rem; opacity: .35; max-width: 260px; line-height: 1.6; }

/* ══════════════════════════════════════════
   PUBLISHER — Resultado e Hex
   ══════════════════════════════════════════ */
.result-box {
  display: none;
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 10px;
  padding: 1rem;
}

.result-box h3 {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--green);
  letter-spacing: .1em;
  margin-bottom: .75rem;
}

.hash-display {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--cyan);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem .7rem;
  word-break: break-all;
  margin-bottom: .6rem;
  line-height: 1.6;
}

.demo-note {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 9px;
  padding: .75rem .9rem;
  font-size: .73rem;
  color: var(--gold);
  line-height: 1.55;
}

.demo-note strong {
  display: block;
  margin-bottom: .15rem;
  font-family: var(--mono);
  letter-spacing: .05em;
}

/* ══════════════════════════════════════════
   READER — PDF
   ══════════════════════════════════════════ */
.toolbar-info {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--muted);
}

.secure-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--green);
  border: 1px solid rgba(16,185,129,.3);
  padding: .22rem .65rem;
  border-radius: 99px;
  letter-spacing: .08em;
}

#pdf-pages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.5rem;
}

#pdf-pages canvas {
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
  max-width: 100%;
}

/* ══════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════ */
#toasts {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}

.toast {
  padding: .65rem 1rem;
  border-radius: 9px;
  font-size: .8rem;
  max-width: 310px;
  animation: tIn .2s ease;
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.toast.ok   { border-color: rgba(16,185,129,.5); color: #86efac; }
.toast.err  { border-color: rgba(239,68,68,.5);  color: #fca5a5; }
.toast.info { border-color: rgba(79,142,247,.5); color: #93c5fd; }

@keyframes tIn {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ══════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════ */
.spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinA .6s linear infinite;
}

@keyframes spinA { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .cols { flex-direction: column; }
  .col-left { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .cols.sidebar-hidden .col-left { width: 0; min-width: 0; }
}
