/**
 * Multi Step Question Form - questionnaire page. Namespaced under .hmc-wizard so it
 * cannot leak into the rest of the theme.
 *
 * Sizes and colours are measured from the signed-off design at a 1920 viewport:
 * navy #506074, selected #3f3f3f, tile #f2f2f2, input border #bbb,
 * divider #d7d7d7; option bar 627x60, tile 285x103, button 299x60,
 * input/submit 576x60, progress dot 34 with a 2px connector.
 *
 * @author    Simul Digital
 * @copyright SINCE 2021 Simul Digital
 * @license   LICENSE.txt
 */

.hmc-wizard {
  --hmc-navy: var(--color-black-coral, #506074);
  --hmc-cream: var(--color-light-cream, #f2ebe4);
  --hmc-ink: var(--color-primary, #3f3f3f);
  --hmc-muted: #6b6b6b;
  --hmc-tile: #f2f2f2;
  --hmc-tile-hover: #e8e8e8;
  --hmc-border: #bbbbbb;
  --hmc-divider: #d7d7d7;

  padding: 0 0 90px;
  font-family: var(--base-font, "kumbh-sans-variable", sans-serif);
  color: var(--hmc-ink);
}

/* ---------------------------------------------------------------- Progress */

.hmc-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0 0 60px;
  padding: 0;
}

.hmc-progress[hidden] {
  display: none;
}

.hmc-progress__dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--hmc-navy);  
  color: var(--hmc-navy);
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}

/* Connector drawn by each dot except the first, so the step count can change. */
.hmc-progress__dot + .hmc-progress__dot {
  margin-left: 35px;
}

.hmc-progress__dot + .hmc-progress__dot::before {
  content: "";
  position: absolute;
  right: 100%;
  width: 37px;
  height: 2px;
  background: var(--hmc-navy);
}

.hmc-progress__dot.is-current,
.hmc-progress__dot.is-done {
  background: var(--hmc-navy);
  color: #fff;
}

.hmc-progress__tick {
  display: none;
}

.hmc-progress__dot.is-done .hmc-progress__num {
  display: none;
}

.hmc-progress__dot.is-done .hmc-progress__tick {
  display: block;
  font-size: 15px;
  line-height: 1;
}

/* ------------------------------------------------------------------- Steps */

.hmc-step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0; /* fieldset defaults to min-content, which breaks the grid */
}

.hmc-step[hidden] {
  display: none;
}

.hmc-step__title {
  display: block;
  width: 100%;
  float: none;
  font-family: var(--heading-font, "linotype-sabon", serif);
  font-size: 35px;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;  
  margin: 0;
  padding: 0;
  border: 0;
}

.hmc-step__subtitle {
  text-align: center;
  font-size: 17px;
  line-height: 1.5;
  color: #555;
  margin: 14px auto 0;
  max-width: 720px;
}

/* ----------------------------------------------------------------- Options */

.hmc-options {
  display: grid;
  margin: 74px auto 0;
}

/* Single choice: full-width stacked bars. */
.hmc-options--single {
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 627px;
}

/* Multiple choice: tile grid, which keeps eight options scannable. */
.hmc-options--multi {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 875px;
}

.hmc-option {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
  margin: 0;
  background: var(--hmc-tile);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
  color: var(--hmc-ink);  
}

.hmc-options--single .hmc-option {
  min-height: 60px;
}

.hmc-options--multi .hmc-option {
  min-height: 103px;
}

.hmc-option:hover {
  background: var(--hmc-ink);
  color: white;
}

.hmc-option__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hmc-option__label {
  pointer-events: none;
}

/* .is-selected is set by wizard.js. The :has() rule repeats it in its own
   block - an unsupported selector would invalidate a shared rule. */
.hmc-option.is-selected {
  background: var(--hmc-ink);
  border-color: var(--hmc-ink);
  color: #fff;
}

.hmc-option:has(.hmc-option__input:checked) {
  background: var(--hmc-ink);
  border-color: var(--hmc-ink);
  color: #fff;
}

.hmc-option:has(.hmc-option__input:focus-visible) {
  outline: 2px solid var(--hmc-navy);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ Fields */

.hmc-field {
  max-width: 576px;
  margin: 82px auto 0;
}

.hmc-field + .hmc-field {
  margin-top: 22px;
}

.hmc-field__label {
  display: block;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--hmc-ink);
  margin-bottom: 10px;
}

/* Own class, not .required - the theme injects a second asterisk via
   .required:after, which rendered "Your Email * *". */
.hmc-field__label .hmc-required {
  color: inherit;
}

.hmc-field__input {
  width: 100%;
  height: 60px;
  padding: 10px 18px;
  border: 1px solid var(--hmc-border);
  border-radius: 0;
  font-size: 16px;
  background: #fff;
  color: var(--hmc-ink);
}

.hmc-field__input::placeholder {
  color: #9a9a9a;
}

.hmc-field__input:focus {
  border-color: var(--hmc-navy);
  outline: none;
}

/* The email input is a fixed 60px; the message grows with its rows instead. */
.hmc-field__textarea {
  height: auto;
  min-height: 120px;
  padding: 16px 18px;
  line-height: 1.5;
  resize: vertical;
}

