/**
 * Registration questions on the add to cart form and the answers table.
 *
 * Scoped to .registration-questions / .registration-answers because the theme
 * resets every input (appearance: none, padding: 10px 50px; see
 * gws_ficpi/_dev/css/_button.scss), which hides radio buttons.
 * Colours: #133B62 primary dark, #0271AE primary, #F6F9FC light background.
 */

.registration-questions {
  flex: 1 1 100%;
  width: 100%;
  margin: 8px 0 16px;
  padding: 20px 24px 8px;
  background: #fff;
  border: 1px solid rgba(2, 113, 174, .25);
}

.registration-questions > fieldset,
.registration-questions > .form-item,
.registration-questions fieldset.form-type-textfield {
  margin: 0 0 18px !important;
  padding: 0;
  border: 0;
}

/* Question labels (text field label and radios legend). */
.registration-questions label:not(.form-check-label),
.registration-questions legend,
.registration-questions legend .fieldset-legend {
  display: block;
  width: auto;
  margin: 0 0 8px;
  padding: 0 !important;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #133B62;
}

.registration-questions .form-required::after {
  content: " *";
  color: #c0392b;
  background: none;
  width: auto;
  height: auto;
  margin: 0;
}

/* Text field. */
.registration-questions input.form-control[type="text"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 16px !important;
  font-size: 1rem;
  color: #133B62;
  background: #fff;
  border: 1px solid rgba(2, 113, 174, .45);
  border-radius: 0;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.registration-questions input.form-control[type="text"]:focus {
  border-color: #0271AE;
  box-shadow: 0 0 0 3px rgba(2, 113, 174, .15);
  outline: none;
}

/* Yes / No radios: two boxes styled like the variant select on the event
   page (50px, white, blue border, bold navy text); selected = filled blue. */
.registration-questions .fieldset-wrapper > .radio {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.registration-questions .form-check {
  position: relative;
  display: block;
  flex: 0 1 160px;
  min-width: 120px;
  margin: 0;
  padding: 0;
}

/* Native radio stays focusable/accessible but is visually hidden. */
.registration-questions input.form-check-input[type="radio"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0 !important;
  opacity: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.registration-questions .form-check-label {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 16px !important;
  font-size: 1rem;
  font-weight: 600;
  color: #133B62;
  background: #fff;
  border: 1px solid rgba(2, 113, 174, .45);
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}

.registration-questions .form-check-label:hover {
  border-color: #0271AE;
}

.registration-questions input.form-check-input[type="radio"]:checked + .form-check-label {
  color: #fff;
  background: #0271AE;
  border-color: #0271AE;
}

.registration-questions input.form-check-input[type="radio"]:focus-visible + .form-check-label {
  border-color: #0271AE;
  box-shadow: 0 0 0 3px rgba(2, 113, 174, .15);
}

/* Validation errors. */
.registration-questions .error,
.registration-questions .is-invalid,
.registration-questions input.error + .form-check-label,
.registration-questions .error input.form-check-input + .form-check-label {
  border-color: #c0392b !important;
}

/* Answers table: cart, checkout review, order pages. */
table.registration-answers {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: collapse;
  font-size: .95rem;
}

table.registration-answers caption {
  caption-side: top;
  padding: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
  color: #133B62;
}

table.registration-answers th,
table.registration-answers td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e3eaf1;
}

table.registration-answers th {
  font-weight: 600;
  color: #133B62;
  background: #f6f9fc;
}

/* Variant select + Add to cart button on event-type products (product page
   and event page), same look as the event page product block
   (node--event--full.html.twig inline styles). */
.gws-event-add-to-cart .field--name-purchased-entity fieldset {
  margin: 0 0 12px !important;
  padding: 0;
  border: 0;
}

.gws-event-add-to-cart select.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 48px 0 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #133B62;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%230271AE' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  border: 1px solid rgba(2, 113, 174, .45);
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.gws-event-add-to-cart select.form-select:hover {
  border-color: #0271AE;
}

.gws-event-add-to-cart select.form-select:focus {
  outline: 0;
  border-color: #0271AE;
  box-shadow: 0 0 0 3px rgba(2, 113, 174, .2);
}

.gws-event-add-to-cart .button--add-to-cart {
  height: 50px;
  min-width: 180px;
  padding: 0 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
