/* Variables */
:root {
  --base-duration: 1500ms;
  --color-1: #2c3e50;
  --color-2: #3498db;
  --color-3: #2ecc71;
  --color-4: #e50721;
  --sm: 320px;
  --med: 768px;
  --lg: 1024px;
}

@media (min-width: var(--sm)) {
  /* Styles pour le breakpoint sm */
}

@media (min-width: var(--med)) {
  /* Styles pour le breakpoint med */
}

@media (min-width: var(--lg)) {
  /* Styles pour le breakpoint lg */
}

*,
*:before,
*:after {
  box-sizing: border-box;
  outline: none;
}

.hide {
  display: none;
}

.button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 12.5rem;
  magrin: 0;
  padding: 1.5rem 3.125rem;
  background-color: var(--color-2);
  border: none;
  border-radius: 0.3125rem;
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.2);
  color: white;
  font-weight: 300;
  text-transform: uppercase;
  overflow: hidden;
}

.button:before {
  position: absolute;
  content: '';
  bottom: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: lighten(var(--color-3), 10%);
}

.button span {
  position: absolute;
  line-height: 0;
}

.button span i {
  transform-origin: center center;
}

.button span:nth-of-type(1) {
  top: 50%;
  transform: translateY(-50%);
}

.button span:nth-of-type(2) {
  top: 100%;
  transform: translateY(0%);
  font-size: 24px;
}

.button span:nth-of-type(3) {
  display: none;
}

.active-valid {
  background-color: var(--color-3);
}
.active-error {
  background-color: var(--color-4);
}

.active-valid:before {
  width: 100%;
  transition: width 3s linear;
}
.active-error:before {
  width: 100%;
  transition: width 3s linear;
}

.active-valid span:nth-of-type(1) {
  top: -100%;
  transform: translateY(-50%);
}
.active-error span:nth-of-type(1){
  top: -100%;
  transform: translateY(-50%);
}

.active-valid span:nth-of-type(2) {
  top: 50%;
  transform: translateY(-50%);
}
.active-error span:nth-of-type(2){
  top: 50%;
  transform: translateY(-50%);
}

.active-valid span:nth-of-type(2) i {
  animation: loading 3s linear infinite;
}
.active-error span:nth-of-type(2) i {
  animation: loading 3s linear infinite;
}
.active-valid span:nth-of-type(3) {
  display: none;
}

.active-error span:nth-of-type(3) {
  display: none;
}

.finished {
  background-color: #2ECC71FF;
}
.finished-error {
  background-color:var(--color-4);

}
.finished .submit {
  display: none;
}
.finished-error .submit {
  display: none;
}

.finished .loading {
  display: none;
}
.finished-error .loading {
  display: none;
}

.finished .check {
  display: block !important;
  font-size: 24px;
  animation: scale 0.5s linear;
}
.finished-error .check {
  display: block !important;
  font-size: 24px;
  animation: scale 0.5s linear;
}

.finished .check i {
  transform-origin: center center;
}

.finished-error .check i {
  transform-origin: center center;

}

@keyframes loading {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes scale {
  0% {
    transform: scale(10);
  }
  50% {
    transform: scale(0.2);
  }
  70% {
    transform: scale(1.2);
  }
  90% {
    transform: scale(0.7);
  }
  100% {
    transform: scale(1);
  }
}
