/*
 * Solar explorer, after the Visser design system.
 *
 * The theme (Salient + child theme css/gform.css) puts a lot of !important on
 * buttons and form fields. Where the module differs, we only override inside
 * .solar-explorer.
 */

.solar-explorer {
  --solar-green: #00963E;
  --solar-green-hover: #007F34;
  --solar-lime: #AFCA00;
  --solar-heading: #000000;
  --solar-body: #1A1A1A;
  --solar-muted: #6B6B6B;
  --solar-border: #D4D4D4;
  --solar-grey: #EEEEEE;
  --solar-error: #D7403A;
  --solar-font: Hind, system-ui, sans-serif;
  --solar-shadow-panel: 0 4px 30px rgba(0, 0, 0, .05);
  --solar-shadow-card: 0 2px 10px rgba(0, 0, 0, .06);
  --solar-ease: cubic-bezier(.4, 0, .2, 1);
  --solar-panel-p: 48px;
  --solar-control-h: 48px;

  scroll-margin-top: 120px;
  padding: 96px 0;
  background: var(--solar-grey);
  color: var(--solar-body);
  font-family: var(--solar-font);
  font-size: 16px;
  line-height: 1.75;
}

.solar-explorer h2,
.solar-explorer h3,
.solar-explorer p {
  padding: 0;
  font-family: inherit;
  letter-spacing: normal;
}

.solar-explorer b {
  font-weight: 700;
  color: var(--solar-heading);
}

.solar-explorer [hidden],
.solar-explorer:not(.has-choice) .solar-if-choice,
.solar-explorer.has-choice .solar-if-no-choice {
  display: none !important;
}

.solar-nowrap {
  white-space: nowrap;
}

.solar-explorer__container {
  max-width: 1264px;
  margin: 0 auto;
  padding: 0 24px;
}

.solar-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--solar-green);
}

/* Salient sets headings in upper case via ".row .col h3"; these selectors weigh more */
.solar-explorer .solar-explorer__container .solar-explorer__title {
  max-width: 24ch;
  margin: 16px 0 24px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--solar-heading);
}

.solar-explorer__lead {
  max-width: 56ch;
  margin: 0 0 48px;
  font-size: 20px;
  line-height: 1.75;
}

.solar-explorer__lead--wide {
  max-width: 62ch;
}

.solar-panel {
  background: #FFFFFF;
  box-shadow: var(--solar-shadow-panel);
  padding: var(--solar-panel-p);
}

.solar-explorer .solar-explorer__container .solar-step {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  color: var(--solar-heading);
}

.solar-step span {
  color: var(--solar-green);
}

.solar-icon {
  display: flex;
  flex: none;
  color: var(--solar-green);
}

/*
 * Labels next to an icon: Hind sits high in its line height, so text appears
 * above the centre of the icon. text-box trims the line to cap height and
 * baseline, so flex/grid centres on the letters themselves.
 */
.solar-option__name,
.solar-meter__name,
.solar-meter__plus,
.solar-chip__name,
.solar-confirmation__name,
.solar-confirmation__plus {
  text-box: trim-both cap alphabetic;
}

@supports not (text-box: trim-both cap alphabetic) {
  .solar-option__name,
  .solar-meter__name,
  .solar-meter__plus,
  .solar-chip__name,
  .solar-confirmation__name,
  .solar-confirmation__plus {
    position: relative;
    top: .1em;
  }
}

/* Buttons: always a pill, bold, 14px. Salient sets padding with !important via
   ".ascend .container-wrap button[type=submit]"; only the module ID outweighs that. */
#verkenner .solar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px !important;
  border: 0 !important;
  border-radius: 999px !important;
  font: 700 14px/1 var(--solar-font) !important;
  letter-spacing: .01em;
  text-transform: none;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 250ms var(--solar-ease), color 250ms var(--solar-ease);
}

#verkenner .solar-btn--primary {
  background: var(--solar-green) !important;
  color: #FFFFFF !important;
}

#verkenner .solar-btn--primary:hover {
  background: var(--solar-green-hover) !important;
}

#verkenner .solar-btn--ghost {
  background: transparent !important;
  color: var(--solar-green) !important;
  box-shadow: inset 0 0 0 1px var(--solar-green);
}

#verkenner .solar-btn--ghost:hover {
  background: var(--solar-green) !important;
  color: #FFFFFF !important;
}

#verkenner .solar-btn:focus-visible {
  outline: 2px solid var(--solar-green);
  outline-offset: 2px;
}

/* Input fields like the TextField in the design system: 16px, 48px high.
   The child theme (css/gform.css) sets font-size: 1.2rem !important on text fields. */
