/* ================================================
   Tu Proceso Legal — Estilos
   Tema: Azul noche + Dorado institucional
   ================================================ */

:root {
  --bg:          #070c18;
  --bg2:         #0b1425;
  --card:        rgba(255, 255, 255, 0.04);
  --border:      rgba(192, 157, 60, 0.2);
  --gold:        #c09d3c;
  --gold-l:      #ddb94e;
  --gold-dim:    rgba(192, 157, 60, 0.13);
  --text:        #e6d9c0;
  --muted:       #7a8fa8;
  --dim:         #3a4a5e;
  --error:       rgba(180, 50, 50, 0.12);
  --error-border:rgba(180, 50, 50, 0.3);
  --error-text:  #f0a0a0;
  --user-bg:     rgba(20, 50, 85, 0.85);
  --user-border: rgba(60, 110, 160, 0.4);
  --r:           14px;
  --serif:       'Bodoni Moda', Didot, Georgia, serif;
  --sans:        'Inter', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilidades ──────────────────────────────── */
.hidden { display: none !important; }
.accent { color: var(--gold); }

/* El chat comienza oculto; JS añade .active para mostrarlo */
#appRoot { display: none; }
#appRoot.active { display: flex; }

/* ── Layout ──────────────────────────────────── */
.tpl-root {
  flex-direction: column;
  height: 100dvh;
  background: linear-gradient(160deg, #070c18 0%, #0c1830 55%, #080f20 100%);
  overflow: hidden;
  position: relative;
}

.tpl-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 10% 60%, rgba(192, 157, 60, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(20, 60, 120, 0.10) 0%, transparent 45%);
}

/* ── Header ──────────────────────────────────── */
.tpl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(5, 10, 20, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.tpl-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tpl-logo {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tpl-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
}

.tpl-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.tpl-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-top: 3px;
}

.tpl-flag { font-size: 22px; }

.tpl-back-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.tpl-back-btn:hover {
  background: var(--gold-dim);
  border-color: rgba(192, 157, 60, 0.45);
  color: var(--text);
}

/* ── Main ────────────────────────────────────── */
.tpl-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  scroll-behavior: smooth;
}

/* ── Bienvenida ──────────────────────────────── */
.tpl-welcome {
  text-align: center;
  padding: 48px 16px 32px;
}

.tpl-welcome-icon { width: 110px; height: 110px; margin: 0 auto 18px; }
.tpl-welcome-icon img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }

.tpl-welcome-h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.tpl-welcome-p {
  color: var(--muted);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto 10px;
}

.tpl-disclaimer {
  font-size: 12px;
  color: var(--dim);
  font-style: italic;
  max-width: 440px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.tpl-sug-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.tpl-suggestions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 560px;
  margin: 0 auto;
}

.tpl-sug-btn {
  background: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 18px;
  color: #c4b080;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: background 0.18s, border-color 0.18s;
  line-height: 1.4;
}

.tpl-sug-btn:hover {
  background: rgba(192, 157, 60, 0.2);
  border-color: rgba(192, 157, 60, 0.45);
}

/* ── Mensajes ────────────────────────────────── */
.tpl-row {
  display: flex;
  margin-bottom: 16px;
  animation: fadeUp 0.28s ease;
  will-change: opacity, transform;
}

.tpl-row.user      { justify-content: flex-end; }
.tpl-row.assistant { justify-content: flex-start; }

.tpl-avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
  margin-top: 2px;
  overflow: hidden;
}
.tpl-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
}

.tpl-bubble {
  max-width: 76%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
  border-radius: var(--r);
}

.tpl-bubble.user {
  background: var(--user-bg);
  border: 1px solid var(--user-border);
  border-radius: 18px 18px 4px 18px;
  color: #b8d4f0;
}

.tpl-bubble.assistant {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px 18px 18px 18px;
  color: var(--text);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s;
}

/* Cursor pointer mientras el typewriter está activo */
.tpl-bubble.assistant[style*="pointer"] {
  border-color: rgba(192, 157, 60, 0.35);
}

/* Typing dots */
.tpl-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
}

.tpl-dots span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.6;
  will-change: transform, opacity;
}

