:root {
  --registration-blue: var(--healthlink-blue, #0757f8);
  --registration-blue-dark: var(--healthlink-blue-dark, #053e8b);
  --registration-navy: var(--healthlink-navy, #082b6f);
  --registration-cyan: var(--healthlink-cyan, #12bce1);
  --registration-purple: var(--healthlink-purple, #563cf5);
  --registration-ink: var(--healthlink-ink, #092864);
  --registration-muted: var(--healthlink-muted, #5d7192);
  --registration-canvas: var(--healthlink-canvas, #eef7ff);
  --registration-line: var(--healthlink-line, #d9eaf8);
  --registration-line-strong: var(--healthlink-line-strong, #b8d7f0);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body.registration-page {
  min-height: 100%;
}

body.registration-page {
  margin: 0;
  color: var(--registration-ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(86, 60, 245, 0.11), transparent 28rem),
    radial-gradient(circle at 92% 6%, rgba(18, 188, 225, 0.16), transparent 30rem),
    linear-gradient(180deg, #f8fcff 0, var(--registration-canvas) 100%) !important;
  font-family: var(--healthlink-font, Inter, ui-sans-serif, system-ui, sans-serif) !important;
}

button,
input,
select {
  font: inherit;
}

.registration-shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 24px 0 72px;
}

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

.registration-brand {
  display: block;
  width: min(310px, 52vw);
}

.registration-brand img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: contain;
  object-position: left center;
}

.registration-signin {
  color: var(--registration-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.registration-signin strong {
  color: var(--registration-blue);
}

.registration-intro {
  max-width: 720px;
  margin: 44px auto 26px;
  text-align: center;
}

.registration-kicker,
.registration-card-header p {
  margin: 0 0 7px;
  color: var(--registration-purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.registration-intro h1 {
  margin: 0;
  color: var(--registration-navy) !important;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.registration-intro > p:last-child {
  margin: 13px auto 0;
  color: var(--registration-muted);
  font-size: 15px;
  line-height: 1.6;
}

.registration-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 760px);
  margin: 0 auto 28px;
  padding: 0;
  list-style: none;
}

.registration-progress li {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: #8090ab;
}

.registration-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 20px;
  left: 52px;
  width: calc(100% - 62px);
  height: 2px;
  background: var(--registration-line-strong);
}

.registration-progress li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 2px solid var(--registration-line-strong);
  border-radius: 50%;
  color: var(--registration-muted);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(8, 43, 111, 0.06);
}

.registration-progress li strong,
.registration-progress li small {
  display: block;
}

.registration-progress li strong {
  color: currentColor;
  font-size: 13px;
}

.registration-progress li small {
  margin-top: 2px;
  font-size: 10px;
}

.registration-progress li.active,
.registration-progress li.complete {
  color: var(--registration-blue-dark);
}

.registration-progress li.active > span,
.registration-progress li.complete > span {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--registration-purple), var(--registration-blue) 58%, var(--registration-cyan));
}

.registration-progress li.complete:not(:last-child)::after {
  background: linear-gradient(90deg, var(--registration-blue), var(--registration-cyan));
}

.registration-alert {
  width: min(100%, 760px);
  margin: 0 auto 16px;
  padding: 13px 16px;
  border: 1px solid var(--registration-line);
  border-radius: 13px;
  color: var(--registration-ink);
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 9px 24px rgba(8, 43, 111, 0.07);
}

.registration-alert-info {
  border-left: 4px solid var(--registration-cyan);
}

.registration-alert-error {
  border-left: 4px solid var(--registration-purple);
}

.registration-card {
  width: min(100%, 650px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(7, 87, 248, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(8, 43, 111, 0.14);
}

.registration-card-wide {
  width: min(100%, 960px);
}

.registration-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.registration-step-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--registration-purple), var(--registration-blue) 62%, var(--registration-cyan));
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(7, 87, 248, 0.2);
}

.registration-card-header h2,
.registration-dialog h2 {
  margin: 0;
  color: var(--registration-navy) !important;
  font-size: clamp(23px, 4vw, 31px);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.registration-card-header div > span,
.registration-dialog > p:not(.registration-kicker) {
  display: block;
  margin-top: 8px;
  color: var(--registration-muted);
  font-size: 13px;
  line-height: 1.55;
}

.registration-form,
.registration-profile-form {
  display: grid;
  gap: 18px;
}

.registration-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.registration-field > span {
  color: var(--registration-ink);
  font-size: 12px;
  font-weight: 750;
}

.registration-field em {
  margin-left: 4px;
  color: var(--registration-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.registration-field small {
  color: var(--registration-muted);
  font-size: 10px;
  line-height: 1.45;
}

.registration-field input,
.registration-field select,
.registration-field output {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--registration-line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--registration-ink) !important;
  background: #fbfdff !important;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.registration-field input::placeholder {
  color: #91a2bb;
}

.registration-field input:focus,
.registration-field select:focus {
  border-color: var(--registration-blue);
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(7, 87, 248, 0.1);
}

.registration-field input:read-only,
.registration-field output {
  color: var(--registration-muted) !important;
  background: #f2f7fc !important;
}

/* Select2 follows the same field language as the rest of registration. */
.registration-field .select2-container {
  width: 100% !important;
  min-width: 0;
  font-size: 13px;
}

.registration-field .select2-container .select2-selection--single {
  height: 48px;
  border: 1px solid var(--registration-line-strong);
  border-radius: 12px;
  outline: none;
  background: #fbfdff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.registration-field .select2-container .select2-selection--single .select2-selection__rendered {
  padding: 0 42px 0 13px;
  color: var(--registration-ink);
  font-weight: 600;
  line-height: 46px;
}

.registration-field .select2-container .select2-selection--single .select2-selection__placeholder {
  color: #91a2bb;
}

.registration-field .select2-container .select2-selection--single .select2-selection__arrow {
  width: 42px;
  height: 46px;
}

.registration-field .select2-container .select2-selection--single .select2-selection__arrow b {
  width: 8px;
  height: 8px;
  margin: -6px 0 0 -5px;
  border: 0;
  border-right: 2px solid var(--registration-blue-dark);
  border-bottom: 2px solid var(--registration-blue-dark);
  transform: rotate(45deg);
  transition: transform 0.18s ease, margin-top 0.18s ease;
}

.registration-field .select2-container--open .select2-selection--single,
.registration-field .select2-container--focus .select2-selection--single {
  border-color: var(--registration-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(7, 87, 248, 0.1);
}

.registration-field .select2-container--open .select2-selection--single .select2-selection__arrow b {
  margin-top: -2px;
  transform: rotate(225deg);
}

.registration-field .select2-container--disabled .select2-selection--single {
  border-color: var(--registration-line);
  background: #f2f7fc;
  cursor: not-allowed;
}

.registration-field .select2-container--disabled .select2-selection__rendered {
  color: var(--registration-muted);
}

.registration-select2-dropdown.select2-dropdown {
  z-index: 1200;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid var(--registration-line-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(8, 43, 111, 0.17);
  font-family: var(--healthlink-font, Inter, ui-sans-serif, system-ui, sans-serif);
}

.registration-select2-dropdown.select2-dropdown--above {
  margin-top: -6px;
  margin-bottom: 6px;
}

.registration-select2-dropdown .select2-search--dropdown {
  padding: 10px;
  border-bottom: 1px solid var(--registration-line);
  background: #f7fbff;
}

.registration-select2-dropdown .select2-search--dropdown .select2-search__field {
  height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--registration-line-strong);
  border-radius: 9px;
  outline: none;
  color: var(--registration-ink);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.registration-select2-dropdown .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--registration-blue);
  box-shadow: 0 0 0 3px rgba(7, 87, 248, 0.09);
}

.registration-select2-dropdown .select2-results__options {
  max-height: 220px;
  padding: 6px;
}

.registration-select2-dropdown .select2-results__option {
  margin: 2px 0;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--registration-ink);
  font-size: 12px;
  font-weight: 600;
}

.registration-select2-dropdown .select2-results__option--selected {
  color: var(--registration-blue-dark);
  background: #eaf4ff;
}

.registration-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  color: #fff;
  background: linear-gradient(110deg, var(--registration-purple), var(--registration-blue) 70%, var(--registration-cyan));
}

.registration-select2-dropdown .select2-results__message {
  color: var(--registration-muted);
  background: transparent;
  text-align: center;
}

.registration-password-wrap {
  position: relative;
}

.registration-password-wrap input {
  padding-right: 64px;
}

.registration-password-wrap button {
  position: absolute;
  top: 50%;
  right: 11px;
  padding: 6px;
  border: 0;
  color: var(--registration-blue);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  transform: translateY(-50%);
  cursor: pointer;
}

.registration-primary-button,
.registration-outline-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.registration-primary-button {
  border: 0;
  color: #fff !important;
  background: linear-gradient(110deg, var(--registration-purple), var(--registration-blue) 61%, var(--registration-cyan)) !important;
  box-shadow: 0 13px 27px rgba(7, 87, 248, 0.2);
}

.registration-primary-button:hover:not(:disabled),
.registration-primary-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 17px 32px rgba(7, 87, 248, 0.27);
}

.registration-primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.registration-outline-button {
  border: 1px solid var(--registration-blue);
  color: var(--registration-blue);
  background: #fff;
}

.registration-status {
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.registration-status:not(:empty) {
  padding: 10px 12px;
}

.registration-status.success {
  color: var(--registration-blue-dark);
  background: rgba(18, 188, 225, 0.12);
}

.registration-status.error {
  color: #6d2fc4;
  background: rgba(86, 60, 245, 0.1);
}

.otp-form {
  text-align: center;
}

.otp-form .registration-field {
  text-align: left;
}

.otp-form input[name="otp"] {
  height: 62px;
  text-align: center;
  font-size: 27px;
  font-weight: 850;
  letter-spacing: 0.32em;
}

.registration-development-code {
  margin: 0;
  padding: 9px 12px;
  border: 1px dashed var(--registration-cyan);
  border-radius: 10px;
  color: var(--registration-blue-dark);
  background: rgba(18, 188, 225, 0.08);
  font-size: 11px;
}

.registration-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 20px;
}

.registration-secondary-actions button {
  padding: 4px;
  border: 0;
  color: var(--registration-blue);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.verified-account-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
  padding: 14px;
  border: 1px solid rgba(18, 188, 225, 0.27);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(86, 60, 245, 0.05), rgba(18, 188, 225, 0.09));
}

.verified-account-strip span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.verified-account-strip small {
  color: var(--registration-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.verified-account-strip strong {
  overflow: hidden;
  color: var(--registration-blue-dark);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-profile-form fieldset {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--registration-line);
  border-radius: 18px;
  background: #fff;
}

.registration-profile-form legend {
  display: flex;
  width: auto;
  margin: 0 0 19px;
  padding: 0;
  align-items: baseline;
  gap: 10px;
  color: var(--registration-navy);
}

.registration-profile-form legend span {
  font-size: 15px;
  font-weight: 820;
}

.registration-profile-form legend small {
  color: var(--registration-muted);
  font-size: 10px;
  font-weight: 600;
}

.registration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.registration-field-wide {
  grid-column: span 3;
}

.registration-consents {
  display: grid;
  gap: 10px;
  padding: 4px 3px;
}

.registration-consents label,
.registration-review-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--registration-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.registration-consents input,
.registration-review-confirm input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  accent-color: var(--registration-blue);
}

.registration-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.registration-profile-actions > a {
  color: var(--registration-muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.registration-dialog {
  width: min(calc(100% - 28px), 540px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(25px, 5vw, 38px);
  border: 1px solid rgba(7, 87, 248, 0.14);
  border-radius: 23px;
  color: var(--registration-ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(8, 43, 111, 0.3);
}

.registration-dialog::backdrop {
  background: rgba(5, 28, 73, 0.58);
  backdrop-filter: blur(5px);
}

.welcome-dialog {
  max-width: 470px;
  text-align: center;
}

.dialog-celebration {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--registration-purple), var(--registration-blue) 58%, var(--registration-cyan));
  box-shadow: 0 18px 36px rgba(7, 87, 248, 0.24);
}

.dialog-celebration span {
  font-size: 30px;
  font-weight: 900;
}

.welcome-dialog .registration-primary-button {
  width: 100%;
  margin-top: 12px;
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
}

.dialog-close-row button {
  display: grid;
  width: 34px;
  height: 34px;
  margin: -13px -13px 2px 0;
  place-items: center;
  border: 1px solid var(--registration-line);
  border-radius: 10px;
  color: var(--registration-muted);
  background: #fff;
  font-size: 21px;
  cursor: pointer;
}

.review-dialog dl {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--registration-line);
  border-radius: 14px;
}

.review-dialog dt,
.review-dialog dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--registration-line);
  font-size: 11px;
  line-height: 1.45;
}

.review-dialog dt {
  color: var(--registration-muted);
  background: #f5f9fd;
  font-weight: 750;
}

.review-dialog dd {
  overflow-wrap: anywhere;
  color: var(--registration-ink);
  font-weight: 700;
}

.review-dialog dt:nth-last-of-type(1),
.review-dialog dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.registration-review-confirm {
  padding: 14px;
  border: 1px solid var(--registration-line);
  border-radius: 12px;
  background: #f8fbfe;
}

.registration-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .registration-shell {
    width: min(100% - 22px, 1040px);
    padding-top: 12px;
  }

  .registration-brand {
    width: min(210px, 56vw);
  }

  .registration-brand img {
    height: 60px;
  }

  .registration-signin {
    max-width: none;
    font-size: 9px;
    text-align: right;
    white-space: nowrap;
  }

  .registration-topbar {
    gap: 8px;
  }

  .registration-intro {
    margin-top: 30px;
  }

  .registration-progress li {
    justify-content: center;
  }

  .registration-progress li div {
    display: none;
  }

  .registration-progress li:not(:last-child)::after {
    left: calc(50% + 27px);
    width: calc(100% - 54px);
  }

  .registration-card {
    padding: 23px 18px;
    border-radius: 19px;
  }

  .registration-grid {
    grid-template-columns: 1fr;
  }

  .registration-field-wide {
    grid-column: auto;
  }

  .registration-profile-form fieldset {
    padding: 18px 14px;
  }

  .registration-profile-form legend {
    display: grid;
    gap: 2px;
  }
}

@media (max-width: 520px) {
  .registration-card-header {
    gap: 12px;
  }

  .registration-step-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 13px;
  }

  .verified-account-strip,
  .registration-dialog-actions {
    grid-template-columns: 1fr;
  }

  .registration-profile-actions {
    display: grid;
    justify-content: stretch;
    text-align: center;
  }

  .registration-profile-actions .registration-primary-button {
    width: 100%;
  }

  .review-dialog dl {
    grid-template-columns: 1fr;
  }

  .review-dialog dt,
  .review-dialog dd {
    border-bottom: 0;
  }

  .review-dialog dd {
    border-bottom: 1px solid var(--registration-line);
  }
}