.hmc-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 576px;
  margin: 20px auto 0;
  font-size: 14px;
  color: var(--hmc-muted);
  font-weight: 400;
  cursor: pointer;
}

/* Off-screen rather than display:none, which some bots skip. */
.hmc-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------------------------------------------------------------- Navigation */

.hmc-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 77px auto 0;
}

.hmc-step--email .hmc-nav {
  margin-top: 39px;
}

.hmc-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 299px;  
  height: 60px;
  padding: 0 20px;
  border-radius: 0;  
  font-weight: 700;  
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer; 
  outline: none !important; 
}

@media screen and (max-width: 768px) {
  .hmc-btn{
    max-width: 193px;  
  }
}

.hmc-btn--primary {
  background: var(--hmc-navy);
  border: 1px solid var(--hmc-navy);
  color: #fff;
}

.hmc-btn--primary:hover {
  background: #3f4d5e;
  border-color: #3f4d5e;
}

.hmc-btn--ghost {
  background: #fff;
  border: 1px solid var(--hmc-navy);
  color: var(--hmc-navy);
}

.hmc-btn--ghost:hover {
  background: #f7f8f9;
}

/* Submit matches the input above it rather than the paired-button width.
   max-width has to be lifted too, or .hmc-btn's 299px cap clamps it. */
.hmc-btn--wide{
  width: 576px;
  max-width: 100%;
}

.hmc-btn[disabled],
.hmc-btn.is-loading {
  opacity: 0.6;
  cursor: default;
}

/* Text link used for "back to swatches" and the final step's back control. */
.hmc-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 54px auto 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--hmc-ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  outline: none !important;
}

.hmc-exit:hover {
  color: var(--hmc-navy);
  text-decoration: none;
}

.hmc-exit-row {
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------------------------ States */

.hmc-step__error {
  max-width: 627px;
  margin: 24px auto 0;
  text-align: center;
  font-size: 14px;
  color: #c0392b;
}

.hmc-step__error[hidden] {
  display: none;
}

.hmc-success {
  text-align: center;
  background: var(--hmc-cream);
  padding: 64px 24px;
  max-width: 875px;
  margin: 0 auto;
}

.hmc-success[hidden] {
  display: none;
}

.hmc-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--hmc-navy);
  color: var(--hmc-navy);
  margin-bottom: 20px;
}

.hmc-success__content {
  margin-bottom: 28px;
}

.hmc-success__content h1,
.hmc-success__content h2,
.hmc-success__content h3 {
  font-family: var(--heading-font, "linotype-sabon", serif);
  font-weight: 400;  
  margin: 0 0 12px;
  font-size: 36px;
}

/* -------------------------------------------------------------------- USPs */

.hmc-usps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 170px auto 0;
  max-width: 1800px;
}

.hmc-usps[hidden] {
  display: none;
}

.hmc-usp {
  text-align: center;
  padding: 0 24px;
}

.hmc-usp + .hmc-usp {
  border-left: 1px solid var(--hmc-divider);
}

.hmc-usp__icon {
  display: inline-flex;
  color: var(--hmc-ink);
  margin-bottom: 22px; 
}

@media screen and (min-width: 768px) {
  .hmc-usp__icon {
    height: 45px;
    align-items: center;
  }
}

@media screen and (max-width: 767px) {
  .hmc-usp__icon svg{
    max-height: 32px;
  }
}

.hmc-usp__title {
  font-family: var(--heading-font, "linotype-sabon", serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.3;  
  margin: 0 0 10px;
}

.hmc-usp__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--hmc-muted);
  margin: 0;
}

/* ------------------------------------------------------------------ Mobile */

@media (max-width: 991px) {
  .hmc-usps {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 0;
    margin-top: 90px;
  }

  .hmc-usp:nth-child(odd) {
    border-left: 0;
  }
}

@media (max-width: 767px) {
  .hmc-wizard {
    padding: 0 0 60px;
  }

  .hmc-progress {
    margin-bottom: 28px;
  }

  .hmc-step__title {
    font-size: 25px;
  }

  .hmc-step__subtitle {
    font-size: 14px;
    margin-top: 10px;
  }

  .hmc-options {
    margin-top: 32px;
  }

  .hmc-option {
    font-size: 14px;
  }

  .hmc-options--single {
    gap: 10px;
  }

  .hmc-options--single .hmc-option {
    min-height: 50px;
  }

  .hmc-options--multi {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hmc-options--multi .hmc-option {
    min-height: 60px;
  }

  .hmc-field {
    margin-top: 32px;
  }

  .hmc-field__input {
    height: 50px;
  }

  .hmc-field__textarea {
    height: auto;
    min-height: 100px;
  }

  .hmc-nav {
    margin-top: 40px;
    gap: 10px;
  }

  /* Half width each: Back and Next fill the row side by side, and a lone Next
     sits centred at the same size rather than stretching edge to edge. */
  .hmc-btn {    
    height: 52px;
  }

  /* The submit still matches the input above it. */
  .hmc-btn--wide{
    width: 100%;
  }

  .hmc-exit {
    margin-top: 30px;
  }

  .hmc-usps {
    grid-template-columns: 1fr;
  }

  .hmc-usp {
    border-left: 0 !important;
  }
}
