/* GenFor — tokens de tema y estilos base */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090f;
  --bg-card: #111118;
  --bg-card2: #16161f;
  --bg-card3: #1a1a25;
  --border: #2a2a3a;
  --border-acc: rgba(99, 102, 241, 0.4);
  --text: #eeeef5;
  --text-muted: #8888aa;
  --text-dim: #55556a;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.18);
  --accent2: #a78bfa;
  --accent3: #34d399;
  --gold: #fbbf24;
  --red: #f87171;
  --red-extreme: #ff3333;
  --orange: #fb923c;
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --purple: #c084fc;
  --bg-hover: #1a1a2e;
  --gradient-resistencia: linear-gradient(135deg, #111122, #14142a);
  --gradient-tipif: linear-gradient(135deg, #0d0d1c, #10101e);
  --logo-surface: #111118;
  --logo-dot-inner: #111118;
  --grid-line: rgba(99, 102, 241, 0.03);
  --orb-glow: rgba(99, 102, 241, 0.08);
  --btn-calcular-hover: #7c7ff5;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 32px -8px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-result: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 48px -12px rgba(0, 0, 0, 0.5);
  --placeholder-glow: rgba(99, 102, 241, 0.12);
  --placeholder-fade: rgba(99, 102, 241, 0.04);
  --placeholder-border: rgba(99, 102, 241, 0.14);
  --hairline: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f0f5;
  --bg-card: #ffffff;
  --bg-card2: #ececf4;
  --bg-card3: #e4e4ee;
  --border: #c8c8d8;
  --border-acc: rgba(79, 70, 229, 0.35);
  --text: #16161f;
  --text-muted: #4a4a62;
  --text-dim: #6a6a82;
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent2: #7c3aed;
  --accent3: #059669;
  --gold: #d97706;
  --red: #dc2626;
  --red-extreme: #b91c1c;
  --orange: #ea580c;
  --cyan: #0891b2;
  --blue: #2563eb;
  --purple: #9333ea;
  --bg-hover: #e8e8f2;
  --gradient-resistencia: linear-gradient(135deg, #eef0ff, #e4e7ff);
  --gradient-tipif: linear-gradient(135deg, #f4f4ff, #ececf8);
  --logo-surface: #ffffff;
  --logo-dot-inner: #ffffff;
  --grid-line: rgba(79, 70, 229, 0.06);
  --orb-glow: rgba(79, 70, 229, 0.1);
  --btn-calcular-hover: #6366f1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 4px 24px -4px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  --shadow-result: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 12px 40px -8px rgba(15, 23, 42, 0.1);
  --placeholder-glow: rgba(79, 70, 229, 0.08);
  --placeholder-fade: rgba(79, 70, 229, 0.03);
  --placeholder-border: rgba(79, 70, 229, 0.12);
  --hairline: rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--orb-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Controles cabecera: normas + tema */
.brand-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(99,102,241,0.07);
  height: 2rem;
  width: fit-content;
  font-size: 0.62rem;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  padding: 0.2rem 0.5rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  font-size: 0.8rem;
  color: var(--accent);
  border-color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-moon {
  display: inline;
}

.severidad-text {
  font-size: 0.875rem;
  font-weight: 700;
}

[data-theme="light"] select#select-exposicion {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236a6a82' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
