/* ============================================================
   Perfil de usuario — piezas propias del dominio (Gamifier 4.81.0)

   Los componentes genéricos (hero, tarjetas, KPI, tablas, tags,
   modales…) y las variables --aiq-* viven en aiq-ui.css, que se
   carga antes. Aquí solo queda lo específico del Perfil y de las
   fichas de usuario: KPI con nombre de dominio, estados de licencia,
   tarjetas de licencia, selector de idioma y banderas.
   ============================================================ */

/* ---------- KPI con nombre de dominio (alias de los colores genéricos) ---------- */
.aiq-kpi--tokens { --kpi-color: var(--aiq-gold); }
.aiq-kpi--players { --kpi-color: var(--aiq-blue); }
.aiq-kpi--space { --kpi-color: var(--aiq-purple); }
.aiq-kpi--licenses { --kpi-color: var(--aiq-green); }
.aiq-kpi--space .aiq-kpi__value { font-size: 30px; white-space: nowrap; }

/* ---------- Estados de licencia (barra apilada y donut) ---------- */
.aiq-c-vigente { background: var(--aiq-green); }
.aiq-c-sin_iniciar { background: var(--aiq-blue); }
.aiq-c-disponible { background: var(--aiq-purple); }
.aiq-c-caducada { background: #c3c8d6; }
.aiq-stroke-vigente { stroke: var(--aiq-green); }
.aiq-stroke-sin_iniciar { stroke: var(--aiq-blue); }
.aiq-stroke-disponible { stroke: var(--aiq-purple); }
.aiq-stroke-caducada { stroke: #c3c8d6; }

/* ---------- Tarjetas de licencia (Historial) ---------- */
.aiq-lic { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.aiq-lic__img { position: relative; height: 128px; background: var(--aiq-track) center/cover no-repeat; }
.aiq-lic__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(22, 27, 51, 0.65)); }
.aiq-lic__img .aiq-lic__badge { position: absolute; top: 12px; left: 12px; z-index: 1; }
.aiq-lic__img .aiq-lic__type { position: absolute; left: 14px; bottom: 10px; z-index: 1; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.aiq-lic__img--free { background: linear-gradient(135deg, var(--aiq-purple-soft), var(--aiq-blue-soft)); display: flex; align-items: center; justify-content: center; }
.aiq-lic__img--free::after { display: none; }
.aiq-lic__img--free i { font-size: 40px; color: var(--aiq-purple); opacity: 0.6; }
.aiq-lic__body { padding: 14px 18px 18px; }
.aiq-lic__title { font-weight: 800; font-size: 14px; display: block; margin-bottom: 8px; color: var(--aiq-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* .aiq-lic__dl y .aiq-licgd__dl: variantes de .aiq-dl (aiq-ui.css) que usan las plantillas del Perfil */
.aiq-lic__dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin: 0; }
.aiq-lic__dl dt { color: var(--aiq-muted); font-weight: 600; }
.aiq-lic__dl dd { margin: 0; text-align: right; font-weight: 700; color: var(--aiq-ink); }

.aiq-licgd__name { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.aiq-licgd__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin: 0 0 16px; }
.aiq-licgd__dl dt { color: var(--aiq-muted); font-weight: 600; }
.aiq-licgd__dl dd { margin: 0; font-weight: 700; }
.aiq-licgd__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Fichas de usuario / Game Designer ---------- */
.aiq-ficha .ui-select-container { max-width: 420px; }

/* ---------- SELECTOR DE IDIOMA (banderas) ---------- */
.aiq-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 26px;
  height: 19.5px;
  border-radius: 4px;
  background: var(--aiq-track) center/cover no-repeat;
  box-shadow: 0 0 0 1px rgba(22, 27, 51, 0.12), 0 2px 4px rgba(22, 27, 51, 0.12);
}
.aiq-flag--sm { width: 18px; height: 13.5px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.aiq-flag--none { display: inline-flex; align-items: center; justify-content: center; color: var(--aiq-muted); font-size: 12px; }
.aiq-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; margin-bottom: 6px; }
.aiq-lang {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid var(--aiq-line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--aiq-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.aiq-lang:hover { border-color: #c9d6f3; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22, 27, 51, 0.08); }
.aiq-lang:focus { outline: none; box-shadow: var(--aiq-focus); }
.aiq-lang.active { border-color: var(--aiq-blue); background: #f2f7ff; box-shadow: 0 6px 16px -6px rgba(68, 138, 255, 0.45); }
.aiq-lang__name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiq-lang__check { color: var(--aiq-blue); font-size: 14px; }
.aiq-lang--none .aiq-lang__name { color: var(--aiq-muted); font-weight: 600; }
.aiq-lang__code { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--aiq-muted); background: var(--aiq-neutral-soft); border-radius: 5px; padding: 1px 6px; }
.aiq-lang.active .aiq-lang__code { display: none; }

/* Campo del formulario que abre el modal */
.aiq-lang-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 1.5px solid var(--aiq-line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--aiq-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aiq-lang-field:hover { border-color: #c9d6f3; box-shadow: 0 4px 12px rgba(22, 27, 51, 0.08); }
.aiq-lang-field:focus { outline: none; border-color: var(--aiq-blue); box-shadow: 0 0 0 3px rgba(68, 138, 255, 0.2); }
.aiq-lang-field__name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiq-lang-field__action { flex: 0 0 auto; font-size: 12px; color: var(--aiq-blue); }
.aiq-lang-field__action i { margin-left: 4px; font-size: 10px; }

/* Modal de idioma (cabecera, cierre y cuerpo: .aiq-modal__* en aiq-ui.css) */
.aiq-lang-modal { color: var(--aiq-ink); }
.aiq-lang-modal .modal-dialog { max-width: 620px; margin-top: 8vh; }
.aiq-lang-modal .modal-content { border: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--aiq-shadow-pop); }
.aiq-lang-modal__search { position: relative; margin-bottom: 14px; }
.aiq-lang-modal__search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--aiq-muted); }
.aiq-lang-modal__search .form-control { padding-left: 38px; border-radius: 10px; height: 42px; }
.aiq-lang-modal .aiq-langs { margin-bottom: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.aiq-lang-modal .aiq-lang--none { width: 100%; border-style: dashed; }
.aiq-lang-modal__empty { text-align: center; padding: 18px 0 22px; color: var(--aiq-muted); font-size: 13px; }
.aiq-lang-modal__empty i { display: block; font-size: 22px; margin-bottom: 8px; color: var(--aiq-icon-empty); }
