/* ============================================================
   theme.css — Portal Jurídico
   Shared resets, layout, typography, components
   Load AFTER theme-light.css (or any theme file)
   ============================================================ */

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

/* ── Base ───────────────────────────────────────────────────── */
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
}

/* ── Noise texture (dark mode only — theme-light.css disables) ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999;
}

/* ── Typography helpers ─────────────────────────────────────── */
.label-tag {
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}
h1 span { color: var(--accent); }

.subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-top: 0.4rem;
  line-height: 1.6;
}

.hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 0.35rem;
}

.section-label {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 1.2rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.8rem 0;
}

/* ── Nav ────────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
}
.nav-brand span { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.logout-btn {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--danger); }

/* ── Shell / layout ─────────────────────────────────────────── */
.shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem 2rem 1.5rem;
  position: relative;
  margin-bottom: 1.5rem;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.card:hover { border-color: var(--accent); }

/* ── Inputs ─────────────────────────────────────────────────── */
.field { margin-bottom: 1.3rem; }

label {
  display: block;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}
input:focus,
textarea:focus,
select:focus { border-color: var(--accent); }

textarea { resize: vertical; min-height: 80px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b70' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
  appearance: none;
}

input[list] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b70' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 0.75rem 1.4rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-full { width: 100%; font-size: 15px; padding: 0.85rem; margin-top: 0.5rem; }

.btn-ghost {
  padding: 0.65rem 1.2rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; gap: 0.75rem; margin-top: 0.5rem; flex-wrap: wrap; }

/* ── Messages ───────────────────────────────────────────────── */
.msg {
  font-size: 14px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  display: none;
}
.msg.error   { background: rgba(255,69,69,0.12); border: 1px solid var(--danger); color: var(--danger); }
.msg.success { background: rgba(232,255,71,0.10); border: 1px solid var(--accent); color: var(--accent); }
.msg.show    { display: block; }

/* ── Grid helpers ───────────────────────────────────────────── */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