.tpl-dots span:nth-child(1) { animation: bounce 1.2s ease-in-out 0.0s infinite; }
.tpl-dots span:nth-child(2) { animation: bounce 1.2s ease-in-out 0.2s infinite; }
.tpl-dots span:nth-child(3) { animation: bounce 1.2s ease-in-out 0.4s infinite; }

/* Error */
.tpl-error {
  background: var(--error);
  border: 1px solid var(--error-border);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--error-text);
  margin-bottom: 16px;
}

/* ── Footer / Input ──────────────────────────── */
.tpl-footer {
  padding: 12px 16px 10px;
  background: rgba(4, 9, 18, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.tpl-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 820px;
  margin: 0 auto;
}

.tpl-input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 820px;
  margin: 5px auto 0;
  padding: 0 2px;
  min-height: 18px;
}

.char-counter {
  font-size: 11px;
  color: var(--dim);
  transition: color 0.18s;
  font-variant-numeric: tabular-nums;
}

.char-counter.over-limit {
  color: var(--error-text);
  font-weight: 600;
}

.budget-indicator {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.01em;
}

.tpl-clear {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  color: var(--text);
}

.tpl-clear:hover { background: rgba(255, 255, 255, 0.07); }

.tpl-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.18s;
  max-height: 120px;
  overflow-y: auto;
}

.tpl-input::placeholder { color: var(--dim); }
.tpl-input:focus        { border-color: rgba(192, 157, 60, 0.55); }
.tpl-input:disabled     { opacity: 0.5; }
.tpl-input.over-limit   { border-color: rgba(220, 60, 60, 0.7); }

.tpl-send {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: none;
  background: var(--gold-dim);
  font-size: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  color: var(--muted);
  cursor: default;
}

.tpl-send.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  cursor: pointer;
  color: #2a1a00;
  box-shadow: 0 4px 16px rgba(192, 157, 60, 0.35);
}

.tpl-note {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  margin-top: 8px;
  letter-spacing: 0.03em;
}

/* ── Focus visible (accesibilidad teclado) ───── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Resetear outline para mouse */
:focus:not(:focus-visible) { outline: none; }

/* ── Animaciones ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.35; }
  40%           { transform: scale(1.2);  opacity: 1; }
}

/* ── Markdown dentro de burbujas ────────────────── */
.tpl-bubble.assistant h1,
.tpl-bubble.assistant h2,
.tpl-bubble.assistant h3 {
  font-family: var(--serif);
  color: var(--gold-l);
  margin: 14px 0 6px;
  line-height: 1.3;
}
.tpl-bubble.assistant h1 { font-size: 17px; }
.tpl-bubble.assistant h2 { font-size: 15px; }
.tpl-bubble.assistant h3 { font-size: 14px; }

.tpl-bubble.assistant p { margin: 0 0 10px; }
.tpl-bubble.assistant p:last-child { margin-bottom: 0; }

.tpl-bubble.assistant strong { color: #d4c090; font-weight: 600; }
.tpl-bubble.assistant em     { color: var(--muted); font-style: italic; }

.tpl-bubble.assistant ul,
.tpl-bubble.assistant ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}
.tpl-bubble.assistant li { margin-bottom: 4px; }

.tpl-bubble.assistant hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.tpl-bubble.assistant code {
  background: rgba(192, 157, 60, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: monospace;
}

.tpl-bubble.assistant blockquote {
  border-left: 3px solid var(--gold);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--muted);
  font-style: italic;
}

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192, 157, 60, 0.2); border-radius: 2px; }

/* ══ Landing Page ════════════════════════════════ */
.lp-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #070c18 0%, #0c1830 55%, #080f20 100%);
  color: var(--text);
  font-family: var(--sans);
  overflow-y: auto;
  z-index: 100;
  scroll-behavior: smooth;
}

.lp-page.lp-exit {
  animation: lpFadeOut 0.45s ease forwards;
}

@keyframes lpFadeOut {
  to { opacity: 0; pointer-events: none; }
}

/* Fondo flotante */
.lp-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.lp-float {
  position: absolute;
  font-size: 22px;
  opacity: 0.08;
  user-select: none;
  will-change: transform;
  animation: lpFloat var(--dur, 8s) ease-in-out var(--delay, 0s) infinite alternate;
}

