/* =====================================================================
   DX Secure Files - folha de estilo unica (consola + area publica)
   Digital Xperience

   Paleta e tipografia retiradas de digitalxperience.pt:
     primaria  #F89404   escuro  #15171E / #020205   texto  #FFFFFF
     tipo de letra: Be Vietnam Pro

   A fonte e servida a partir deste servidor, de proposito: uma pagina que
   entrega documentos confidenciais nao deve fazer pedidos a terceiros nem
   revelar o IP do destinatario a um CDN externo.

   Nota: a politica de seguranca (CSP) desta aplicacao bloqueia atributos
   style="..." no HTML. Todo o estilo vive aqui, incluindo as utilidades no
   fim do ficheiro.
   ===================================================================== */

@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/bevietnampro-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/bevietnampro-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/bevietnampro-700.woff2') format('woff2');
}

:root {
  --bg:        #020205;
  --bg-2:      #0a0c12;
  --surface:   #15171e;
  --surface-2: #1b1e27;
  --line:      #2c303c;
  --line-soft: #23262f;
  --ink:       #ffffff;
  --ink-2:     #b2b7c4;
  --ink-3:     #7b8190;
  --brand:     #f89404;
  --brand-2:   #f19300;
  --brand-soft:#ffbc7d;
  --on-brand:  #15171e;
  --info:      #5b8def;
  --ok:        #2ed47a;
  --warn:      #ffc53d;
  --danger:    #ff4d5e;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 18px 48px rgba(0, 0, 0, .55);
  --mono:      ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --sans:      "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 10% -10%, rgba(248, 148, 4, .10), transparent 58%),
    radial-gradient(900px 600px at 100% 0%, rgba(248, 148, 4, .05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 1rem; }

.muted    { color: var(--ink-2); }
.dim      { color: var(--ink-3); }
.small    { font-size: .85rem; }
.mono     { font-family: var(--mono); }
.nowrap   { white-space: nowrap; }
.right    { text-align: right; }
.center   { text-align: center; }
.breakall { word-break: break-all; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .m0 { margin: 0; }
.mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; } .mt3 { margin-top: 1.75rem; }
.mb1 { margin-bottom: .35rem; } .mb2 { margin-bottom: 1rem; } .mb3 { margin-bottom: 1.75rem; }
.hidden { display: none; }

/* ---------------------------------------------------------------- marca */
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-logo { display: block; width: 158px; height: auto; }
.brand-logo.sm { width: 132px; }
.brand-logo.lg { width: 186px; }
.brand-divider { width: 1px; align-self: stretch; background: var(--line); }
.brand-sub {
  font-size: .68rem; color: var(--brand);
  letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
}
.brand-stack { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.brand-stack.center-x { align-items: center; }

/* ------------------------------------------------------------- estrutura */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex: none; padding: 1.4rem 1rem;
  background: linear-gradient(180deg, var(--bg-2), rgba(10, 12, 18, .5));
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 1.5rem;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .92rem; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: var(--ink); text-decoration: none; }
.nav a.on { background: rgba(248, 148, 4, .14); color: var(--brand); font-weight: 600; }
.nav .sep { margin: .7rem .7rem .3rem; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.push-bottom { margin-top: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.75rem; border-bottom: 1px solid var(--line-soft);
  background: rgba(2, 2, 5, .78); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.content { padding: 1.75rem; max-width: 1240px; width: 100%; }

/* ---------------------------------------------------------------- cartoes */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1.25rem; }
.card-highlight { border-color: rgba(248, 148, 4, .5); }
.card-danger { border-color: rgba(255, 77, 94, .38); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.narrow { max-width: 760px; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.stat .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; }
.stat .v.brand { color: var(--brand); }

/* --------------------------------------------------------------- tabelas */
.table-wrap { overflow-x: auto; }
/* Sem largura minima o navegador esmaga as colunas e parte os nomes a meio.
   Assim a tabela desliza na horizontal e cada coluna mantem-se legivel. */
.table-wrap > table { min-width: 800px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: .55rem .7rem; border-bottom: 1px solid var(--line);
}
td { padding: .7rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }

.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w220 { max-width: 220px; } .w260 { max-width: 260px; }
.w300 { max-width: 300px; } .w420 { max-width: 420px; }

/* --------------------------------------------------------------- etiquetas */
.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink-2);
}
.tag.ok      { color: var(--ok);     border-color: rgba(46, 212, 122, .35); background: rgba(46, 212, 122, .10); }
.tag.warn    { color: var(--warn);   border-color: rgba(255, 197, 61, .35); background: rgba(255, 197, 61, .10); }
.tag.danger  { color: var(--danger); border-color: rgba(255, 77, 94, .35);  background: rgba(255, 77, 94, .10); }
.tag.brand   { color: var(--brand);  border-color: rgba(248, 148, 4, .4);   background: rgba(248, 148, 4, .12); }
.tag.accent  { color: var(--info);   border-color: rgba(91, 141, 239, .35); background: rgba(91, 141, 239, .12); }

.kind {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  background: rgba(248, 148, 4, .12); color: var(--brand); border: 1px solid rgba(248, 148, 4, .26);
}

/* ------------------------------------------------------------- formularios */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.field { margin-bottom: 1.1rem; }
.field-wide { flex: 2 1 320px; }
.field-bottom { display: flex; align-items: flex-end; }
.hint  { font-size: .8rem; color: var(--ink-3); margin-top: .35rem; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .62rem .8rem;
  background: #0d0f16; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .93rem; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(248, 148, 4, .18);
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: #5a6070; }
.w-auto { width: auto; }
.w-search { width: 230px; }
.otp-input {
  font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center;
}

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }

.check { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .8rem; }
.check input { margin-top: .25rem; accent-color: var(--brand); }
.check label { margin: 0; font-weight: 500; color: var(--ink); }

.choice { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: .7rem; cursor: pointer; }
.choice:hover { border-color: var(--brand); }
.choice input { accent-color: var(--brand); margin-right: .5rem; }
.choice .t { font-weight: 600; }
.choice .d { font-size: .84rem; color: var(--ink-3); margin-top: .25rem; }

/* ---------------------------------------------------------------- botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: transform .06s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.16); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: var(--on-brand);
}
.btn-danger  { background: rgba(255, 77, 94, .12); border-color: rgba(255, 77, 94, .42); color: #ff8b96; }
.btn-ghost   { background: transparent; }
.btn-sm      { padding: .38rem .7rem; font-size: .82rem; }
.btn-block   { width: 100%; }
.btn-row     { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.btn-row.end-x { justify-content: flex-end; }

/* --------------------------------------------------------------- avisos */
.alert { border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1.25rem; border: 1px solid; font-size: .9rem; }
.alert-ok     { background: rgba(46, 212, 122, .09); border-color: rgba(46, 212, 122, .35); color: #8bf0bd; }
.alert-erro   { background: rgba(255, 77, 94, .09);  border-color: rgba(255, 77, 94, .35);  color: #ff9ba4; }
.alert-info   { background: rgba(248, 148, 4, .08);  border-color: rgba(248, 148, 4, .32);  color: var(--brand-soft); }
.alert-warn   { background: rgba(255, 197, 61, .09); border-color: rgba(255, 197, 61, .35); color: #ffdd94; }
.text-danger  { color: var(--danger); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); }

/* ------------------------------------------------------------ copiar link */
.copybox { display: flex; gap: .5rem; align-items: stretch; }
.copybox input { font-family: var(--mono); font-size: .82rem; background: #0d0f16; color: var(--brand); }

/* --------------------------------------------------------------- uploads */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2.25rem 1.25rem; text-align: center; color: var(--ink-2);
  transition: border-color .15s ease, background .15s ease; cursor: pointer;
}
.dropzone:hover, .dropzone.hot { border-color: var(--brand); background: rgba(248, 148, 4, .06); }
.dropzone strong { color: var(--ink); }

.up-item { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line-soft); }
.up-item:last-child { border-bottom: 0; }
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.up-state { font-size: .8rem; color: var(--ink-3); min-width: 92px; text-align: right; }
.up-state.ok { color: var(--ok); }
.up-state.err { color: var(--danger); }

.bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .09); overflow: hidden; width: 160px; flex: none; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-soft)); transition: width .2s ease; }

