/* ── Variáveis ── */
:root {
  --fundo:          #0a0a0a;
  --fundo-card:     #111111;
  --fundo-form:     #0f0f0f;
  --dourado:        #C9A84C;
  --dourado-escuro: #A07830;
  --dourado-brilho: #e8c96a;
  --branco:         #f0ead8;
  --cinza:          #888880;
  --borda:          #2a2420;
  --borda-hover:    #C9A84C44;
  --vermelho:       #c0392b;
  --verde:          #2d7a4f;
  --radius:         10px;
  --sombra:         0 4px 24px #00000066;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--fundo);
  color: var(--branco);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--dourado); text-decoration: none; }
a:hover { color: var(--dourado-brilho); }

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: #070707;
  border-bottom: 1px solid var(--borda);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.navbar-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .85;
}
.navbar-title {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--dourado);
  text-transform: uppercase;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.navbar-nav a {
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--cinza);
  transition: color .2s;
}
.navbar-nav a:hover { color: var(--dourado); }
.navbar-nav .btn-logout {
  padding: .35rem .9rem;
  border: 1px solid var(--borda);
  border-radius: 6px;
  font-size: .78rem;
  color: var(--cinza);
  transition: border-color .2s, color .2s;
}
.navbar-nav .btn-logout:hover { border-color: var(--dourado); color: var(--dourado); }
.navbar-nav .navbar-user { font-size: .75rem; color: var(--dourado); font-weight: 600; letter-spacing: .06em; }

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 2.5rem;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--branco);
}
.page-header .subtitle {
  margin-top: .4rem;
  font-size: .9rem;
  color: var(--cinza);
}
.divider-dourado {
  height: 2px;
  width: 56px;
  background: linear-gradient(90deg, var(--dourado), transparent);
  margin: .75rem 0 0;
}

/* ── Flash messages ── */
.flash-list { list-style: none; margin-bottom: 1.5rem; }
.flash-list li {
  padding: .75rem 1.2rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: .5rem;
}
.flash-list li.erro { background: #3a0f0f; border-left: 3px solid var(--vermelho); color: #f5a0a0; }
.flash-list li.ok   { background: #0f2e1a; border-left: 3px solid var(--verde); color: #8de8b0; }

/* ── Cards de área ── */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.area-card {
  background: var(--fundo-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .25s, transform .2s, box-shadow .25s;
}
.area-card:hover {
  border-color: var(--dourado);
  transform: translateY(-3px);
  box-shadow: var(--sombra);
}
.area-card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.area-icone {
  font-size: 1.8rem;
  line-height: 1;
}
.area-nome {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--branco);
}
.tipos-lista { list-style: none; }
.tipos-lista li {
  border-top: 1px solid var(--borda);
}
.tipos-lista a {
  display: block;
  padding: .65rem .5rem;
  font-size: .84rem;
  color: var(--cinza);
  transition: color .2s, padding-left .2s;
}
.tipos-lista a:hover {
  color: var(--dourado);
  padding-left: .75rem;
}
.tipos-lista a::before {
  content: "→ ";
  opacity: 0;
  transition: opacity .15s;
}
.tipos-lista a:hover::before { opacity: 1; }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #2a1a0522 0%, #0a0a0a 70%);
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--fundo-card);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 2.5rem;
  box-shadow: 0 8px 48px #00000088;
}
.login-logo {
  display: block;
  height: 60px;
  margin: 0 auto 1.5rem;
  filter: brightness(0) invert(1);
  opacity: .8;
}
.login-titulo {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dourado);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .25rem;
}
.login-sub {
  text-align: center;
  font-size: .8rem;
  color: var(--cinza);
  margin-bottom: 2rem;
}