.lp-float.is-text {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0.07;
}

@keyframes lpFloat {
  from { transform: translateY(0px) rotate(0deg); }
  to   { transform: translateY(-14px) rotate(4deg); }
}

/* ── Hero ─────────────────────────────────────── */
.lp-hero {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 80px;
  gap: 0;
}

.lp-hero-icon {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  flex-shrink: 0;
  will-change: box-shadow;
  animation: heroIconPulse 3s ease-in-out infinite;
}

.lp-hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes heroIconPulse {
  0%, 100% {
    box-shadow:
      0 0 0    8px rgba(192, 157, 60, 0.18),
      0 0 40px 16px rgba(192, 157, 60, 0.13),
      0 0 80px 24px rgba(192, 157, 60, 0.05);
  }
  50% {
    box-shadow:
      0 0 0    8px rgba(192, 157, 60, 0.28),
      0 0 55px 22px rgba(192, 157, 60, 0.20),
      0 0 110px 36px rgba(192, 157, 60, 0.08);
  }
}

.lp-hero-h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  line-height: 1.15;
}

.lp-hero-desc {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.lp-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 44px;
  max-width: 820px;
}

.lp-feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px 18px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex: 1 1 220px;
  max-width: 250px;
  text-align: center;
  line-height: 1.5;
}

.lp-feat-icon {
  display: block;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.lp-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: #1a1000;
  border: none;
  border-radius: 50px;
  padding: 16px 44px;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 30px rgba(192, 157, 60, 0.4);
  transition: transform 0.18s, box-shadow 0.18s;
  margin-bottom: 28px;
}

.lp-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(192, 157, 60, 0.55);
}

.lp-cta:active { transform: translateY(0); }

.lp-hero-note {
  font-size: 12px;
  color: var(--dim);
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.lp-scroll-hint {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.04em;
  will-change: transform, opacity;
  animation: scrollBounce 2s ease-in-out infinite;
  display: block;
}

.lp-chevron {
  font-size: 22px;
  line-height: 1;
  display: block;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(6px); opacity: 1; }
}

/* ── Info section ─────────────────────────────── */
.lp-info {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background: rgba(8, 15, 32, 0.6);
}

.lp-badges {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.lp-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 80px;
}

.lp-badge span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.lp-badge small {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1.3;
}

.lp-info-h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  margin-bottom: 14px;
  max-width: 600px;
}

.lp-info-sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 48px;
  max-width: 500px;
}

.lp-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin-bottom: 48px;
}

.lp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: left;
  flex: 1 1 240px;
  max-width: 280px;
  transition: border-color 0.2s, transform 0.2s;
}

.lp-card:hover {
  border-color: rgba(192, 157, 60, 0.4);
  transform: translateY(-4px);
}

.lp-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.lp-card h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.lp-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 600px) {
  .tpl-title      { font-size: 17px; }
  .tpl-sub        { display: none; }
  .tpl-welcome-h1 { font-size: 24px; }
  .tpl-bubble     { max-width: 88%; }
  .tpl-header     { padding: 10px 12px; }
  .tpl-logo       { width: 34px; height: 34px; }
  .tpl-back-btn   { font-size: 12px; padding: 6px 12px; }
  .tpl-input-meta { flex-direction: column; align-items: flex-start; gap: 2px; }

  .lp-hero        { padding: 48px 16px 64px; }
  .lp-hero-icon   { width: 130px; height: 130px; }
  .lp-feature     { max-width: 100%; flex-basis: 100%; }
  .lp-card        { max-width: 100%; }
  .lp-badges      { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-float, .lp-hero-icon, .lp-scroll-hint,
  .tpl-dots span, .tpl-row { animation: none; }
  .tpl-bubble, .lp-card, .tpl-back-btn,
  .tpl-sug-btn, .lp-cta { transition: none; }
}

/* ══ Header actions ══════════════════════════════ */
.tpl-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Botón "Iniciar sesión" ───────────────────── */
.tpl-auth-btn {
  background: transparent;
  border: 1px solid rgba(192, 157, 60, 0.45);
  border-radius: 20px;
  padding: 7px 16px;
  color: var(--gold);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s;
}

.tpl-auth-btn:hover {
  background: var(--gold-dim);
  border-color: rgba(192, 157, 60, 0.7);
}

/* ── Menú de usuario ─────────────────────────── */
.tpl-user-menu { position: relative; }

.tpl-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 6px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
}

