/*
| Modal del formulario de denuncias Ley Karin.
| Tokens del tema oscuro de layout/template_plataformas.php, limitados a #modal.
*/
#modal {
  --lk-main-bg: #111827;
  --lk-card-bg: #1e293b;
  --lk-card-border: rgba(255, 255, 255, .07);
  --lk-card-hover: #263347;
  --lk-text-primary: #f1f5f9;
  --lk-text-secondary: #94a3b8;
  --lk-text-muted: #64748b;
  --lk-accent: #009c9f;
  --lk-accent-soft: rgba(0, 156, 159, .14);
  --lk-input-bg: rgba(255, 255, 255, .06);
  --lk-input-border: rgba(255, 255, 255, .10);
  --lk-input-text: #e2e8f0;
  --lk-input-bg-focus: rgba(0, 156, 159, .08);
  --lk-section-line: rgba(255, 255, 255, .07);
  --lk-danger: #f87171;
  --lk-warning-bg: rgba(245, 158, 11, .1);
  --lk-warning-text: #fbbf24;
  font-family: 'Poppins', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--lk-text-primary);
}

#modal .fa { font-family: 'FontAwesome'; }

#modal .modal-dialog { max-width: 960px; }

/* Esta hoja solo se carga en la vista Ley Karin */
.modal-backdrop.show { background: #020617; opacity: .72; }

#modal .modal-content {
  background: var(--lk-main-bg);
  border: 1px solid var(--lk-card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------- Header ---------- */
#modal .lk-header {
  background: linear-gradient(135deg, #009c9f, #006e71);
  padding: 18px 24px 16px;
  position: relative;
}

#modal .lk-header-ley {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
  margin: 0 0 4px;
}

#modal .lk-header h5 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  padding-right: 36px;
}

#modal .lk-cerrar {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}

#modal .lk-cerrar:hover { background: rgba(255, 255, 255, .26); }

/* ---------- Indicador de pasos ---------- */
#modal .lk-pasos {
  display: flex;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  gap: 6px;
}

#modal .lk-paso {
  flex: 1;
  min-width: 0;
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  text-align: center;
}

#modal .lk-paso::before {
  content: '';
  display: block;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .22);
  margin-bottom: 6px;
  transition: background .2s;
}

#modal .lk-paso.completado::before { background: rgba(255, 255, 255, .7); }
#modal .lk-paso.activo::before { background: #fff; }
#modal .lk-paso.activo { color: #fff; }

#modal .lk-paso span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Cuerpo ---------- */
#modal .lk-body {
  padding: 20px 24px 8px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

#modal .lk-body::-webkit-scrollbar { width: 5px; }
#modal .lk-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 5px; }

#modal .lk-aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--lk-accent-soft);
  border: 1px solid rgba(0, 156, 159, .25);
  color: var(--lk-input-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .78rem;
  margin-bottom: 16px;
}

#modal .lk-aviso .fa { color: var(--lk-accent); font-size: 1rem; margin-top: 1px; }

#modal .lk-aviso--alerta {
  background: var(--lk-warning-bg);
  border-color: rgba(245, 158, 11, .25);
}

#modal .lk-aviso--alerta .fa { color: var(--lk-warning-text); }

#modal .tab-content > .tab-pane { display: none; }
#modal .tab-content > .tab-pane.active { display: block; animation: lkAparecer .2s ease; }

@keyframes lkAparecer {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

#modal .lk-seccion {
  background: var(--lk-card-bg);
  border: 1px solid var(--lk-card-border);
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 14px;
}

#modal .lk-seccion-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

#modal .lk-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--lk-accent-soft);
  color: var(--lk-accent);
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal .lk-seccion-head h6 {
  color: var(--lk-text-primary);
  font-size: .9rem;
  font-weight: 600;
  margin: 3px 0 0;
  line-height: 1.4;
}

#modal .lk-seccion-head p {
  color: var(--lk-text-secondary);
  font-size: .76rem;
  margin: 3px 0 0;
}

#modal .lk-requerido { color: var(--lk-danger); }

/* ---------- Campos ---------- */
#modal .lk-label {
  display: block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lk-text-muted);
  margin-bottom: 6px;
}

#modal .lk-input {
  display: block;
  width: 100%;
  background: var(--lk-input-bg);
  border: 1px solid var(--lk-input-border);
  border-radius: 8px;
  color: var(--lk-input-text);
  font-size: .85rem;
  padding: 9px 12px;
  margin-bottom: 12px;
  text-align: left;
  transition: border-color .15s, background .15s;
}

#modal textarea.lk-input { min-height: 110px; resize: vertical; }

