/**
 * @file
 * Registration form (Figma: Registration — Step 1–4, Submission
 * Confirmation): header band, stepper sidebar, cards, choice cards, option
 * chips, form fields, review summary, declarations and confirmation.
 */

/* ------------------------------------------------------------------ */
/* Header band.                                                         */
/* ------------------------------------------------------------------ */

.sra-form-header {
  position: relative;
  overflow: hidden;
  background: var(--sra-secondary-950);
  color: var(--sra-white);
}

.sra-form-header__glow {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.sra-form-header__glow--1 {
  top: calc(-220px - 180px);
  left: calc(-160px - 180px);
  width: calc(760px + 360px);
}

.sra-form-header__glow--2 {
  top: calc(-160px - 180px);
  left: calc(50% + 100px - 180px);
  width: calc(720px + 360px);
}

.sra-form-header__glow--3 {
  top: calc(120px - 180px);
  left: calc(50% - 300px - 180px);
  width: calc(640px + 360px);
}

.sra-form-header__nav,
.sra-form-header__intro {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}

.sra-form-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px var(--sra-gutter) 0;
  max-width: calc(1280px + 2 * var(--sra-gutter));
}

.sra-form-header__logo img {
  display: block;
  width: 204px;
  height: 46px;
  object-fit: contain;
}

[dir="rtl"] .sra-form-header__logo img {
  object-position: right;
}

.sra-form-header__actions {
  display: flex;
  gap: 12px;
}

.sra-button--ghost-dark {
  border: 1.5px solid var(--sra-white);
  color: var(--sra-white);
}

.sra-button--ghost-dark:hover,
.sra-button--ghost-dark:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.sra-form-header__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 56px var(--sra-gutter) 64px;
  max-width: calc(1280px + 2 * var(--sra-gutter));
}

.sra-form-header__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 803px;
}