.tpl-user-btn:hover { background: rgba(255, 255, 255, 0.08); }

.tpl-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: #1a1000;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tpl-user-chevron { font-size: 9px; color: var(--muted); }

.tpl-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0d1929;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 30;
  animation: fadeUp 0.15s ease;
}

.tpl-dropdown-item {
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  display: block;
}

.tpl-dropdown-item:hover { background: rgba(255, 255, 255, 0.07); }
.tpl-dropdown-item.danger { color: #f0a0a0; }
.tpl-dropdown-item.danger:hover { background: rgba(180, 50, 50, 0.12); }

/* ══ Modal de Autenticación ══════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.88);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  background: linear-gradient(145deg, #0d1929, #0b1425);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.auth-close:hover { background: rgba(255, 255, 255, 0.1); }

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
}

.auth-title {
  font-family: var(--serif);
  font-size: 21px;
  text-align: center;
  margin-bottom: 22px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  margin-bottom: -1px;
}

.auth-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.auth-panel { /* intentionally blank — hidden managed via .hidden */ }

.auth-field { margin-bottom: 14px; }

.auth-field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.18s;
}

.auth-field input:focus { border-color: rgba(192, 157, 60, 0.55); }
.auth-field input::placeholder { color: var(--dim); }

.auth-message {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
  /* Default: error */
  background: rgba(180, 50, 50, 0.12);
  border: 1px solid rgba(180, 50, 50, 0.3);
  color: #f0a0a0;
}

.auth-message[data-type="success"] {
  background: rgba(50, 180, 80, 0.12);
  border-color: rgba(50, 180, 80, 0.3);
  color: #90d090;
}

.auth-message[data-type="info"] {
  background: rgba(60, 120, 200, 0.12);
  border-color: rgba(60, 120, 200, 0.3);
  color: #90b8f0;
}

.auth-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  border: none;
  border-radius: 12px;
  padding: 13px;
  color: #1a1000;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s;
  margin-top: 4px;
}

.auth-submit:hover  { opacity: 0.9; transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.auth-forgot,
.auth-terms {
  text-align: center;
  font-size: 12px;
  color: var(--dim);
  margin-top: 14px;
  line-height: 1.5;
}

.auth-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: inherit;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth-link:hover { opacity: 0.8; }

/* ══ Cajón de Historial ══════════════════════════ */
.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: stretch;
}

.history-drawer {
  width: 300px;
  max-width: 82vw;
  height: 100%;
  background: #0b1628;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  animation: drawerIn 0.22s ease;
}

.history-backdrop {
  flex: 1;
  background: rgba(4, 9, 20, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

@keyframes drawerIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.history-header h3 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text);
}

.history-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.history-close:hover { background: rgba(255, 255, 255, 0.1); }

.history-new {
  margin: 12px 12px 8px;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--gold);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  flex-shrink: 0;
}

.history-new:hover { background: rgba(192, 157, 60, 0.2); }

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
}

.history-item {
  width: 100%;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item:hover { background: rgba(255, 255, 255, 0.05); }
.history-item.active { background: var(--gold-dim); }

.history-item-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-item-date {
  font-size: 11px;
  color: var(--dim);
}

.history-loading,
.history-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ══ Landing Nav Bar ══════════════════════════════ */
.lp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(7, 12, 24, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(192, 157, 60, 0.12);
}

.lp-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.lp-nav-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  mix-blend-mode: screen;
  border-radius: 6px;
}

.lp-nav-auth {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid rgba(192, 157, 60, 0.45);
  border-radius: 22px;
  padding: 8px 18px;
  color: var(--gold);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  white-space: nowrap;
}

.lp-nav-auth:hover {
  background: var(--gold-dim);
  border-color: rgba(192, 157, 60, 0.7);
  transform: translateY(-1px);
}

/* Compensar el nav fijo para que el hero no quede tapado */
.lp-hero { padding-top: 100px; }

