/**
 * Componente pentru paginile de servicii (importate din old.igm.gov.md, editabile in CKEditor).
 * Prefix igm-. Culorile vin din variabilele Bootstrap ale temei.
 *
 *   ol.igm-steps > li.igm-step > .igm-step__head + .igm-step__body   pasi numerotati
 *   div.igm-card                                                      caseta cu fundal
 *   ul.igm-list.igm-list--doc|link|time|info                          lista cu iconita
 */

/* Titlurile sectiunilor, doar pe paginile care folosesc componentele. */
.text-formatted:has(.igm-steps, .igm-card, .igm-list) > h2 {
  color: var(--bs-primary);
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--bs-primary-bg-subtle);
  text-align: left; /* tema justifica textul; la titluri lasa goluri mari */
}

.igm-card > h3:first-child,
.igm-step__head,
.igm-list {
  text-align: left;
}

/* Pasi */
.igm-steps {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  counter-reset: igm-step;
}

.igm-step {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) 1fr;
  gap: 1rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  counter-increment: igm-step;
}

.igm-step:first-child {
  padding-top: 0;
}

.igm-step:last-child {
  border-bottom: 0;
}

.igm-step__head {
  position: relative;
  min-height: 2.75rem;
  padding-left: 3.5rem;
  color: var(--bs-primary);
}

.igm-step__head::before {
  content: counter(igm-step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}

.igm-step__head p {
  margin: 0;
  line-height: 1.35;
}

.igm-step__head p + p {
  margin-top: 0.15rem;
  font-size: 0.9em;
}

.igm-step__body > :first-child {
  margin-top: 0;
}

.igm-step__body > :last-child {
  margin-bottom: 0;
}

/* Caseta */
.igm-card {
  margin: 1.5rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: var(--bs-border-radius);
  background: var(--bs-primary-bg-subtle);
}

.igm-card > h3:first-child {
  margin-top: 0;
  color: var(--bs-primary);
  font-size: 1.25rem;
}

.igm-card > :last-child {
  margin-bottom: 0;
}

/* Listele de acte ("1. ...", "2. ...") sunt paragrafe separate: spatiere compacta, ca in original. */
.igm-card p,
.igm-step__body p {
  margin-bottom: 0.5rem;
}

/* Buton de descarcare ("Descarca cererea") */
.igm-btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: var(--bs-border-radius);
  background: var(--bs-primary);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.igm-btn:hover,
.igm-btn:focus-visible {
  background: color-mix(in srgb, var(--bs-primary) 85%, #000);
  color: #fff;
}

/* Liste cu iconita (iconitele sunt masti SVG colorate cu culoarea primara) */
.igm-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.igm-list > li {
  position: relative;
  margin: 0.6rem 0;
  padding-left: 2.25rem;
}

.igm-list > li::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0;
  width: 1.35rem;
  height: 1.35rem;
  background-color: var(--bs-primary);
  -webkit-mask: var(--igm-icon) center / contain no-repeat;
  mask: var(--igm-icon) center / contain no-repeat;
}

.igm-list > li > p {
  margin: 0 0 0.25rem;
}

.igm-list > li > p:last-child {
  margin-bottom: 0;
}

.igm-list--doc {
  --igm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 2h8l6 6v14H6z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h6'/%3E%3C/svg%3E");
}

.igm-list--link {
  --igm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E");
}

.igm-list--time {
  --igm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.igm-list--info {
  --igm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E");
}

@media (max-width: 767.98px) {
  .igm-step {
    grid-template-columns: 1fr;
  }

  .igm-card {
    padding: 1.25rem;
  }

  /* Pe coloane inguste, textul justificat al temei lasa goluri mari intre cuvinte. */
  .igm-card,
  .igm-step__body {
    text-align: left;
  }
}

@media print {
  .igm-list > li::before {
    display: none;
  }

  .igm-list > li {
    padding-left: 0;
  }
}
