html {
  scrollbar-gutter: stable;
}

/* =========================================================
   PANTALLA DE INICIO / LOADER
   ========================================================= */

#starting-app {
  display: flex;
  justify-content: center;
  align-items: center;
}

#starting-app-title {
  font-size: clamp(0.875rem, 0.9vw, 1rem);
  font-weight: 500;
}

.loader-startup {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid #a06bb4;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  position: relative;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* =========================================================
   BUSCADOR
   ========================================================= */

#buscador-dorsales,
#buscador-licencias {
  display: none;
}

#app-info-subtitle .iconm-id-card {
  color: #9e9e9e !important;
}

#app-info-subtitle .iconm-search {
  position: relative;
  margin-left: -15px;
  top: 2px;
}

/* =========================================================
   FILTROS
   ========================================================= */

#filters {
  display: flex;
  align-items: flex-end;
  width: 100%;
  gap: 10px;
  box-sizing: border-box;
}

/* =========================================================
   CAMPOS DE FILTRO
   ========================================================= */

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.filter-field label {
  padding-left: 2px;

  color: #344054;

  font-size: clamp(0.8125rem, 0.95vw, 0.9375rem);
  font-weight: 600;

  line-height: 1;
}

/* =========================================================
   TIPOLOGÃA
   ========================================================= */

#tipologia-filter {
  flex: 0 0 225px;
  min-width: 0;
}

#tipologia {
  width: 100%;
  height: 43px;
  padding: 0 12px;

  border: 1px solid #d9dfe8;
  border-radius: 8px;

  background-color: #fff;
  color: #344054;

  font-family: "Outfit", sans-serif;
  font-size: clamp(1rem, 1vw, 1.125rem);

  cursor: pointer;
  outline: none;
  box-sizing: border-box;
}

#tipologia:focus {
  outline: none;
  border-color: #46286b;
}

/* =========================================================
   BUSCADOR DE NOMBRE
   ========================================================= */

#cercar-filter {
  flex: 1 1 auto;
  min-width: 0;
}

/* Contenedor del input + botÃ³n reset */

.search-input-wrapper {
  position: relative;

  width: 100%;
  height: 43px;

  border: 1px solid #d9dfe8;
  border-radius: 8px;

  background-color: #fff;

  box-sizing: border-box;
}

/* Input */

#cercar {
  width: 100%;
  height: 100%;

  padding: 0 42px 0 12px;

  border: none;
  outline: none;

  background-color: transparent;
  color: #344054;

  font-family: "Outfit", sans-serif;
  font-size: clamp(1rem, 1vw, 1.125rem);

  box-sizing: border-box;
}

#cercar::placeholder {
  color: #98a2b3;
  font-style: normal;
}

#cercar:focus {
  outline: none;
}

/* =========================================================
   BOTÃ“N RESET / X
   ========================================================= */

#reset-btn {
  display: none;

  position: absolute;
  top: 50%;
  right: 8px;

  transform: translateY(-50%);

  width: 28px;
  height: 28px;

  padding: 0;
  border: none;
  border-radius: 50%;

  background-color: transparent;
  color: #667085;

  cursor: pointer;

  align-items: center;
  justify-content: center;

  box-sizing: border-box;
}

#reset-btn:hover {
  background-color: #f2f4f7;
  color: #344054;
}

#reset-btn .iconm-times-circle {
  font-size: clamp(1rem, 1vw, 1.125rem);
  line-height: 1;
}

/* =========================================================
   BOTÃ“N BUSCAR
   ========================================================= */

#cercar-button {
  position: relative;

  flex: 0 0 130px;

  height: 43px;

  padding: 0 15px;

  border: none;
  border-radius: 8px;

  background-color: #667085;
  color: #fff;

  font-family: "Outfit", sans-serif;
  font-size: clamp(0.875rem, 0.85vw, 1rem);
  font-weight: 600;

  cursor: pointer;

  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background-color 0.15s ease;
}

#cercar-button:hover {
  background-color: #475467;
}

#cercar-button:active {
  transform: translateY(1px);
}

/* =========================================================
   BOTÃ“N BUSCAR - ESTADO LOADING
   ========================================================= */

#cercar-button.is-loading {
  cursor: wait;
  opacity: 0.9;
}

.cercar-button-text {
  display: block;
  white-space: nowrap;
}

.cercar-button-loader {
  display: none;

  position: absolute;

  width: 15px;
  height: 15px;

  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;

  animation: button-loader-spin 0.7s linear infinite;

  left: calc(50% + 35px);
  top: 50%;

  transform: translateY(-50%);
}

#cercar-button.is-loading .cercar-button-loader {
  display: block;
}

@keyframes button-loader-spin {
  0% {
    transform: translateY(-50%) rotate(0);
  }

  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* =========================================================
   CONTENEDOR DE RESULTADOS
   ========================================================= */

#buscador-licencias {
  position: relative;
}

#buscador-licencias-results {
  margin-top: 20px;
  position: relative;
}

#resultats-container {
  width: 100%;
  min-width: 0;
}

#resultados-buscador-licencias {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* =========================================================
   GRID DE CARDS
   ========================================================= */