/* ══ Google OAuth button ══════════════════════════ */
.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 11px 16px;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  margin-bottom: 4px;
}

.auth-google:hover {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.auth-google:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Divisor "o" ─────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 12px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ══ Botón "Continuar sin cuenta" ════════════════ */
.auth-skip-row {
  margin-top: 20px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(192, 157, 60, 0.12);
}

.auth-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
}

.auth-skip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.auth-skip-note {
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px;
  line-height: 1.5;
}

/* Mobile ajustes para las nuevas secciones */
@media (max-width: 600px) {
  .tpl-user-name  { display: none; }
  .tpl-auth-btn   { font-size: 12px; padding: 6px 12px; }
  .auth-modal     { padding: 28px 20px; }
  .history-drawer { width: 280px; }
  .lp-nav         { padding: 12px 16px; }
  .lp-nav-brand span { display: none; }
  .lp-hero        { padding-top: 90px; }
}

/* ══ Quiz Teaser Card ════════════════════════════ */
.lp-quiz-teaser {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid rgba(192, 157, 60, 0.35);
  border-radius: 16px;
  padding: 16px 22px;
  cursor: pointer;
  max-width: 480px;
  width: 100%;
  margin-bottom: 32px;
  transition: border-color 0.2s, background 0.2s, transform 0.18s;
  position: relative;
}

.lp-quiz-teaser:hover {
  border-color: rgba(192, 157, 60, 0.65);
  background: rgba(192, 157, 60, 0.07);
  transform: translateY(-2px);
}

.lp-quiz-badge {
  position: absolute;
  top: -10px;
  left: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: #1a1000;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 20px;
}