.solar-explorer input.solar-code__input,
.solar-explorer .gform_wrapper .ginput_container input[type=text],
.solar-explorer .gform_wrapper .ginput_container input[type=email],
.solar-explorer .gform_wrapper .ginput_container input[type=tel] {
  width: 100%;
  height: var(--solar-control-h);
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--solar-border) !important;
  background-color: #FFFFFF;
  font: 400 16px/1.5 var(--solar-font) !important;
  color: var(--solar-body) !important;
  transition: box-shadow 250ms var(--solar-ease);
}

.solar-explorer input.solar-code__input:hover,
.solar-explorer .gform_wrapper .ginput_container input:hover {
  box-shadow: inset 0 0 0 1px #8C8C8C !important;
}

.solar-explorer input.solar-code__input:focus,
.solar-explorer .gform_wrapper .ginput_container input:focus {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--solar-green) !important;
}

.solar-explorer input.solar-code__input::placeholder,
.solar-explorer .gform_wrapper .ginput_container input::placeholder {
  color: var(--solar-muted);
  opacity: 1;
}

/* Code modal on the personal page (templates/code-modal.php) */
html:has(.solar-modal[open]) {
  overflow: hidden;
}

.solar-modal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--solar-body);
  overflow: auto;
}

.solar-modal::backdrop {
  background: rgba(0, 0, 0, .55);
}

/* Without JavaScript the dialog is not modal; show it as an overlay anyway */
.solar-modal[open]:not(:modal) {
  position: fixed;
  inset: 0;
  z-index: 100000;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
}

.solar-modal__panel {
  padding: 48px;
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

.solar-explorer .solar-explorer__container .solar-modal__title {
  margin: 16px 0 12px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--solar-heading);
}

.solar-modal__lead {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
}

.solar-modal__link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  color: var(--solar-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.solar-modal__link:hover {
  color: var(--solar-green-hover);
}

.solar-modal .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.solar-code__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.solar-explorer input.solar-code__input {
  flex: 1 1 180px;
  width: auto;
  font-weight: 600 !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.solar-explorer input.solar-code__input::placeholder {
  letter-spacing: .12em;
}

#verkenner .solar-code__row .solar-btn {
  height: var(--solar-control-h);
  margin: 0;
}

.solar-code__error {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--solar-error);
}

.solar-code__error a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Step 1 */
.solar-explorer__step1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 48px;
  align-items: start;
  margin-bottom: 32px;
}

.solar-explorer__step1 > div > .solar-btn {
  margin-top: 32px;
}

.solar-hint {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--solar-green);
}

.solar-hint .solar-icon {
  color: inherit;
}

.solar-options {
  display: flex;
  flex-direction: column;
}

.solar-explorer .solar-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--solar-border);
  border-radius: 0 !important;
  background: none;
  box-shadow: none;
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  cursor: pointer;
}

.solar-explorer .solar-option:focus-visible {
  outline: 2px solid var(--solar-green);
  outline-offset: 2px;
}

.solar-option__name {
  flex: 1;
  min-width: 0;
  font: 700 16px/1.35 var(--solar-font);
  color: var(--solar-heading);
  overflow-wrap: break-word;
}

.solar-option__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 116px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--solar-green);
  font: 700 14px/1.4 var(--solar-font);
  letter-spacing: .01em;
  color: #FFFFFF;
  transition: background 200ms var(--solar-ease);
}

[aria-pressed=true] > .solar-option__btn {
  background: var(--solar-green-hover);
}

/* On mobile a diamond as check mark, as in the design system */
.solar-option__check {
  display: none;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 4px 4px 0;
  border: 2px solid var(--solar-lime);
  transform: rotate(45deg);
  transition: background 200ms var(--solar-ease), border-color 200ms var(--solar-ease);
}

[aria-pressed=true] > .solar-option__check {
  background: var(--solar-green);
  border-color: var(--solar-green);
}

/* Meter */
.solar-meter {
  padding: 32px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--solar-border), var(--solar-shadow-card);
}

.solar-meter__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.solar-meter__label {
  font-weight: 600;
  line-height: 1.4;
  color: var(--solar-heading);
}

.solar-meter__pct {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--solar-green);
  white-space: nowrap;
}

.solar-meter__bar {
  height: 16px;
  background: var(--solar-grey);
  overflow: hidden;
}

.solar-meter__bar div {
  height: 100%;
  background: var(--solar-green);
  transition: width 400ms var(--solar-ease);
}

.solar-meter__text {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.solar-meter__list {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.solar-meter__option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--solar-border);
}

.solar-meter__name {
  min-width: 0;
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  color: var(--solar-heading);
}

