:root {
  --main-color: #0071bb;
  --dark-color: #2489d1;
  --step-color: #ced7e0;
  --step-size: 32px;
  --steps: 4;
  --progress-width: calc((var(--steps) - 1) / var(--steps) * 100%);
}

body#module-cm_services_booking-booktest {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  scroll-behavior: smooth;
}

h1 {
  text-align: center;
  margin-bottom: 16px;
}

h3 {
  margin-bottom: 16px;
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw + 1rem, 1.25rem);
}

label {
  display: inline-block;
  margin-bottom: 4px;
}

input,
textarea {
  outline-color: var(--main-color);
  border: 1px solid lightgray;
  padding: 8px 16px;
  border-radius: 4px;
  width: 100%;
  font-size: 1rem;
  text-align: start;
}

input[type="tel"] {
  direction: inherit;
}

textarea {
  resize: none;
}

button, .button{
  cursor: pointer;
  border: none;
  padding: 11px 16px;
  background-color: var(--main-color);
  color: #fff;
  font-size: 1rem;
  transition: 0.3s;
  width: 140px;
  margin-left: auto;
}

button:active,
button:hover, .button:hover {
  background-color: var(--dark-color);
}

button:disabled {
  opacity: 0.8;
}

button:focus {
  outline-color: #333;
}

button[type="submit"] {
  background-color: #333;
}

button[type="submit"]:hover,
button[type="submit"]:active {
  background-color: #444;
}

form {
  margin-block: auto;
}

/* form styles */

.form-wizard {
  background-color: #fff;
  margin: auto;
  padding: 0.8rem;
  border-radius: 8px;
  width: min(800px, 90%);
  box-shadow: 0 4px 16px rgba(0, 113, 187, 0.1);
}

.progress-container {
  position: relative;
}

.progress-container::before {
  content: "";
  height: 4px;
  width: var(--progress-width);
  background-color: var(--step-color);
  position: absolute;
  top: calc(var(--step-size) / 2);
  left: 50%;
  translate: -50% -50%;
}

.progress-container .progress {
  height: 4px;
  width: var(--progress-width);
  background-color: var(--main-color);
  position: absolute;
  top: calc(var(--step-size) / 2);
  left: 50%;
  translate: -50% -50%;
  z-index: 2;
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.3s;
}

/* if page is rtl adjust the transform origin */
html[dir="rtl"] .progress-container .progress {
  transform-origin: right;
}

.progress-container ol {
  list-style-type: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  counter-reset: step-number;
  position: relative;
  z-index: 3;
  padding-left: 0;
}

.progress-container li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--step-color);
  transition: 0.3s linear 0.3s;
  text-align: center;
  font-size: 0;
}

.progress-container li::before {
  counter-increment: step-number;
  content: counter(step-number);
  background-color: var(--step-color);
  width: var(--step-size);
  height: var(--step-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  transition: 0.3s linear 0.3s;
  font-size: 1rem;
}

@media (max-width: 991px) {
  .form-wizard {
    width: 100%;
  }

  label {
    text-align: left;
  }

  body#module-cm_services_booking-booktest {
    display: block;
  }

}

@media (min-width: 480px) {
  .progress-container li {
    font-size: 0.85rem;
    gap: 8px;
  }
}

.progress-container li:where(.done-step, .current) {
  color: #333;
  font-weight: 500;
}

.progress-container li.done-step::before {
  background-color: var(--main-color);
}

.progress-container li.current::before {
  background-color: var(--main-color);
  box-shadow: 0 0 0 3px rgba(0, 113, 187, 0.25);
}

.steps-container {
  display: flex;
  overflow: hidden;
}

.step {
  flex: 1 0 100%;
  padding: 24px 8px;
  opacity: 0;
  transition: opacity 0.3s;
  height: fit-content;
  display: grid;
  gap: 8px;
}

.step fieldset {
  border: 1px solid silver;
  margin-bottom: 2rem;
}

.step fieldset.p-2 {
  padding: 1.2rem !important;
}

.step legend {
  font-size: 1rem;
  width: auto;
}

.step input[type="radio"] {
  margin-right: 1rem;
  width: auto;
}

.step input[type=checkbox] {
  width: auto;
  margin-right: 7px;
  margin-top: 7px;
}

.step.current {
  opacity: 1;
}

.controls {
  /*display: flex;
  align-items: center;
  justify-content: space-between;*/
  gap: 16px;
  margin-top: 6px;
  padding-inline: 8px;
  text-align: right;
}

/*.controls button {
  flex: 1;
}*/

.completed {
  text-align: center;
}

.completed h3 {
  margin-bottom: 8px;
}

.completed svg {
  width: 100px;
  height: 100px;
  stroke: yellowgreen;
}

.completed:not([hidden]) ~ * {
  display: none;
}