/*
 * Identicore — Sistema de temas
 * ==============================
 * Tema oscuro (default) + tema claro via [data-theme="light"] en <html>.
 * Los modulos heredan via var(--*). Esta hoja se carga en dashboard,
 * modulo_frame, login, y se inyecta en los iframes de modulo_frame.
 */

/* ═══════════════ TEMA CLARO ═══════════════
 * Paleta azulada coordinada — bajo contraste, profesional.
 * Inspirada en GitHub light + tonos slate.
 */
html[data-theme="light"] {
  --bg:       #d8e1ec;   /* fondo azul-gris suave (no blanco) */
  --surface:  #e8eef6;   /* superficies de paneles */
  --surface2: #c9d4e2;   /* superficie secundaria, más profunda */
  --border:   #b3c0d2;   /* divisores principales */
  --border2:  #8d9db4;   /* bordes de inputs y elementos */

  --accent:   #1565a0;   /* azul saturado, no demasiado brillante */
  --accent2:  #2c7a5f;   /* verde forense calmado */
  --warn:     #9b5a00;   /* ámbar profundo */
  --danger:   #ad2e4d;   /* rojo coral apagado */

  --text:     #1f2a3d;   /* slate oscuro (no negro puro) */
  --text2:    #4a5a72;   /* slate medio */
  --text3:    #74849c;   /* slate claro para hints */

  --purple:   #6347b8;
  --orange:   #c2622a;
}

/* body y grid background */
html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

/* El grid de fondo (el ::before con líneas) en claro debe ser sutil */
html[data-theme="light"] body::before {
  opacity: 0.12 !important;
}

/* Watermarks y overlays oscuros en claro deben ajustarse */
html[data-theme="light"] .doc-watermark {
  color: rgba(200, 0, 0, 0.08) !important;
}

/* Inputs con bg oscuro forzado → usar var */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border2) !important;
}

/* Tags y chips que usan rgba con transparencia siguen funcionando */

/* ═══════════════ SWITCH UI ═══════════════ */
.theme-switch-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: var(--text2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #2a3f5f;
  border-radius: 20px;
  transition: background 0.2s;
}
.theme-switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.theme-switch input:checked + .slider {
  background: var(--accent);
}
.theme-switch input:checked + .slider::before {
  transform: translateX(18px);
}