.lp-quiz-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.lp-quiz-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lp-quiz-text strong {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.lp-quiz-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.lp-quiz-arrow {
  font-size: 18px;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.18s;
}

.lp-quiz-teaser:hover .lp-quiz-arrow { transform: translateX(4px); }

/* ══ Quiz Overlay ════════════════════════════════ */
.quiz-root {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.88);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quiz-modal {
  background: linear-gradient(145deg, #0d1929, #0b1425);
  border: 1px solid var(--border);
  border-radius: 22px;
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  animation: modalIn 0.22s ease;
  overflow: hidden;
}

/* ── Header del quiz ─────────────────────────── */
.quiz-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.quiz-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quiz-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.quiz-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.quiz-close:hover { background: rgba(255, 255, 255, 0.1); }

.quiz-progress-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.quiz-step-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Cuerpo del quiz ─────────────────────────── */
.quiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 24px;
}

/* ── Pregunta ────────────────────────────────── */
.quiz-q-num {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.quiz-q-text {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 24px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
  line-height: 1.45;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.quiz-opt:hover:not(:disabled) {
  background: var(--gold-dim);
  border-color: rgba(192, 157, 60, 0.45);
  transform: translateX(4px);
}

.quiz-opt.selected {
  background: rgba(192, 157, 60, 0.18);
  border-color: rgba(192, 157, 60, 0.6);
  color: var(--gold-l);
}

.quiz-opt:disabled { cursor: default; }

/* ── Analizando ──────────────────────────────── */
.quiz-analyzing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 22px;
}

.quiz-analyzing-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid rgba(192, 157, 60, 0.15);
  border-top-color: var(--gold);
  animation: quizSpin 0.85s linear infinite;
}

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

.quiz-analyzing p {
  color: var(--muted);
  font-size: 14px;
}

/* ── Resultado ───────────────────────────────── */
.quiz-result-intro {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.quiz-podium {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.quiz-podium-card {
  flex: 1 1 140px;
  max-width: 160px;
  border-radius: 16px;
  padding: 18px 14px 16px;
  text-align: center;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.quiz-podium-card.gold {
  border-color: rgba(192, 157, 60, 0.6);
  background: rgba(192, 157, 60, 0.1);
  order: 2;
  padding-top: 24px;
  padding-bottom: 22px;
}

.quiz-podium-card.silver {
  border-color: rgba(180, 190, 200, 0.4);
  background: rgba(180, 190, 200, 0.06);
  order: 1;
}

.quiz-podium-card.bronze {
  border-color: rgba(180, 120, 60, 0.4);
  background: rgba(180, 120, 60, 0.06);
  order: 3;
}

.quiz-podium-pos {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gold   .quiz-podium-pos { color: var(--gold-l); }
.silver .quiz-podium-pos { color: #b0bec5; }
.bronze .quiz-podium-pos { color: #c87840; }

.quiz-podium-emoji { font-size: 28px; line-height: 1; }

.quiz-podium-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.quiz-podium-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Acciones ────────────────────────────────── */
.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.quiz-act {
  border-radius: 50px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
  border: none;
}

.quiz-act.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: #1a1000;
  box-shadow: 0 4px 18px rgba(192, 157, 60, 0.38);
}

.quiz-act.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(192, 157, 60, 0.5);
}

.quiz-act.secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.quiz-act.secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* ── Mobile quiz ─────────────────────────────── */
@media (max-width: 600px) {
  .quiz-modal       { border-radius: 18px 18px 0 0; max-height: 95dvh; margin-top: auto; }
  .quiz-root        { align-items: flex-end; padding: 0; }
  .quiz-q-text      { font-size: 17px; }
  .lp-quiz-teaser   { padding: 14px 16px; }
  .quiz-podium-card { max-width: 100%; flex-basis: 100%; }
  .quiz-podium      { flex-direction: column; align-items: stretch; }
  .quiz-podium-card.gold   { order: -1; }
  .quiz-podium-card.silver { order: 0; }
  .quiz-podium-card.bronze { order: 1; }
}

/* ══ JuriTools — Botón flotante + Sidebar ════════ */

/* Contenedor del botón flotante */
.jt-trigger {
  position: fixed;
  left: 18px;
  bottom: 130px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
}

/* Badge "✨ NUEVAS HERRAMIENTAS" */
.jt-new-badge {
  background: linear-gradient(135deg, #c09d3c 0%, #ddb94e 100%);
  color: #070c18;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow:
    0 0 8px  rgba(192, 157, 60, 0.5),
    0 0 20px rgba(192, 157, 60, 0.2);
  animation: jtBadgePulse 3s ease-in-out infinite;
  white-space: nowrap;
  cursor: pointer;
}

@keyframes jtBadgePulse {
  0%, 100% {
    box-shadow:
      0 0 8px  rgba(192, 157, 60, 0.45),
      0 0 18px rgba(192, 157, 60, 0.18);
  }
  50% {
    box-shadow:
      0 0 14px rgba(192, 157, 60, 0.7),
      0 0 28px rgba(192, 157, 60, 0.35);
    transform: scale(1.03);
  }
}

/* Botón principal JuriTools */
.jt-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(145deg, #0c1830 0%, #101f3c 100%);
  border: 1px solid rgba(192, 157, 60, 0.38);
  border-radius: 14px;
  padding: 10px 18px 10px 14px;
  color: var(--gold-l);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.45),
    0 0 0    1px rgba(192, 157, 60, 0.08);
  white-space: nowrap;
}

.jt-btn:hover {
  border-color: rgba(192, 157, 60, 0.62);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.55),
    0 0 18px  rgba(192, 157, 60, 0.22);
  transform: translateY(-2px);
}

.jt-btn:active { transform: translateY(0); }

.jt-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gold);
}

/* ── Overlay (fondo oscuro al abrir) ─────────── */
.jt-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: stretch;
  pointer-events: none;
}

.jt-overlay:not(.hidden) {
  pointer-events: auto;
}

/* ── Panel lateral ───────────────────────────── */
.jt-sidebar {
  width: 300px;
  max-width: 82vw;
  height: 100%;
  background: linear-gradient(160deg, #0b1628 0%, #0e1c38 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.jt-overlay:not(.hidden) .jt-sidebar {
  transform: translateX(0);
}

/* Backdrop (área oscura clickeable para cerrar) */
.jt-backdrop {
  flex: 1;
  background: rgba(4, 9, 20, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.jt-overlay:not(.hidden) .jt-backdrop {
  opacity: 1;
}

/* ── Header del sidebar ──────────────────────── */
.jt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.jt-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text);
}

.jt-title svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(192, 157, 60, 0.45));
}