/* ── Formulário ── */
.form-section {
  margin-bottom: 2rem;
}
.form-section-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dourado);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--borda);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: .8rem;
  color: var(--cinza);
  letter-spacing: .03em;
}
label .obrig { color: var(--dourado); margin-left: .2rem; }
input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: #161412;
  border: 1px solid var(--borda);
  border-radius: 7px;
  padding: .6rem .85rem;
  color: var(--branco);
  font-size: .88rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--dourado);
  box-shadow: 0 0 0 3px #C9A84C22;
}
textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
select { appearance: none; cursor: pointer; }

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  border: none;
  transition: transform .15s, opacity .15s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--dourado), var(--dourado-escuro));
  color: #1a1200;
}
.btn-primary:hover {
  opacity: .92;
  box-shadow: 0 0 18px #C9A84C55;
  color: #1a1200;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--borda);
  color: var(--cinza);
}
.btn-secondary:hover { border-color: var(--dourado); color: var(--dourado); }
.btn-danger {
  background: transparent;
  border: 1px solid #5a1a1a;
  color: #c07070;
  font-size: .8rem;
  padding: .4rem .9rem;
}
.btn-danger:hover { border-color: var(--vermelho); color: var(--vermelho); }

/* ── Tipo badge ── */
.badge-area {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge-bancario      { color: #5aa8d8; }
.badge-previdenciario{ color: #5ad895; }
.badge-trabalhista   { color: #d8a05a; }
.badge-personalizado { color: #c09de8; }

/* ── Card resultado / painel ── */
.resultado-card {
  background: var(--fundo-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.resultado-card h2 {
  font-size: 1.1rem;
  color: var(--branco);
  margin-bottom: .5rem;
}
.resultado-card .meta-info {
  font-size: .82rem;
  color: var(--cinza);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.download-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: #161412;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  color: var(--branco);
  font-size: .85rem;
  font-weight: 600;
  transition: border-color .2s, transform .15s;
  cursor: pointer;
}
.download-btn:hover {
  border-color: var(--dourado);
  transform: translateY(-2px);
  color: var(--dourado);
}
.download-btn .ext {
  font-size: 1.6rem;
  line-height: 1;
}

/* ── Preview de texto ── */
.texto-preview {
  background: #080808;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  font-family: 'Georgia', serif;
  font-size: .88rem;
  line-height: 1.8;
  color: #d8d0bc;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
  margin-top: 1rem;
}

/* ── Tabela painel ── */
.painel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.painel-table th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cinza);
  border-bottom: 1px solid var(--borda);
}
.painel-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid #1a1a1a;
  color: #c8c0b0;
  vertical-align: middle;
}
.painel-table tr:hover td { background: #111111; }
.painel-table .acao-cell { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Spinner de geração ── */
.gerando-wrap {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
}
.spinner {
  width: 52px; height: 52px;
  border: 4px solid var(--borda);
  border-top-color: var(--dourado);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gerando-titulo {
  font-size: 1.1rem;
  color: var(--dourado);
  font-weight: 700;
}
.gerando-sub { font-size: .85rem; color: var(--cinza); }

/* ── Upload de documentos ── */
.upload-hint-card {
  background: #0d1a10;
  border: 1px solid #2e4a35;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.upload-hint-title {
  font-size: .82rem;
  font-weight: 700;
  color: #5ad895;
  margin-bottom: .6rem;
}
.upload-hint-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
}
.upload-hint-list li {
  font-size: .8rem;
  color: #88c8a0;
  padding: .2rem .7rem;
  background: #0a1a0d;
  border: 1px solid #2e4a35;
  border-radius: 20px;
}
.upload-zone {
  border: 2px dashed var(--borda);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--dourado);
  background: #C9A84C08;
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.upload-zone-text { font-size: .9rem; color: var(--branco); margin-bottom: .25rem; }
.upload-zone-sub  { font-size: .8rem; color: var(--cinza); margin-bottom: 1rem; }

.arquivo-lista { list-style: none; margin-top: .75rem; }
.arquivo-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .85rem;
  background: #111;
  border: 1px solid var(--borda);
  border-radius: 7px;
  margin-bottom: .4rem;
  font-size: .83rem;
}
.arquivo-icone { font-size: 1.1rem; flex-shrink: 0; }
.arquivo-nome  { flex: 1; color: var(--branco); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arquivo-tamanho { color: var(--cinza); flex-shrink: 0; }

/* ── Banner de análise pré-preenchida ── */
.analise-banner {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #1a1500;
  border: 1px solid #C9A84C55;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: .84rem;
  color: #e8c96a;
  line-height: 1.5;
}
.analise-banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .navbar-title { font-size: .75rem; }
  .container, .container--narrow { padding: 1.5rem 1rem 3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .areas-grid { grid-template-columns: 1fr; }
}
