/* Form's parents styling */
.wsf-form {
  display: flex;
  flex-direction: column;
  row-gap: var(--space-7);

  max-width: 60rem;
}

/* Form's progress bar styling */
.wsf-tabs {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  column-gap: var(--space-1);
}

.wsf-group-tab {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  column-gap: var(--space-1);

  transition: background-color 0.25s ease-out;
}

.wsf-group-tab::after {
  content: "";

  width: 1rem;
  height: 1px;

  background-color: var(--color-dark-gray);
}

.wsf-group-tab:last-child::after {
  content: none !important;
}

.wsf-group-tab a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  font-family: "Gotham", sans-serif;
  font-weight: 400;
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: var(--color-dark);
  text-decoration: none;

  width: 1.5rem;
  min-width: 1.5rem;
  height: 1.75rem;
  min-height: 1.75rem;

  background-color: var(--color-white);

  border-radius: 0.625rem;

  transition: color 0.25s ease-out,
              background-color 0.25s ease-out;
}

.wsf-group-tab.wsf-tab-active a {
  color: var(--color-white);

  background-color: var(--color-primary);
}

.wsf-group-tab:hover a {
  color: var(--color-white);

  background-color: var(--color-primary);
}

/* Form content styling */
.wsf-section {
  border: none !important;

  padding: 0 !important;
  margin: 0 !important;
}

.wsf-field-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: var(--space-5);

  margin-bottom: var(--space-7);
}

.wsf-field-wrapper > label {
  text-align: center;
}

/* Form radio and checkboxes styling */
.wsf-field-wrapper[data-type="radio"] [role="radiogroup"],
.wsf-field-wrapper[data-type="checkbox"] > div:has(> [data-row-checkbox]) {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-5);
  row-gap: var(--space-3);
}

/* Each option grows to fill space, wraps when needed */
[data-row-radio],
[data-row-checkbox] {
  flex: 1 1 auto;
  min-width: max-content;
  position: relative;
}

/* Visually hide the native input but keep it accessible */
[data-row-radio] > input,
[data-row-checkbox] > input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Style the label as the swatch */
[data-row-radio] > .wsf-label,
[data-row-checkbox] > .wsf-label {
  font-family: "Gotham", sans-serif;
  font-weight: 400;
  text-align: center;
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: 0;
  
  display: flex;
  justify-content: center;
  align-items: center;
  
  width: 100%;

  position: relative;

  isolation: isolate;
  
  padding: var(--space-4) var(--space-5);
  
  background-color: var(--color-white);
  
  border-radius: 0.625rem;
  
  user-select: none;
  cursor: pointer;
  
  transition: color 0.25s ease-out;
}

[data-row-radio] > .wsf-label::after,
[data-row-checkbox] > .wsf-label::after {
  content: "";

  position: absolute;
  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  opacity: 0;

  border-radius: 0.625rem;

  background: linear-gradient(78.03deg, #1E4D8C 3.61%, #020426 97.91%);

  z-index: -1;
  
  transition: opacity 0.25s ease-out;
}

/* Hover (only on unchecked) */
[data-row-radio] > input:not(:checked):hover + .wsf-label,
[data-row-checkbox] > input:not(:checked):hover + .wsf-label {
  color: var(--color-white);
}

[data-row-radio] > input:not(:checked):hover + .wsf-label::after,
[data-row-checkbox] > input:not(:checked):hover + .wsf-label::after {
  opacity: 1;
}

/* Selected state - the navy gradient */
[data-row-radio] > input:checked + .wsf-label,
[data-row-checkbox] > input:checked + .wsf-label {
  color: var(--color-white);
}

[data-row-radio] > input:checked + .wsf-label::after,
[data-row-checkbox] > input:checked + .wsf-label::after {
  opacity: 1;
}

/* Keyboard focus ring (accessibility) */
[data-row-radio] > input:focus-visible + .wsf-label,
[data-row-checkbox] > input:focus-visible + .wsf-label {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Inputs and textareas styling */
input.wsf-field, textarea.wsf-field {
  font-family: "Gotham", sans-serif;
  font-size: var(--text-sm);
  color: var(--color-dark);
  font-weight: 400;
  line-height: 1;
  
  background-color: var(--color-white);

  max-width: 33.75rem;
  width: 100%;
  
  border: none;
  border-radius: 0.625rem;

  padding: var(--space-4);

  resize: none;
}

input.wsf-field::placeholder, textarea.wsf-field::placeholder {
  font-family: "Gotham", sans-serif;
  font-size: var(--text-sm);
  color: #00000040;
  font-weight: 400;
  line-height: 1;
}

/* Invalid message styling */
.wsf-invalid-feedback {
  display: none;

  font-family: "Gotham", sans-serif;
  color: var(--color-danger);
  font-size: var(--text-sm);
  font-weight: 700;
}

.wsf-invalid-feedback[aria-hidden="false"] {
  display: block;
}

.wsf-field-wrapper:has(input[data-checkbox-min-max][aria-invalid="true"]) > .wsf-invalid-feedback:not([aria-hidden]) {
  display: block;
}

/* CTAs styling */
.wsf-section.cta-wrapper > div {
  display: flex;
  flex-direction: row;
  column-gap: var(--space-4);
  justify-content: center; 
}