.jt-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.jt-close:hover { background: rgba(255, 255, 255, 0.1); }

/* ── Lista scrollable de herramientas ────────── */
.jt-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(192, 157, 60, 0.25) transparent;
}

.jt-list::-webkit-scrollbar            { width: 4px; }
.jt-list::-webkit-scrollbar-track      { background: transparent; }
.jt-list::-webkit-scrollbar-thumb      { background: rgba(192, 157, 60, 0.25); border-radius: 4px; }
.jt-list::-webkit-scrollbar-thumb:hover{ background: rgba(192, 157, 60, 0.45); }

/* ── Cards de herramientas ───────────────────── */
.jt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 13px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.jt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: radial-gradient(ellipse at 20% 60%, rgba(192, 157, 60, 0.07) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.jt-card:hover::after    { opacity: 1; }
.jt-card:hover {
  border-color: rgba(192, 157, 60, 0.42);
  box-shadow:
    0 0 0   1px rgba(192, 157, 60, 0.15),
    0 4px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Card activa (Descubre tu Rama — disponible) */
.jt-card-live {
  border-color: rgba(192, 157, 60, 0.28);
}

.jt-card-live:hover {
  border-color: rgba(192, 157, 60, 0.55);
  box-shadow:
    0 0 0   1px rgba(192, 157, 60, 0.22),
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(192, 157, 60, 0.12);
}

/* Icono de la herramienta */
.jt-card-icon {
  width: 38px;
  height: 38px;
  background: var(--gold-dim);
  border: 1px solid rgba(192, 157, 60, 0.22);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.jt-card-icon svg {
  width: 19px;
  height: 19px;
  color: var(--gold);
}

/* Texto de la card */
.jt-card-info {
  flex: 1;
  min-width: 0;
}

.jt-card-name {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jt-card-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* Flecha (herramientas activas) */
.jt-card-arrow {
  color: var(--gold);
  font-size: 16px;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.18s;
  flex-shrink: 0;
}

.jt-card:hover .jt-card-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Badge "Próximamente" */
.jt-soon-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(192, 157, 60, 0.1);
  border: 1px solid rgba(192, 157, 60, 0.22);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Responsive Mobile ───────────────────────── */
@media (max-width: 600px) {
  .jt-trigger {
    left: 12px;
    bottom: 110px;
  }

  .jt-sidebar {
    width: 80vw;
    max-width: 80vw;
  }

  .jt-btn {
    padding: 9px 14px 9px 12px;
    font-size: 12px;
  }
}


/* ════════════════════════════════════════════════
   BIBLIOTECA JURÍDICA — MODAL
   ════════════════════════════════════════════════ */

.bib-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(4, 8, 20, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: bibFadeIn 0.2s ease;
}
.bib-overlay.hidden { display: none; }

@keyframes bibFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bib-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  background: #0b1221;
  border-left: 1px solid rgba(192,157,60,0.15);
  border-right: 1px solid rgba(192,157,60,0.15);
  animation: bibSlideUp 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

@keyframes bibSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ───────────────────────────────────── */
.bib-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid rgba(192,157,60,0.18);
  background: rgba(192,157,60,0.04);
  flex-shrink: 0;
}

.bib-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #c09d3c;
  letter-spacing: 0.02em;
}

.bib-header-title svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bib-header-sub {
  font-size: 11px;
  font-weight: 400;
  color: #4a5e72;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 4px;
}

.bib-close {
  background: none;
  border: none;
  color: #4a5e72;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.bib-close:hover { color: #c09d3c; background: rgba(192,157,60,0.08); }

/* ── Buscador ─────────────────────────────────── */
.bib-search-wrap {
  position: relative;
  padding: 16px 22px 12px;
  flex-shrink: 0;
}

.bib-search-icon {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #4a5e72;
  pointer-events: none;
}

.bib-search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(192,157,60,0.2);
  border-radius: 12px;
  padding: 12px 44px 12px 44px;
  color: #e6d9c0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.bib-search-input::placeholder { color: #3a4e62; }
.bib-search-input:focus {
  border-color: rgba(192,157,60,0.5);
  background: rgba(255,255,255,0.06);
}

.bib-search-clear {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #4a5e72;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.bib-search-clear:hover { color: #c09d3c; }

/* ── Filtros ──────────────────────────────────── */
.bib-filters {
  display: flex;
  gap: 8px;
  padding: 0 22px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.bib-filters::-webkit-scrollbar { display: none; }

.bib-chip {
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(192,157,60,0.2);
  border-radius: 20px;
  color: #7a8fa8;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.bib-chip:hover {
  border-color: rgba(192,157,60,0.5);
  color: #c09d3c;
  background: rgba(192,157,60,0.07);
}
.bib-chip.active {
  background: rgba(192,157,60,0.15);
  border-color: rgba(192,157,60,0.6);
  color: #c09d3c;
  font-weight: 600;
}

/* ── Body / Resultados ────────────────────────── */
.bib-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(192,157,60,0.2) transparent;
}
.bib-body::-webkit-scrollbar { width: 4px; }
.bib-body::-webkit-scrollbar-track { background: transparent; }
.bib-body::-webkit-scrollbar-thumb {
  background: rgba(192,157,60,0.2);
  border-radius: 4px;
}

/* Estado vacío / sin resultados */
.bib-empty, .bib-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 12px;
  color: #3a4e62;
}
.bib-empty svg, .bib-no-results svg {
  width: 48px;
  height: 48px;
  opacity: 0.35;
}
.bib-empty p, .bib-no-results p {
  color: #5a7080;
  font-size: 14px;
  margin: 0;
}
.bib-empty span, .bib-no-results span {
  font-size: 12px;
  color: #3a4e62;
}

/* Loading */
.bib-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: #4a5e72;
  font-size: 14px;
}
.bib-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(192,157,60,0.15);
  border-top-color: #c09d3c;
  border-radius: 50%;
  animation: bibSpin 0.7s linear infinite;
}
@keyframes bibSpin {
  to { transform: rotate(360deg); }
}

/* Tarjeta de artículo */
.bib-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bib-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(192,157,60,0.12);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.2s, background 0.2s;
}
.bib-card:hover {
  border-color: rgba(192,157,60,0.3);
  background: rgba(192,157,60,0.04);
}

