/**
 * @file
 * sHTG Webform component styles.
 */

/* ==========================================================================
   Card wrapper
   ========================================================================== */

.shtg-webform {
  width: 100%;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

.shtg-webform__intro {
  text-align: center;
  margin: 0 auto 50px;
}

.shtg-webform__intro .shtg-webform__headline p {
  margin: 0;
  color: #4f08b0;
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 28px;
}

.shtg-webform__intro .shtg-webform__headline p:first-line {
  font-weight: 700;
  text-transform: uppercase;
}

.shtg-webform__intro .shtg-webform__headline strong {
  font-weight: 700;
}

.shtg-webform__intro .shtg-webform__subheadline {
  margin: 12px 0 0;
  color: #1e1e1e;
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 28px;
}

/* Glow behind card — same as clinical-trial-results__drawer-wrapper */
.shtg-webform__form-wrapper {
  position: relative;
  max-width: 100%;
}

.shtg-webform__form-wrapper::before {
  content: '';
  position: absolute;
  inset: auto 0 -10px 0;
  height: 60px;
  bottom: -12px;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(184.26% 114.95% at 4.65% 92.47%, rgba(232, 153, 118, 0.77) 54.42%, rgba(126, 94, 201, 0.46) 78.37%, rgba(163, 140, 220, 0.77) 100%),
    radial-gradient(359.42% 134.35% at 25.21% 86.57%, #945DF2 0%, #A488E1 100%);
  transform: rotate(180deg);
  z-index: 0;
  pointer-events: none;
}

.shtg-webform__form {
  position: relative;
  z-index: 1;
  border: 2px solid #d8d8ff;
  border-radius: 26px;
  background: #fff;
  overflow: hidden;
}

/* ==========================================================================
   Desktop lifestyle image (left of form)
   ========================================================================== */

.shtg-webform__image-col {
  display: none;
}

.shtg-webform .webform-flex--container .form-type-checkbox {
  white-space: normal;
}

@media (min-width: 768px) {
  .shtg-webform {
    max-width: 1052px;
    overflow: visible;
    background: transparent;
    border-radius: 0;
  }

  .shtg-webform__layout {
    display: flex;
  }

  .shtg-webform__image-col {
    display: block;
    width: 128px;
    min-width: 128px;
    min-height: 100%;
    position: relative;
    height: auto;
  }

  .shtg-webform__image-col .shtg-webform__image {
    display: block;
    width: 193px;
    max-height: 449px;
    object-fit: contain;
    object-position: bottom left;
    position: absolute;
    top: -56px;
    max-width: unset;
    z-index: 10;
  }

  .shtg-webform__image-col .shtg-webform__portrayal {
    margin: 0;
    font-size: 10px;
    line-height: 1.3;
    color: #000;
    text-align: left;
    position: absolute;
    top: 355px;
    left: -21px;
    max-width: 64px;
  }

  .shtg-webform__form-wrapper {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ==========================================================================
   Content body padding
   ========================================================================== */

.shtg-webform form.webform-submission-form .area-required,
.shtg-webform form.webform-submission-form .webform-flexbox {
  padding-left: 40px;
  padding-right: 36px;
  box-sizing: border-box;
}

/* col-6/col-12 inside webform-flex: full width, no default bottom margin */
.shtg-webform form.webform-submission-form .webform-flex--container .col-6,
.shtg-webform form.webform-submission-form .webform-flex--container .col-12 {
  width: 100%;
  flex: 0 0 100%;
  margin-bottom: 0;
}

/* Second flexbox: email (2/3) + checkbox (1/3) */
.shtg-webform #edit-bottom-flexbox > .webform-flex:first-child,
.shtg-webform #edit-flexbox-02 > .webform-flex:first-child {
  flex: 0 0 66.666%;
}

.shtg-webform #edit-bottom-flexbox > .webform-flex:last-child,
.shtg-webform #edit-flexbox-02 > .webform-flex:last-child {
  flex: 0 0 33.333%;
}

/* Last flexbox: disclaimer (~3/4) + submit button (~1/4), pushed to edges */
.shtg-webform form.webform-submission-form #edit-flexbox-02 {
  justify-content: space-between;
  padding-bottom: 16px;
  align-items: center;
}

#edit-flexbox {
  margin-top: 5px;
}