#modal .lk-input:focus {
  outline: none;
  border-color: var(--lk-accent);
  background: var(--lk-input-bg-focus);
}

#modal .lk-input.is-invalid,
#modal .lk-opciones.is-invalid .lk-opcion-cuerpo { border-color: var(--lk-danger); }

/* ---------- Opciones (radio / checkbox como tarjetas) ---------- */
#modal .lk-opciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

#modal .lk-opciones--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
#modal .lk-opciones--compacta { grid-template-columns: repeat(auto-fit, minmax(110px, 160px)); }

#modal .lk-opcion { position: relative; margin: 0; cursor: pointer; display: block; }

#modal .lk-opcion input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

#modal .lk-opcion-cuerpo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 11px 14px;
  background: var(--lk-input-bg);
  border: 1px solid var(--lk-input-border);
  border-radius: 10px;
  color: var(--lk-input-text);
  font-size: .82rem;
  line-height: 1.45;
  transition: border-color .15s, background .15s;
}

#modal .lk-opcion-cuerpo small { display: block; color: var(--lk-text-secondary); font-size: .74rem; margin-top: 2px; }
#modal .lk-opcion-cuerpo strong { font-weight: 600; }

#modal .lk-opcion:hover .lk-opcion-cuerpo { background: var(--lk-card-hover); }

#modal .lk-marca {
  flex: 0 0 16px;
  height: 16px;
  margin-top: 2px;
  border: 2px solid var(--lk-text-muted);
  border-radius: 50%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

#modal .lk-opcion input[type="checkbox"] + .lk-opcion-cuerpo .lk-marca { border-radius: 4px; }

#modal .lk-opcion input:checked + .lk-opcion-cuerpo {
  border-color: var(--lk-accent);
  background: var(--lk-input-bg-focus);
}

#modal .lk-opcion input:checked + .lk-opcion-cuerpo .lk-marca {
  border-color: var(--lk-accent);
  background: var(--lk-accent);
  box-shadow: inset 0 0 0 3px var(--lk-card-bg);
}

#modal .lk-opcion input:focus-visible + .lk-opcion-cuerpo { outline: 2px solid var(--lk-accent); outline-offset: 2px; }

/* ---------- Adjuntos ---------- */
#modal .lk-archivos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

#modal .lk-archivo { position: relative; margin: 0; cursor: pointer; display: block; }

#modal .lk-archivo input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

#modal .lk-archivo-cuerpo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--lk-input-border);
  border-radius: 10px;
  background: var(--lk-input-bg);
  color: var(--lk-text-secondary);
  font-size: .8rem;
  transition: border-color .15s, color .15s;
}

#modal .lk-archivo-cuerpo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modal .lk-archivo-cuerpo .fa { color: var(--lk-accent); font-size: 1rem; }
#modal .lk-archivo:hover .lk-archivo-cuerpo,
#modal .lk-archivo input:focus-visible + .lk-archivo-cuerpo { border-color: var(--lk-accent); }
#modal .lk-archivo.con-archivo .lk-archivo-cuerpo { border-style: solid; border-color: var(--lk-accent); color: var(--lk-input-text); }

#modal .lk-recaptcha { display: flex; justify-content: center; margin: 4px 0 8px; }

/* ---------- Acciones ---------- */
#modal .lk-acciones {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--lk-section-line);
  margin-top: 6px;
}

#modal .lk-acciones .lk-btn:only-child { margin-left: auto; }

#modal .lk-btn {
  border: 0;
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity .15s, transform .15s, background .15s;
}

#modal .lk-btn .fa { margin: 0 4px; }

#modal .lk-btn--principal {
  background: var(--lk-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 156, 159, .3);
}

#modal .lk-btn--principal:hover { opacity: .86; transform: translateY(-1px); }
#modal .lk-btn--principal:disabled { opacity: .5; cursor: wait; transform: none; }

#modal .lk-btn--secundario {
  background: rgba(255, 255, 255, .06);
  color: var(--lk-text-secondary);
}

#modal .lk-btn--secundario:hover { background: rgba(255, 255, 255, .1); color: var(--lk-text-primary); }

/* ---------- Móvil ---------- */
@media (max-width: 575.98px) {
  #modal { padding: 0 !important; }
  #modal .modal-dialog { margin: 8px auto; max-width: calc(100% - 16px); }
  #modal .lk-header { padding: 16px 16px 14px; }
  #modal .lk-header h5 { font-size: .88rem; }
  #modal .lk-paso span { display: none; }
  #modal .lk-body { padding: 16px 12px 4px; max-height: calc(100vh - 190px); }
  #modal .lk-seccion { padding: 14px 14px 16px; }
  #modal .lk-btn { padding: 10px 14px; }
}