.sra-form-header__chip {
  padding: 6px 20px;
  border-radius: var(--sra-radius-full);
  background: rgba(0, 147, 143, 0.14);
  color: var(--sra-primary-300);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.sra-form-header__title {
  color: var(--sra-white);
  font-size: 44px;
  font-weight: 700;
  line-height: 52px;
  letter-spacing: -0.02em;
}

.sra-form-header__lead {
  max-width: 622px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 28px;
}

/* Registration closed: no "Before you start" box, the lead runs wider. */
.sra-layout--form:has(.sra-closed) .sra-form-header__lead {
  max-width: none;
}

.sra-form-header__rules {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 14px;
  width: 440px;
  padding: 28px;
  border: 1px solid var(--sra-line-dark);
  border-radius: var(--sra-radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.sra-form-header__rules-title {
  color: var(--sra-primary-400);
  font-weight: 700;
}

.sra-form-header__rules ul {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sra-form-header__rules li {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ------------------------------------------------------------------ */
/* Layout: sidebar + form column.                                       */
/* ------------------------------------------------------------------ */

.sra-form-main {
  padding: 48px var(--sra-gutter) 96px;
  background: var(--sra-gray-50);
}

.sra-form-main__messages {
  max-width: 1280px;
  margin: 0 auto 20px;
}

.webform-submission-sra-registration-form {
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr);
  align-items: start;
  column-gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
}

.webform-submission-sra-registration-form > * {
  grid-column: 2;
  min-width: 0;
}

.webform-submission-sra-registration-form > .sra-form-sidebar {
  position: sticky;
  top: 24px;
  grid-row: 1 / span 20;
  grid-column: 1;
}

.webform-submission-sra-registration-form > .webform-wizard-pages-links {
  display: none;
}

.webform-submission-sra-registration-form > [data-webform-key] {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Sidebar.                                                             */
/* ------------------------------------------------------------------ */

.sra-form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 12px;
}

.sra-form-sidebar__card {
  padding: 24px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-lg);
  background: var(--sra-white);
}

.sra-form-sidebar__stepper {
  padding: 12px;
}

.sra-stepper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sra-stepper__step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: var(--sra-radius-md);
}

.sra-stepper__step.is-active {
  background: var(--sra-secondary-50, #f3f2f9);
}

/* Reset webform's progress-tracker library styles. */
.sra-stepper .progress-step::before,
.sra-stepper .progress-step::after,
.sra-stepper .progress-marker::before,
.sra-stepper .progress-marker::after {
  display: none !important;
  content: none !important;
}

.sra-stepper .progress-step,
.sra-stepper .progress-text {
  flex: none;
  margin: 0;
  padding: 0;
  text-align: start;
}

.sra-stepper .progress-step.sra-stepper__step {
  padding: 12px 14px 12px 12px;
}

.sra-stepper .progress-text {
  flex: 1 1 auto;
}

/* Two classes: beats webform's ".progress-step .progress-marker { color: #fff }". */
.sra-stepper .sra-stepper__marker {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #bcb9b6;
  border-radius: 50%;
  background: var(--sra-white);
  color: var(--sra-gray-500);
}

.sra-stepper .sra-stepper__step.is-active .sra-stepper__marker {
  border: 0;
  background: var(--sra-secondary-950);
  color: var(--sra-white);
}

.sra-stepper .sra-stepper__step.is-complete .sra-stepper__marker {
  border: 0;
  background: var(--sra-secondary-500);
}

.sra-stepper__step.is-complete [role="link"] {
  cursor: pointer;
}

.sra-stepper__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sra-stepper__title {
  color: var(--sra-gray-600);
  font-weight: 700;
}

.sra-stepper__step.is-active .sra-stepper__title,
.sra-stepper__step.is-complete .sra-stepper__title {
  color: var(--sra-secondary-950);
}

.sra-stepper__caption,
.sra-form-sidebar__text {
  color: var(--sra-gray-500);
  font-size: 14px;
  line-height: 20px;
}

.sra-form-sidebar__help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-color: var(--sra-primary-100);
  background: var(--sra-primary-50);
}

.sra-form-sidebar__help .sra-form-sidebar__text {
  color: var(--sra-gray-600);
}

.sra-form-sidebar__help-title {
  color: var(--sra-tertiary-950);
}

.sra-form-sidebar__email {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sra-form-sidebar__email a {
  color: var(--sra-primary-700);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  /* One line, left to right, in Arabic too. */
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.sra-copy {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

/* Figma: 16px copy icon, never squeezed by the address. */
.sra-copy img {
  flex: none;
  width: 16px;
  height: 16px;
}

/* "Copied" bubble above the copy button (js/registration-form.js). */
.sra-copy,
[data-sra-copy] {
  position: relative;
}

.sra-toast {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--sra-gray-800);
  color: var(--sra-white);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s, transform 0.15s;
}

/* Small arrow pointing at the button. */
.sra-toast::after {
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-top-color: var(--sra-gray-800);
  content: "";
  transform: translateX(-50%);
}

.sra-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sra-copy.is-copied {
  background: var(--sra-primary-100);
}

.sra-form-sidebar__words {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sra-form-sidebar__words-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

.sra-form-sidebar__words-count strong {
  color: var(--sra-tertiary-950);
  font-size: 22px;
  line-height: 30px;
}

.sra-form-sidebar__words.is-ok strong {
  color: var(--sra-primary-700);
}

.sra-form-sidebar__words.is-over strong {
  color: #b42318;
}

/* ------------------------------------------------------------------ */
/* Cards (webform_section).                                             */
/* ------------------------------------------------------------------ */

/* Spaced with margins, not flex gap: Webform's #states sets an inline
   display: block on cards it shows (e.g. Team members). */
.sra-form-card {
  display: block;
  margin: 0;
  padding: 40px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-lg);
  background: var(--sra-white);
}

.sra-form-card .webform-section-title {
  margin: 0 0 -18px;
  color: var(--sra-tertiary-950);
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
}

.sra-form-card > * + * {
  margin-top: 24px;
}

.sra-form-card > .webform-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sra-form-card > .webform-section-wrapper > .description,
.sra-form-note {
  color: var(--sra-gray-600);
}

.sra-form-note {
  margin: -8px 0 0;
}

/* ------------------------------------------------------------------ */
/* Form fields (Figma: Form Field).                                     */
/* ------------------------------------------------------------------ */

.sra-layout--form .form-item {
  margin: 0;
}

.sra-layout--form label,
.sra-layout--form legend,
.sra-layout--form .fieldset-legend {
  display: block;
  margin-bottom: 8px;
  color: var(--sra-tertiary-950);
  font-size: 14px;
  line-height: 20px;
}

.sra-layout--form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sra-layout--form legend {
  padding: 0;
}

.sra-layout--form .form-required::after,
.sra-layout--form .js-form-required::after {
  content: " *";
  color: #d92d20;
}

.sra-layout--form input[type="text"],
.sra-layout--form input[type="email"],
.sra-layout--form input[type="tel"],
.sra-layout--form select,
.sra-layout--form textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--sra-gray-100);
  border-radius: var(--sra-radius-sm);
  background: var(--sra-white);
  color: var(--sra-tertiary-950);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sra-layout--form textarea {
  min-height: 140px;
  resize: vertical;
}

.sra-layout--form select {
  padding-inline-end: 44px;
  background: var(--sra-white) url("../images/form/chevron.svg") right 16px center / 18px no-repeat;
  -webkit-appearance: none;
  appearance: none;
}

[dir="rtl"] .sra-layout--form select {
  background-position: left 16px center;
}

.sra-layout--form input::placeholder,
.sra-layout--form textarea::placeholder {
  color: var(--sra-gray-400);
}

.sra-layout--form input:focus,
.sra-layout--form select:focus,
.sra-layout--form textarea:focus {
  border-color: #177975;
  outline: 0;
  box-shadow: 0 0 0 1px #177975;
}

.sra-layout--form input.error,
.sra-layout--form textarea.error,
.sra-layout--form select.error {
  border-color: #d92d20;
  box-shadow: 0 0 0 0.5px #d92d20;
}

.sra-layout--form .form-item--error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

.sra-layout--form .form-item--error-message::before {
  flex: none;
  width: 16px;
  height: 16px;
  background: url("../images/form/error.svg") center / contain no-repeat;
  content: "";
}

.sra-layout--form .form-item--error-message strong {
  font-weight: 400;
}

.sra-layout--form .description,
.sra-layout--form .webform-element-description {
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

.sra-layout--form .js-form-item > .description,
.sra-layout--form .js-form-item > .webform-element-description {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

.sra-layout--form fieldset > .fieldset-wrapper > .description,
.sra-layout--form .js-form-item > .description:first-of-type:not(:last-child) {
  margin: 0 0 12px;
}

/* Word counters (webform text counter + our section counter). */
.sra-word-count,
.sra-layout--form .text-count-wrapper {
  flex: none;
  margin-inline-start: auto;
  color: var(--sra-gray-500);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.sra-layout--form .text-count-wrapper {
  float: inline-end;
  margin-top: 8px;
  margin-inline-start: 12px;
}

/* +974 prefix (inputs only; radios/fieldsets render "before" descriptions in
   a .field-prefix span, which stays a normal block). */
.sra-layout--form .fieldset-wrapper > .field-prefix {
  display: block;
  margin: 0 0 12px;
}

/* The prefix sits on the input (same grid cell), on its left: numbers read
   left to right in Arabic too. */
.sra-layout--form .js-form-item:not(fieldset):has(> .field-prefix) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.sra-layout--form .js-form-item:not(fieldset):has(> .field-prefix) > label {
  grid-row: 1;
}

.sra-layout--form .js-form-item:not(fieldset) > .field-prefix,
.sra-layout--form .js-form-item:not(fieldset) > .field-prefix + input {
  grid-row: 2;
  grid-column: 1;
}

.sra-layout--form .js-form-item:not(fieldset) > .field-prefix {
  display: flex;
  align-items: center;
  justify-self: left;
  height: 50px;
  padding-left: 16px;
  position: relative;
  z-index: 1;
  color: var(--sra-gray-700);
  pointer-events: none;
}

.sra-layout--form .js-form-item:not(fieldset) > .field-prefix::after {
  width: 1px;
  height: 20px;
  margin-left: 12px;
  background: #bcb9b6;
  content: "";
}

.sra-layout--form .js-form-item:not(fieldset) > .field-prefix + input {
  padding-left: 76px;
}

/* Webform narrows prefixed inputs in flexbox rows (85%); keep them full width. */
.sra-layout--form .webform-flex--container > .webform-has-field-prefix > input {
  width: 100%;
}

/* Proposal title: our "12 / 25 words" replaces webform's count-down text. */
.sra-layout--form .form-item-proposal-title .text-count-message {
  display: none !important;
}

.sra-word-count.is-over {
  color: #d92d20;
}

/* Two-column rows (webform_flexbox). */
.sra-layout--form .webform-flexbox {
  display: flex;
  gap: 24px;
  margin: 0;
}

.sra-layout--form .webform-flex {
  flex: 1 1 0;
  min-width: 0;
}

.sra-layout--form .webform-flex--container {
  margin: 0;
}

.sra-layout--form .webform-email-confirm .webform-flexbox {
  align-items: flex-start;
}

/* A field alone on its row keeps the half width (e.g. the Schools
   supervisor's mobile number). */
@media (min-width: 1024px) {
  .sra-layout--form .webform-flexbox > .webform-flex:only-child {
    flex: 0 1 calc(50% - 12px);
  }

  .sra-layout--form .webform-email-confirm--wrapper .webform-flexbox > .webform-flex:only-child {
    flex: 1 1 0;
  }
}

/* A field moved into a row in PHP has no .webform-flex wrapper (Schools
   supervisor email). */
.sra-layout--form .webform-flexbox > .js-form-item {
  flex: 1 1 0;
  min-width: 0;
}

/* Schools supervisor email (a single email field moved beside the name). */
.sra-layout--form .webform-flexbox > .webform-email-confirm--wrapper {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sra-layout--form .webform-flexbox > .webform-email-confirm--wrapper > legend {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Choice cards (Figma: Choice Card) — radios with descriptions.         */
/* ------------------------------------------------------------------ */

.sra-choice-cards .webform-options-display-one-column,
.sra-choice-cards > .fieldset-wrapper > div[id] {
  display: flex;
  gap: 16px;
}

.sra-choice-cards .js-form-type-radio {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 158px;
  padding: 20px;
  border: 1px solid var(--sra-gray-100);
  border-radius: var(--sra-radius-md);
  background: var(--sra-white);
  transition: border-color 0.2s, background-color 0.2s;
}

.sra-choice-cards--tracks .js-form-type-radio {
  min-height: 176px;
}

.sra-choice-cards .js-form-type-radio:hover {
  border-color: var(--sra-primary-300);
}

.sra-choice-cards .js-form-type-radio:has(input:checked) {
  margin: -1px;
  border: 2px solid var(--sra-primary-300);
  background: var(--sra-primary-50);
}

.sra-choice-cards .js-form-type-radio:has(input:focus-visible) {
  outline: 2px solid var(--sra-primary-500);
  outline-offset: 2px;
}

/* Icon circle (tracks and participation type). */
.sra-choice-cards--tracks .js-form-type-radio::before,
.sra-choice-cards--participation .js-form-type-radio::before {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sra-primary-50) center / 22px no-repeat;
  content: "";
}

.sra-choice-cards .js-form-type-radio:has(input:checked)::before {
  background-color: var(--sra-primary-100);
}

.sra-choice-cards .js-form-type-radio:has(input[value="schools"])::before {
  background-image: url("../images/form/track-school.svg");
}

.sra-choice-cards .js-form-type-radio:has(input[value="universities"])::before {
  background-image: url("../images/form/track-graduation-cap.svg");
}

.sra-choice-cards .js-form-type-radio:has(input[value="social"])::before {
  background-image: url("../images/form/track-hand-heart.svg");
}

.sra-choice-cards .js-form-type-radio:has(input[value="individual"])::before {
  background-image: url("../images/form/user-check.svg");
}

.sra-choice-cards .js-form-type-radio:has(input[value="team"])::before {
  background-image: url("../images/form/heart-handshake.svg");
}

/* Cards without an icon keep the radio in the top row. */
.sra-choice-cards:not(.sra-choice-cards--tracks):not(.sra-choice-cards--participation) .js-form-type-radio {
  min-height: 160px;
  padding-top: 52px;
}

/* Radio indicator. */
.sra-choice-cards input[type="radio"] {
  position: absolute;
  top: 32px;
  right: 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #bcb9b6;
  border-radius: 50%;
  background: var(--sra-white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

[dir="rtl"] .sra-choice-cards input[type="radio"] {
  right: auto;
  left: 20px;
}

.sra-choice-cards:not(.sra-choice-cards--tracks):not(.sra-choice-cards--participation) input[type="radio"] {
  top: 20px;
  right: auto;
  left: 20px;
}

[dir="rtl"] .sra-choice-cards:not(.sra-choice-cards--tracks):not(.sra-choice-cards--participation) input[type="radio"] {
  right: 20px;
  left: auto;
}

.sra-choice-cards input[type="radio"]:checked {
  border: 0;
  background: #177975 radial-gradient(circle, var(--sra-white) 4px, transparent 4.5px);
}

.sra-choice-cards label.option {
  margin: 0;
  color: var(--sra-tertiary-950);
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}

/* The whole card is clickable. */
.sra-choice-cards label.option::after {
  position: absolute;
  inset: 0;
  content: "";
}

.sra-choice-cards .js-form-type-radio .description {
  margin: 0;
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

/* ------------------------------------------------------------------ */
/* Option chips (Figma: Option Chip, Type=Radio) — target group.        */
/* ------------------------------------------------------------------ */

.sra-option-chips .fieldset-wrapper > div[id] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sra-option-chips .js-form-type-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--sra-gray-100);
  border-radius: var(--sra-radius-full);
  background: var(--sra-white);
  transition: background-color 0.2s, border-color 0.2s;
}

[dir="rtl"] .sra-option-chips .js-form-type-radio {
  padding: 10px 12px 10px 16px;
}

.sra-option-chips .js-form-type-radio:hover {
  border-color: var(--sra-primary-300);
}

.sra-option-chips input[type="radio"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #bcb9b6;
  border-radius: 50%;
  background: var(--sra-white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.sra-option-chips label.option {
  margin: 0;
  color: var(--sra-gray-700);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.sra-option-chips label.option::after {
  position: absolute;
  inset: 0;
  content: "";
}

.sra-option-chips .js-form-type-radio:has(input:checked) {
  border-color: #001716;
  background: #001e1d;
}

/* The chip shows focus (below), not the radio. */
.sra-option-chips input[type="radio"]:focus {
  border-color: #bcb9b6;
  box-shadow: none;
}

/* Selected: white circle with a 10px dot. */
.sra-option-chips input[type="radio"]:checked {
  border: 0;
  background: radial-gradient(circle, #054442 5px, var(--sra-white) 5.5px);
}

.sra-option-chips .js-form-type-radio:has(input:checked) label.option {
  color: var(--sra-white);
}

.sra-option-chips .js-form-type-radio:has(input:focus-visible) {
  outline: 2px solid var(--sra-primary-500);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Team members (webform_custom_composite, multiple).                   */
/* ------------------------------------------------------------------ */

.sra-layout--form .webform-multiple-table table,
.sra-layout--form .webform-multiple-table tbody,
.sra-layout--form .webform-multiple-table tr,
.sra-layout--form .webform-multiple-table td {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.sra-layout--form .webform-multiple-table thead {
  display: none;
}

.sra-layout--form .webform-multiple-table tbody {
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: sra-member;
}

.sra-layout--form .webform-multiple-table tr {
  position: relative;
  padding: 24px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-md);
  background: var(--sra-gray-50);
  counter-increment: sra-member;
}

.sra-layout--form .webform-multiple-table tr::before {
  display: block;
  margin-bottom: 20px;
  color: var(--sra-tertiary-950);
  content: var(--sra-member-label, "Member") " " counter(sra-member);
}

[data-drupal-selector="edit-students-items"] {
  --sra-member-label: "Student";
}

[data-drupal-selector="edit-team-members-items"] {
  --sra-member-label: "Team Member";
}

[dir="rtl"] [data-drupal-selector="edit-students-items"] {
  --sra-member-label: "الطالب";
}

[dir="rtl"] [data-drupal-selector="edit-team-members-items"] {
  --sra-member-label: "عضو الفريق";
}

.sra-layout--form .tableresponsive-toggle-columns {
  display: none;
}

.sra-layout--form .webform-multiple-table td:first-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.sra-layout--form .webform-multiple-table .webform-multiple-table--operations {
  position: absolute;
  top: 20px;
  right: 24px;
  width: auto;
}

[dir="rtl"] .sra-layout--form .webform-multiple-table .webform-multiple-table--operations {
  right: auto;
  left: 24px;
}

.sra-layout--form .webform-multiple-table--operations input[type="image"] {
  width: 20px;
  height: 20px;
}

/* Students: a "Remove" link on each student (Figma: Student Details). The
   image button stays clickable on top of the text. */
.sra-layout--form .webform-multiple-table .webform-multiple-table--operations {
  display: flex;
  align-items: center;
}

.sra-layout--form .webform-multiple-table--operations::before {
  color: #d92d20;
  font-size: 14px;
  line-height: 20px;
  content: var(--sra-remove-label, "Remove");
}

[dir="rtl"] .sra-layout--form .webform-multiple-table--operations {
  --sra-remove-label: "حذف";
}

.sra-layout--form .webform-multiple-table .webform-multiple-table--operations input[type="image"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Team member fields are required whenever a member is added; their
   asterisk comes from CSS (Webform makes them conditionally required, and
   the states script does not mark rows added later). */
.sra-layout--form [data-drupal-selector="edit-team-members-items"] .js-form-item > label:not(.form-required)::after {
  content: " *";
  color: #d92d20;
}

/* Universities (Figma: Team Member Details): Team Member 1 is the main
   applicant's fields in a member box, in the Figma order; added members are
   numbered from 2. */
.sra-member-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  padding: 24px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-md);
  background: var(--sra-gray-50);
}

.sra-member-box::before {
  grid-column: 1 / -1;
  color: var(--sra-tertiary-950);
  content: var(--sra-member-1-label, "Team Member 1");
}

[dir="rtl"] .sra-member-box {
  --sra-member-1-label: "عضو الفريق 1";
}

/* Team: Team Member 1 is the main applicant (Universities, Social Sector). */
.webform-submission-form:has(input[name="participation_type"][value="team"]:checked) .sra-member-box {
  --sra-member-1-label: "Team Member 1 (Main Applicant)";
}

[dir="rtl"] .webform-submission-form:has(input[name="participation_type"][value="team"]:checked) .sra-member-box {
  --sra-member-1-label: "عضو الفريق 1 (مقدم الطلب الرئيسي)";
}

.sra-member-box .webform-flexbox,
.sra-member-box .webform-flex,
.sra-member-box .webform-flex--container {
  display: contents;
}

.sra-member-box .form-item-applicant-name { order: 1; }
.sra-member-box .form-item-applicant-qid { order: 2; }
.sra-member-box .form-item-applicant-email { order: 3; }
.sra-member-box .form-item-applicant-mobile { order: 4; }
.sra-member-box .form-item-applicant-nationality { order: 5; }
.sra-member-box .form-item-academic-status { order: 6; }
.sra-member-box .form-item-institution { order: 7; }
.sra-member-box .form-item-job-title { order: 6; }
.sra-member-box .form-item-organisation { order: 7; }

.sra-form-card--members [data-drupal-selector="edit-team-members-items"] tbody {
  counter-reset: sra-member 1;
}

.sra-form-card--members .webform-multiple-table {
  margin-top: 16px;
}

@media (max-width: 1023px) {
  .sra-member-box {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Schools, Individual: one student, no Add student or Remove on it. */
.sra-layout--form .is-individual .webform-multiple-add,
.sra-layout--form .is-individual tbody > tr:first-child .webform-multiple-table--operations {
  display: none;
}

/* "2 more students can be added." beside Add student (js/registration-form.js). */
.sra-multiple-remaining {
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

.sra-layout--form .webform-multiple-add {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.sra-layout--form .webform-multiple-add .form-submit,
.sra-layout--form .webform-multiple-add input[type="submit"] {
  height: 42px;
  padding: 0 40px 0 18px;
  border: 1.5px solid rgba(0, 33, 31, 0.18);
  border-radius: var(--sra-radius-full);
  background: transparent url("../images/form/plus.svg") right 16px center / 16px no-repeat;
  color: var(--sra-gray-900);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

[dir="rtl"] .sra-layout--form .webform-multiple-add input[type="submit"] {
  padding: 0 18px 0 40px;
  background-position: left 16px center;
}

/* ------------------------------------------------------------------ */
/* Review summary and declarations (step 4).                            */
/* ------------------------------------------------------------------ */

.sra-review {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sra-review__group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-md);
  background: var(--sra-gray-50);
}

.sra-review__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sra-review__heading h3 {
  margin: 0;
  color: var(--sra-tertiary-950);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.sra-review__edit {
  color: var(--sra-primary-700);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

.sra-review__edit:hover {
  text-decoration: underline;
}

.sra-review__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 0;
}

.sra-review__items dt {
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

.sra-review__items dd {
  margin: 2px 0 0;
  color: var(--sra-tertiary-950);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sra-declaration.js-form-type-checkbox {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 14px;
  padding: 20px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-md);
  background: var(--sra-white);
}

.sra-declaration.js-form-type-checkbox:has(input:checked) {
  border-color: var(--sra-primary-300);
  background: var(--sra-primary-50);
}

.sra-declaration input[type="checkbox"] {
  grid-row: 1 / span 3;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 1.5px solid #bcb9b6;
  border-radius: 6px;
  background: var(--sra-white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.sra-declaration input[type="checkbox"]:checked {
  border: 0;
  background: #177975 url("../images/form/checkbox-check.svg") center / 14px no-repeat;
}

.sra-declaration input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--sra-primary-500);
  outline-offset: 2px;
}

.sra-declaration label.option {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  cursor: pointer;
}

.sra-declaration > .description {
  grid-column: 2;
  margin: 4px 0 0 !important;
  color: var(--sra-gray-700);
}

.sra-declaration .form-item--error-message {
  grid-column: 2;
}

/* ------------------------------------------------------------------ */
/* Actions.                                                             */
/* ------------------------------------------------------------------ */

.webform-submission-sra-registration-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding-top: 20px;
}

.webform-submission-sra-registration-form .sra-required-note {
  margin: 0;
  margin-inline-end: auto;
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

.sra-required-note__mark {
  color: #d92d20;
}

.webform-submission-sra-registration-form .form-actions .form-submit,
.webform-submission-sra-registration-form .form-actions .sra-back-home {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 32px;
  border: 1.5px solid rgba(0, 33, 31, 0.18);
  border-radius: var(--sra-radius-full);
  background: transparent;
  color: var(--sra-gray-900);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Step 1 "Back" is a link: same look as the button, no underline. */
.webform-submission-sra-registration-form .form-actions .sra-back-home,
.webform-submission-sra-registration-form .form-actions .sra-back-home:hover {
  text-decoration: none;
}

.webform-submission-sra-registration-form .form-actions .webform-button--next,
.webform-submission-sra-registration-form .form-actions .webform-button--submit {
  padding: 0 60px 0 32px;
  border-color: var(--sra-gray-800);
  background: var(--sra-gray-800) url("../images/form/arrow-right.svg") right 32px center / 20px no-repeat;
  color: var(--sra-white);
  filter: drop-shadow(0 16px 16px rgba(2, 45, 48, 0.08)) drop-shadow(0 6px 8px rgba(2, 45, 48, 0.07));
}

[dir="rtl"] .webform-submission-sra-registration-form .form-actions .webform-button--next,
[dir="rtl"] .webform-submission-sra-registration-form .form-actions .webform-button--submit {
  padding: 0 32px 0 60px;
  background-image: url("../images/form/arrow-left.svg");
  background-position: left 32px center;
}

.webform-submission-sra-registration-form .form-actions .webform-button--previous:hover {
  background: var(--sra-white);
}

.webform-submission-sra-registration-form .form-actions .webform-button--next:hover,
.webform-submission-sra-registration-form .form-actions .webform-button--submit:hover {
  background-color: var(--sra-tertiary-950);
}

/* Submit stays disabled-looking until both declarations are accepted. */
.webform-submission-sra-registration-form:has(.sra-declaration input:not(:checked)) .webform-button--submit {
  opacity: 0.5;
}

/* Error summary at the top of the form. */
.sra-form-main .messages--error {
  padding: 16px 20px;
  border: 1px solid #fda29b;
  border-radius: var(--sra-radius-md);
  background: #fef3f2;
  color: #b42318;
}

/* ------------------------------------------------------------------ */
/* Confirmation.                                                        */
/* ------------------------------------------------------------------ */

.sra-confirmation {
  display: flex;
  justify-content: center;
}

.sra-confirmation__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 846px;
  max-width: 100%;
  padding: 40px;
  border: 1px solid var(--sra-gray-200);
  border-radius: var(--sra-radius-lg);
  background: var(--sra-white);
}

.sra-confirmation__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sra-primary-50);
}

.sra-confirmation__title {
  color: var(--sra-tertiary-950);
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
}

.sra-confirmation__message {
  color: var(--sra-gray-700);
  font-size: 18px;
  line-height: 28px;
}

.sra-confirmation__reference {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--sra-primary-100);
  border-radius: var(--sra-radius-md);
  background: var(--sra-primary-50);
}

.sra-confirmation__reference-number {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.sra-confirmation__reference-label {
  color: var(--sra-primary-700);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
}

.sra-confirmation__reference-value {
  color: var(--sra-tertiary-950);
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
}

/* Arabic: the (left-to-right) number sits under its label, on the right. */
[dir="rtl"] .sra-confirmation__reference-value {
  text-align: right;
}

.sra-button--white {
  gap: 10px;
  background: var(--sra-white);
  color: var(--sra-gray-900);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sra-button--white.is-copied {
  background: var(--sra-primary-100);
}

.sra-confirmation__email {
  color: var(--sra-gray-600);
  font-size: 14px;
  line-height: 20px;
}

/* The address in bold (Figma). */
.sra-confirmation__email .placeholder {
  color: var(--sra-gray-700);
  font-style: normal;
  font-weight: 700;
}

.sra-confirmation__divider {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--sra-gray-200);
}

.sra-confirmation__next-title {
  color: var(--sra-gray-600);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
}

.sra-confirmation__next {
  width: 100%;
  margin: -16px 0 0;
  padding: 0;
  list-style: none;
}

.sra-confirmation__next li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sra-gray-200);
}

.sra-confirmation__next li:last-child {
  border-bottom: 0;
}

.sra-confirmation__next li::before {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bcb9b6;
  content: "";
}

.sra-confirmation__next strong {
  flex: none;
  width: 260px;
  color: var(--sra-tertiary-950);
}

.sra-confirmation__next span {
  color: var(--sra-gray-500);
  font-size: 14px;
  line-height: 20px;
}

/* Review (Arabic): numbers (left to right) sit under their labels, on the
   right, like the other values. */
[dir="rtl"] .sra-review__items dd[dir="ltr"] {
  text-align: right;
}

/* Registration closed (Figma: Registration — Closed State). */
.sra-closed__icon {
  background: #f8f5f1;
}

.sra-closed__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--sra-gray-600);
}

.sra-closed__contact a {
  color: #0d5e5b;
  font-weight: 700;
  text-decoration: none;
}

.sra-closed__contact a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Responsive.                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1199px) {
  .sra-form-header__intro {
    flex-direction: column;
    align-items: stretch;
  }

  .sra-form-header__rules {
    width: auto;
  }
}

@media (max-width: 1023px) {
  .webform-submission-sra-registration-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .webform-submission-sra-registration-form > *,
  .webform-submission-sra-registration-form > .sra-form-sidebar {
    position: static;
    grid-row: auto;
    grid-column: 1;
  }

  .sra-form-sidebar__help {
    display: none;
  }

  .sra-stepper {
    flex-direction: row;
    overflow-x: auto;
  }

  .sra-stepper__step {
    flex: none;
  }

  .sra-stepper__step:not(.is-active) .sra-stepper__text {
    display: none;
  }

  .sra-form-card {
    padding: 24px;
  }

  .sra-choice-cards .webform-options-display-one-column,
  .sra-choice-cards > .fieldset-wrapper > div[id],
  .sra-layout--form .webform-flexbox {
    flex-direction: column;
  }

  .sra-layout--form .webform-multiple-table td:first-child,
  .sra-review__items {
    grid-template-columns: minmax(0, 1fr);
  }

  .sra-form-header__title {
    font-size: 32px;
    line-height: 40px;
  }

  .sra-confirmation__next li {
    flex-wrap: wrap;
  }

  .sra-confirmation__next strong {
    width: auto;
  }

  /* Figma mobile: the note on its own line, then Back and Continue side by
     side at the start of the row. */
  .webform-submission-sra-registration-form .form-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .webform-submission-sra-registration-form .sra-required-note {
    flex: 1 0 100%;
    margin-inline-end: 0;
  }
}

/* Status / error messages above the form. */
.sra-form-main__messages [role="contentinfo"] {
  max-width: 955px;
  margin-inline-start: auto;
  padding: 16px 20px;
  border: 1px solid #fda29b;
  border-radius: var(--sra-radius-md);
  background: #fef3f2;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

.sra-form-main__messages [role="contentinfo"] ul {
  margin: 0;
  padding-inline-start: 18px;
}

@media (max-width: 1023px) {
  .sra-form-main__messages [role="contentinfo"] {
    max-width: none;
  }
}

.sra-form-main:has(.sra-confirmation) .sra-form-main__messages [role="contentinfo"] {
  max-width: 846px;
  margin: 0 auto;
}

/* Phone numbers and IDs read left to right in Arabic too. */
.sra-layout--form .js-form-item:not(fieldset) > .field-prefix {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .sra-layout--form input[type="tel"],
[dir="rtl"] .sra-layout--form input[name="applicant_qid"],
[dir="rtl"] .sra-layout--form input[name$="[qid]"],
[dir="rtl"] .sra-layout--form input[type="email"] {
  direction: ltr;
  text-align: right;
}

/* Arabic Figma: "+974 |" on the left as in English, the number right after
   it. */
[dir="rtl"] .sra-layout--form input[type="tel"] {
  text-align: left;
}