.shtg-webform #edit-flexbox-02 > .webform-flex:last-child .webform-flex--container {
  width: fit-content;
  margin-left: auto;
}

/* ==========================================================================
   Required fields text
   ========================================================================== */

.shtg-webform form.webform-submission-form .required-warning {
  color: #000;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.333;
  letter-spacing: 0.007em;
  text-align: left;
  margin: 16px 0 8px;
}

.shtg-webform form.webform-submission-form .required-warning {
  margin-bottom: 0px !important;
}

.shtg-webform .webform-flexbox {
  margin-top: 15px;
  margin-bottom: 15px;
}

.shtg-webform form.webform-submission-form:has(.js-form-item.error) .required-warning {
  color: #FA7821;
  font-weight: 700;
}


/* ==========================================================================
   Field labels
   ========================================================================== */

.shtg-webform form.webform-submission-form .col-6 label,
.shtg-webform form.webform-submission-form .col-12 label {
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.571;
  letter-spacing: 0.006em;
  margin: 0;
}

.shtg-webform form.webform-submission-form .col-6 label::after,
.shtg-webform form.webform-submission-form .col-12 label::after {
  color: #000;
}

/* ==========================================================================
   Text and email inputs
   ========================================================================== */

.shtg-webform form.webform-submission-form .col-6 input,
.shtg-webform form.webform-submission-form .col-6 select,
.shtg-webform form.webform-submission-form .col-12 input:not([type="checkbox"]),
.shtg-webform form.webform-submission-form .col-12 select {
  background: #E9E9FF;
  border: 1px solid transparent;
  border-radius: 9px;
  height: 40px;
  font-size: 14px;
  line-height: 1.571;
  padding: 8px 12px;
  color: #000;
}

.shtg-webform form.webform-submission-form .col-6 input:focus,
.shtg-webform form.webform-submission-form .col-12 input:not([type="checkbox"]):focus {
  border: 2px solid #4f08b0;
  outline: none;
}

/* ==========================================================================
   Checkbox
   ========================================================================== */

.shtg-webform form.webform-submission-form .js-form-type-checkbox {
  margin-top: 28px;
  margin-bottom: 0;
  padding-left: 40px;
}

.shtg-webform form.webform-submission-form .js-form-type-checkbox input + label {
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.143;
  letter-spacing: 0.006em;
  padding: 2px 0 0 32px;
}

.shtg-webform form.webform-submission-form .js-form-type-checkbox input + label::before {
  /* background: rgba(255, 222, 201, 0.6); */
  border: 1px solid rgba(200, 180, 165, 0.8);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  top: 2px;
}

.shtg-webform form.webform-submission-form .js-form-type-checkbox input:checked + label::before {
  background: url('../../images/check-black.svg') no-repeat center/18px auto rgba(255, 222, 201, 0.8);
}


/* ==========================================================================
   Disclaimer text
   ========================================================================== */

.shtg-webform form.webform-submission-form .area-disclaimer {
  margin: 0;
}

.shtg-webform form.webform-submission-form .area-disclaimer p {
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.03em;
  color: #000;
  margin: 0;
  /* max-width: 524px; */
}

.shtg-webform form.webform-submission-form .area-disclaimer a {
  color: #4f08b0;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: -0.4px;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-skip-ink: none;
  text-decoration-thickness: auto;
  text-underline-offset: auto;
  text-underline-position: from-font;
}

/* ==========================================================================
   Submit button
   ========================================================================== */