.bib-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bib-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c09d3c;
  background: rgba(192,157,60,0.12);
  border: 1px solid rgba(192,157,60,0.25);
  border-radius: 6px;
  padding: 3px 8px;
}

.bib-article-num {
  font-size: 12px;
  font-weight: 600;
  color: #ddb94e;
}

.bib-section {
  font-size: 11px;
  color: #4a5e72;
  flex: 1;
  text-align: right;
}

.bib-similarity {
  font-size: 10px;
  color: #3a4e62;
  margin-left: auto;
}

.bib-card-content {
  font-size: 13px;
  color: #8fa8bc;
  line-height: 1.7;
  margin: 0;
}

.bib-card-content.expanded {
  color: #b0c4d4;
}

.bib-toggle-btn {
  background: none;
  border: none;
  color: #c09d3c;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0 0;
  font-family: inherit;
  display: block;
  transition: color 0.15s;
}
.bib-toggle-btn:hover { color: #ddb94e; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 600px) {
  .bib-modal { max-width: 100%; }
  .bib-header { padding: 14px 16px 12px; }
  .bib-header-sub { display: none; }
  .bib-search-wrap { padding: 12px 16px 10px; }
  .bib-filters { padding: 0 16px 12px; }
  .bib-body { padding: 8px 16px 20px; }
  .bib-card { padding: 14px 16px; }
}

/* ── Biblioteca: contador y cargar más ────────── */
.bib-results-count {
  font-size: 11px;
  color: #3a4e62;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(192,157,60,0.08);
}

.bib-load-more {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: rgba(192,157,60,0.06);
  border: 1px solid rgba(192,157,60,0.2);
  border-radius: 10px;
  color: #c09d3c;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.bib-load-more:hover {
  background: rgba(192,157,60,0.12);
  border-color: rgba(192,157,60,0.4);
}
.bib-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Auth: panel recuperar contraseña ─────────── */
.auth-reset-info {
  font-size: 13px;
  color: #7a8fa8;
  margin: 0 0 20px;
  line-height: 1.6;
}
.auth-reset-info strong {
  color: #c09d3c;
}