#licenses-grid {
  width: 100%;
  min-width: 0;

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 10px;

  align-items: start;

  box-sizing: border-box;
}

/* =========================================================
   CARD
   ========================================================= */

.license-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;

  box-sizing: border-box;
  overflow: hidden;

  border: 1px solid #d0d5dd;
  border-radius: 6px;

  background-color: #fff;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* =========================================================
   CABECERA DE LA CARD
   ========================================================= */

.license-card-header {
  width: 100%;
  min-width: 0;

  padding: 10px 14px 11px;

  box-sizing: border-box;

  display: flex;
  flex-direction: column;

  align-items: flex-start;
  justify-content: center;

  background-color: #46286b;
  color: #fff;

  text-align: left;
}

/* =========================================================
   ETIQUETA "N. LLICÃˆNCIA"
   ========================================================= */

.license-header-label {
  width: 100%;

  color: rgba(255, 255, 255, 0.78);

  font-size: clamp(0.75rem, 0.8vw, 0.875rem);
  font-weight: 600;

  line-height: 1.2;

  letter-spacing: 0.06em;
}

/* =========================================================
   NÃšMERO DE LICENCIA
   ========================================================= */

.license-number {
  width: 100%;
  min-width: 0;

  margin-top: 3px;

  color: #fff;

  font-size: clamp(1.25rem, 1.55vw, 1.75rem);
  font-weight: 600;

  line-height: 1.2;

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   CUERPO DE LA CARD
   ========================================================= */

.license-card-body {
  width: 100%;
  min-width: 0;

  padding: 15px;

  box-sizing: border-box;

  display: flex;
  flex-direction: column;
}

/* =========================================================
   NOMBRE
   ========================================================= */

.license-person {
  width: 100%;
  min-width: 0;

  min-height: calc(2 * 1.25em);

  margin-bottom: 18px;

  color: #2f2f2f;

  font-size: clamp(1.125rem, 1.3vw, 1.375rem);
  font-weight: 600;

  line-height: 1.25;

  text-align: left;

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   SECCIONES
   ========================================================= */

.license-section {
  width: 100%;
  min-width: 0;

  margin-bottom: 14px;
}

/* =========================================================
   ETIQUETAS DE CAMPOS
   ========================================================= */

.license-section-label,
.license-field-label {
  margin-bottom: 4px;

  color: #667085;

  font-size: clamp(0.75rem, 0.8vw, 0.875rem);
  font-weight: 600;

  line-height: 1.2;

  letter-spacing: 0.05em;
}

/* =========================================================
   VALORES DE CAMPOS
   ========================================================= */

.license-section-value,
.license-field-value {
  min-width: 0;
  max-width: 100%;

  color: #344054;

  font-size: clamp(1rem, 1.05vw, 1.125rem);
  font-weight: 500;

  line-height: 1.3;

  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   PACK + CATEGORÃA
   ========================================================= */

.license-fields {
  width: 100%;
  min-width: 0;

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 15px;

  margin-bottom: 0;
}

.license-fields:has(+ .license-club) {
  margin-bottom: 16px;
}

.license-field-block {
  min-width: 0;
}

.license-field-value {
  min-height: calc(2 * 1.3em);
}

/* =========================================================
   CLUB
   ========================================================= */

.license-club {
  margin-bottom: 0;
}

.license-club .license-section-value {
  min-height: calc(2 * 1.3em);
}

/* =========================================================
   AVISO DE BÃšSQUEDA
   ========================================================= */

.aviso-search {
  width: 100%;

  margin-top: 15px;

  padding: 14px 16px;

  display: flex;
  align-items: center;

  gap: 12px;

  border: 1px solid #f0d58a;
  border-radius: 8px;

  background-color: #fff9e6;
  color: #664d03;

  font-size: clamp(0.875rem, 0.9vw, 1rem);
  line-height: 1.4;

  box-sizing: border-box;
}

/* Icono del aviso */

.aviso-search::before {
  content: "!";

  flex: 0 0 24px;

  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background-color: #f2c94c;
  color: #fff;

  font-size: clamp(0.8125rem, 0.8vw, 0.9375rem);
  font-weight: 700;

  line-height: 1;
}

/* =========================================================
   SIN RESULTADOS
   ========================================================= */

.no-results {
  width: 100%;

  border: 1px solid #f7c4a5;
  border-radius: 5px;

  background-color: #ffd166;

  padding: 10px;

  font-size: clamp(0.875rem, 0.9vw, 1rem);

  box-sizing: border-box;
}

/* =========================================================
   TABLET
   ========================================================= */

@media screen and (max-width: 968px) {
  #licenses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media screen and (max-width: 678px) {
  #filters {
    display: grid;

    grid-template-columns: 1fr;

    gap: 8px;
  }

  #tipologia-filter,
  #cercar-filter,
  #cercar-button {
    width: 100%;
    min-width: 0;

    flex: none;
  }

  #licenses-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .license-card-header {
    padding: 10px 14px 11px;
  }

  .license-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ---------------------------------------------------------
     En móvil no reservamos espacio para líneas adicionales
     --------------------------------------------------------- */

  .license-person {
    min-height: 0;
  }

  .license-field-value,
  .license-club .license-section-value {
    min-height: 0;
  }
}