.shtg-webform form.webform-submission-form .webform-actions .webform-button--submit {
  background: url('../../images/yellow-arrow.svg') no-repeat calc(100% - 20px) center / 16px 16px,
  linear-gradient(180deg, #4f08b0 4%, #21034a 100%);
  border-radius: 88px;
  border: 0;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.889;
  letter-spacing: 0.006em;
  padding: 6px 36px;
  height: 44px;
  min-width: 187px;
  width: auto;
  text-align: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: inline-block;
  margin: 0;
  transition: background 0.3s ease;
}

.shtg-webform form.webform-submission-form .webform-actions .webform-button--submit:hover {
  background: url('../../images/arrow-right-white.svg') no-repeat calc(100% - 20px) center / 16px 16px,
  linear-gradient(180deg, rgba(50, 5, 125, 1) 4%, rgba(18, 1, 40, 1) 100%);
}

.shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message--container .webform-confirmation__message p {
  font-size: 24px;
  line-height: 22px;
  color: #4f08b0;
}

.shtg-webform form.webform-submission-form 
.webform-confirmation 
.webform-confirmation__message--container 
.webform-confirmation__message p:nth-of-type(2) {
  font-size: 18px;
  line-height: 22px;
  color: #000000;  
}

.shtg-webform form.webform-submission-form 
.webform-confirmation 
.webform-confirmation__message br {
  display: none !important;
}
/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 767px) {
  .shtg-webform__intro {
    margin-bottom: 24px;
  }

  .shtg-webform__intro .shtg-webform__headline p {
    font-size: 16px;
    line-height: 1.3;
  }

  .shtg-webform__intro .shtg-webform__subheadline {
    font-size: 12px;
    line-height: 16px;
  }

  .shtg-webform form.webform-submission-form .js-form-type-checkbox {
    padding-left: 0px;
  }

  .shtg-webform__form {
    border-radius: 24px;
    border: none;
  } 

  .shtg-webform form.webform-submission-form .area-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px;
  }

  .shtg-webform form.webform-submission-form .area-required,
  .shtg-webform form.webform-submission-form .webform-flexbox {
    padding-left: 36px;
    padding-right: 36px;
  }

  .shtg-webform form.webform-submission-form .webform-actions .webform-button--submit {
    margin: 2rem auto 0;
  }

  .shtg-webform form.webform-submission-form .webform-actions {
    text-align: center;
  }

  .shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message--container {
    max-height: 386px !important;
  }

  .shtg-webform #edit-flexbox-02 > .webform-flex:last-child .webform-flex--container {
    margin-inline: auto;
  }

  .shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message {
    padding-left: 36px;
    padding-right: 36px;
  }

  #edit-flexbox {
    margin-top: 24px;
  }

  .shtg-webform .webform-flexbox {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .webform-flex:last-child {
    margin-top: 24px;
  }

  .shtg-webform form.webform-submission-form 
  .webform-confirmation 
  .webform-confirmation__message {
    max-width: 270px;
  }
  .shtg-webform form.webform-submission-form 
  .webform-confirmation 
  .webform-confirmation__message br {
    display: block !important;
  }
}

/* ==========================================================================
   Placeholder (shown in Canvas when no webform is placed)
   ========================================================================== */

.shtg-webform__placeholder {
  border: 2px dashed rgba(79, 8, 176, 0.3);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: #4f08b0;
  font-family: 'Poppins', sans-serif;
}

.shtg-webform__placeholder p {
  margin: 4px 0;
  font-size: 14px;
}

/* ==========================================================================
   Canvas Edit Mode
   ========================================================================== */

body.path-canvas .shtg-webform__form-wrapper {
  border: 2px dashed rgba(79, 8, 176, 0.15);
  border-radius: 12px;
  padding: 16px;
  min-height: 100px;
}


/*Confirmation*/
.shtg-webform form.webform-submission-form .webform-confirmation {
  min-height: 390px;
}

.shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message--container {
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: 359px;
}

.shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message {
  padding-top: unset;
  padding-bottom: unset;
  text-align: center;
}
.shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message p {
  color: #000;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 28px;
}
.shtg-webform form.webform-submission-form .webform-confirmation .webform-confirmation__message h2 {
  font-weight: 700;
}