.solar-meter__plus {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--solar-green);
  white-space: nowrap;
}

.solar-meter__description {
  grid-column: 2 / 4;
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.solar-meter__total {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--solar-border);
}

/* Step 2 */
.solar-explorer__step2 {
  scroll-margin-top: 120px;
  margin-top: 32px;
}

.solar-explorer .solar-explorer__step2 .solar-step {
  margin-bottom: 16px;
  font-size: 24px;
  line-height: 1.3;
}

.solar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-bottom: 24px;
}

.solar-chips__empty {
  font-size: 15px;
  line-height: 1.4;
  color: var(--solar-muted);
}

.solar-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--solar-heading);
}

.solar-explorer__note {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.7;
}

.solar-explorer__note a {
  color: var(--solar-green);
  white-space: nowrap;
}

.solar-explorer__disclaimer {
  max-width: 70ch;
  margin: 32px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--solar-muted);
}

/* Gravity Form in step 2: four fields side by side, the choice comes from step 1 */
.solar-explorer .gform_wrapper {
  margin: 0;
}

.solar-explorer .gform_wrapper .gform_fields {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)) !important;
  gap: 20px !important;
}

.solar-explorer .gform_wrapper .gfield {
  grid-column: auto !important;
}

.solar-explorer .gform_wrapper .gfield_required,
.solar-explorer .gform_wrapper .gfield--type-hidden,
.solar-explorer .gform_wrapper .solar-form__solutions,
.solar-explorer .gform_wrapper .gform_validation_container {
  display: none !important;
}

.solar-explorer .gform_wrapper .gfield_label {
  margin-bottom: 8px;
}

/* Small diamond for required fields, as on the rest of the site */
.solar-explorer .gform_wrapper .gfield_contains_required .ginput_container input {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13.454' height='13.454' viewBox='0 0 13.454 13.454'%3E%3Crect width='9.514' height='9.514' transform='translate(6.727) rotate(45)' fill='%23afca00'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
}

.solar-explorer .gform_wrapper .gform_footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
}

.solar-explorer .gform_wrapper .gform_footer input[type=submit],
.solar-explorer .gform_wrapper .gform_footer button {
  width: auto;
  margin: 0 !important;
  padding: 15px 28px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--solar-green) !important;
  font: 700 14px/1 var(--solar-font) !important;
  letter-spacing: .01em;
  text-transform: none;
  color: #FFFFFF !important;
  cursor: pointer;
}

.solar-explorer .gform_wrapper .gform_footer input[type=submit]:hover,
.solar-explorer .gform_wrapper .gform_footer button:hover {
  background: var(--solar-green-hover) !important;
}

.solar-form__note {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--solar-muted);
}

.solar-form__note::before {
  content: '';
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--solar-green);
  transform: rotate(45deg);
}

/* Confirmation after submitting */
.solar-confirmation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 32px;
  align-items: start;
}

.solar-explorer .solar-explorer__container .solar-confirmation__title {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  color: var(--solar-heading);
}

.solar-confirmation__option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--solar-border);
}

.solar-confirmation__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  line-height: 1.35;
  color: var(--solar-heading);
}

.solar-confirmation__plus {
  font-weight: 700;
  color: var(--solar-green);
}

.solar-confirmation__text {
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.7;
}

.solar-confirmation__details {
  margin: 0;
}

.solar-confirmation__details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--solar-border);
  font-size: 15px;
  line-height: 1.5;
}

.solar-confirmation__details dt {
  color: var(--solar-muted);
}

.solar-confirmation__details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--solar-heading);
  overflow-wrap: anywhere;
}

.solar-confirmation__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}

.solar-confirmation__tel {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--solar-green);
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .solar-explorer {
    --solar-panel-p: 24px;
    padding: 56px 0;
  }

  .solar-explorer__container {
    padding: 0 20px;
  }

  .solar-explorer .solar-explorer__container .solar-explorer__title {
    font-size: 24px;
  }

  .solar-explorer__lead {
    font-size: 17px;
    line-height: 1.7;
  }

  .solar-explorer .solar-explorer__container .solar-step {
    font-size: 19px;
  }

  .solar-hint {
    display: flex;
  }

  .solar-explorer .solar-option {
    gap: 12px;
    padding: 14px 0;
  }

  .solar-option__btn {
    display: none;
  }

  .solar-option__check {
    display: block;
  }

  .solar-meter {
    padding: 24px;
  }

  .solar-modal__panel {
    padding: 24px;
  }

  .solar-explorer .solar-explorer__container .solar-modal__title {
    font-size: 24px;
  }
}