/* --------------------------------------------------------- area publica */
.pub { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.seal {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .5rem .8rem; border-radius: 999px;
  border: 1px solid rgba(248, 148, 4, .32); background: rgba(248, 148, 4, .07);
}
.seal:hover { text-decoration: none; border-color: var(--brand); }
.seal svg { width: 22px; height: 22px; flex: none; }
.seal .t { font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: var(--brand); }
.seal .s { font-size: .68rem; color: var(--ink-3); }

.file-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--line-soft); }
.file-row:last-of-type { border-bottom: 0; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: .78rem; color: var(--ink-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lock-icon { width: 54px; height: 54px; margin: 0 auto 1rem; display: block; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.fact .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.fact .v { font-weight: 600; margin-top: .15rem; }

.footer { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 2rem 1rem; }
.footer a { color: var(--ink-2); }

/* ------------------------------------------------------------------ auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 1.75rem; }
.h-sm { font-size: 1.25rem; }

/* --------------------------------------------------------------- utilidades */
.hr { height: 1px; background: var(--line-soft); margin: 1.5rem 0; border: 0; }
.gap { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.center-x { justify-content: center; }
details.box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; margin-top: 1rem; }
details.box summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
details.box[open] summary { margin-bottom: .75rem; }
code.key {
  font-family: var(--mono); background: #0d0f16; padding: .15rem .4rem;
  border-radius: 5px; color: var(--brand); font-size: .85em; word-break: break-all;
}
ol.steps { margin: .5rem 0 0; padding-left: 1.2rem; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; overflow-x: auto; }
  .sidebar .nav { flex-direction: row; }
  .sidebar .nav .sep { display: none; }
  .push-bottom { margin-top: 0; }
  .content { padding: 1.15rem; }
  .topbar { padding: .85rem 1.15rem; }
  .w-search { width: 100%; }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .btn { display: none !important; }
}
