/*
 * Start-up loader of index.html, shown until Angular replaces <app-root>: a regulatory report whose rows fill in,
 * a control sweep ticks each row, then the report gets its seal. Pure CSS, loops every 2.4 s, the whole story within
 * its first 1.3 s: the loader often shows for less than a second. Still image under
 * prefers-reduced-motion. Colours: CIRCÉ green (circe-preset.ts primary 500 = #13663f) and the redesign's neutrals.
 */
.app-loading {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 10em;
}

.app-loading p {
  display: block;
  font-size: 1.17em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: normal;
}

.circe-report {
  --circe-green: #13663f;
  --circe-green-soft: #c4e4d0;
  --circe-line: #e1e6ec;
  --circe-cell: #d9dfe6;
  --circe-cycle: 2.4s;
  position: relative;
  box-sizing: border-box;
  width: 148px;
  height: 192px;
  padding: 18px 16px;
  border: 1px solid var(--circe-line);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 18px 40px -22px rgba(9, 50, 31, 0.45),
    0 2px 6px rgba(9, 50, 31, 0.06);
  overflow: hidden;
}

/* Corner fold */
.circe-report::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, transparent 50%, var(--circe-line) 50%);
  border-bottom-left-radius: 6px;
}

/* Title of the template and its code */
.circe-report__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--circe-line);
}

.circe-report__head span:first-child {
  width: 54px;
  height: 8px;
  border-radius: 4px;
  background: #3b4a59;
}

.circe-report__head span:last-child {
  width: 26px;
  height: 8px;
  border-radius: 4px;
  background: var(--circe-green-soft);
}

/* One row: label, two amounts, the control tick */
.circe-report__row {
  --row: 0;
  display: grid;
  grid-template-columns: 40px 1fr 1fr 12px;
  align-items: center;
  gap: 6px;
  height: 14px;
  margin-bottom: 10px;
}

.circe-report__row:nth-of-type(3) {
  --row: 1;
}
.circe-report__row:nth-of-type(4) {
  --row: 2;
}
.circe-report__row:nth-of-type(5) {
  --row: 3;
}

.circe-report__row span {
  height: 6px;
  border-radius: 3px;
  background: var(--circe-cell);
  transform: scaleX(0);
  transform-origin: right center;
  animation: circe-fill var(--circe-cycle) cubic-bezier(0.3, 0.7, 0.2, 1) infinite;
  animation-delay: calc(var(--row) * 60ms);
}

.circe-report__row span:first-child {
  transform-origin: left center;
  background: #b9c3cd;
}

.circe-report__row span:nth-child(3) {
  animation-delay: calc(var(--row) * 60ms + 40ms);
}

/* Control tick: a green dot with a white check */
.circe-report__row i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.2 6.2l1.8 1.8 3.8-4' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 12px no-repeat,
    var(--circe-green);
  transform: scale(0);
  animation: circe-tick var(--circe-cycle) ease-out infinite;
  animation-delay: calc(var(--row) * 295ms);
}

/* Control sweep */
.circe-report__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--circe-green) 20%, var(--circe-green) 80%, transparent);
  box-shadow: 0 0 12px 2px rgba(19, 102, 63, 0.35);
  opacity: 0;
  animation: circe-scan var(--circe-cycle) linear infinite;
}

/* Seal of the validated report */
.circe-report__seal {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--circe-green);
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34'%3E%3Cpath d='M10 17.5l4.6 4.6L24 12.6' fill='none' stroke='%2313663f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 34px no-repeat,
    rgba(196, 228, 208, 0.55);
  transform: scale(0) rotate(-25deg);
  animation: circe-seal var(--circe-cycle) cubic-bezier(0.3, 1.6, 0.5, 1) infinite;
}

.circe-report__label {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: #13663f;
  animation: circe-label var(--circe-cycle, 2.4s) ease-in-out infinite;
}

@keyframes circe-fill {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  10% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
    opacity: 1;
  }
  96%,
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes circe-tick {
  0%,
  2% {
    transform: scale(0);
    opacity: 1;
  }
  5% {
    transform: scale(1.25);
  }
  8% {
    transform: scale(1);
  }
  86% {
    transform: scale(1);
    opacity: 1;
  }
  96%,
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes circe-scan {
  0% {
    top: 52px;
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  45% {
    top: 140px;
    opacity: 1;
  }
  49%,
  100% {
    top: 140px;
    opacity: 0;
  }
}

@keyframes circe-seal {
  0%,
  46% {
    transform: scale(0) rotate(-25deg);
    opacity: 1;
  }
  54% {
    transform: scale(1) rotate(-8deg);
  }
  86% {
    transform: scale(1) rotate(-8deg);
    opacity: 1;
  }
  96%,
  100% {
    transform: scale(1) rotate(-8deg);
    opacity: 0;
  }
}

@keyframes circe-label {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .circe-report *,
  .circe-report__label {
    animation: none !important;
  }

  .circe-report__row span,
  .circe-report__row i {
    transform: none;
  }

  .circe-report__seal {
    transform: rotate(-8deg);
  }
}
