.rt-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rt-auth-modal.is-open {
  display: flex;
}

.rt-auth-modal[hidden] {
  display: none !important;
}

.rt-auth-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.rt-auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--reasoned-surface-elevated, rgba(18, 22, 28, 0.98));
  border: 1px solid var(--reasoned-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--reasoned-radius-card, 12px);
  box-shadow: var(--reasoned-shadow-card, 0 18px 48px rgba(0, 0, 0, 0.45));
  padding: 24px;
}

.rt-auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--reasoned-text-secondary, #9aa3b2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rt-auth-modal__message {
  display: none;
  margin: 0 0 12px;
  font-size: 13px;
}

.rt-auth-modal__message.is-visible {
  display: block;
}

.rt-auth-modal__message.is-error {
  color: #e05252;
}

.rt-auth-modal__message.is-success {
  color: var(--reasoned-accent, #00c281);
}

.rt-auth-modal__message.is-loading,
#cms-login-err.is-loading {
  color: var(--reasoned-muted, #6b7280);
}

form.is-auth-loading [type="submit"].is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

form.is-auth-loading [type="submit"].is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rt-auth-spin 0.7s linear infinite;
}

@keyframes rt-auth-spin {
  to { transform: rotate(360deg); }
}

body.rt-auth-modal-open {
  overflow: hidden;
}

/* When CentralHost modals are open on product auth pages, hide the local shell underneath. */
body.rt-auth-modal-open .reasoned-auth-shell {
  visibility: hidden;
}

/* Form controls used by CentralHost login/signup HTML (shared across product sites). */
.rt-auth-modal .form-g,
.cms-login-box .form-g {
  display: grid;
  gap: 14px;
}

.rt-auth-modal .flabel,
.cms-login-box .flabel {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--reasoned-text-secondary, var(--txt2, #9aa3b2));
}

.rt-auth-modal .finput,
.rt-auth-modal .fsel,
.cms-login-box .finput,
.cms-login-box .fsel {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--reasoned-surface, var(--surf, #12161c));
  border: 1px solid var(--reasoned-border, var(--border, rgba(255, 255, 255, 0.12)));
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--reasoned-text, var(--txt, #f0f0f5));
}

.rt-auth-modal .finput:focus,
.rt-auth-modal .fsel:focus,
.cms-login-box .finput:focus,
.cms-login-box .fsel:focus {
  outline: none;
  border-color: var(--reasoned-accent, var(--acc, #00c281));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--reasoned-accent, #00c281) 12%, transparent);
}

.rt-auth-modal .finput::placeholder,
.cms-login-box .finput::placeholder {
  color: var(--reasoned-text-muted, var(--muted, #6b7280));
}

.rt-auth-modal .btn,
.cms-login-box .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.rt-auth-modal .btn-p,
.cms-login-box .btn-p {
  background: var(--reasoned-accent, var(--acc, #00c281));
  color: #000;
  padding: 12px 18px;
  font-size: 14px;
}

.rt-auth-modal .btn-s,
.cms-login-box .btn-s {
  background: transparent;
  color: var(--reasoned-text, var(--txt, #f0f0f5));
  padding: 11px 18px;
  font-size: 14px;
  border: 1px solid var(--reasoned-border, var(--border, rgba(255, 255, 255, 0.12)));
}

/* Shared signup phone picker guard: keep the dial prefix from overlapping the input before site JS hydrates. */
.su-phone-group {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 6px;
}
.su-country-picker {
  display: grid;
  grid-template-columns: 44px 0;
  gap: 0;
  min-width: 0;
}
.su-country-trigger {
  width: 44px;
  height: 44px;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}
#su-phone-country {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.su-phone-input-wrap {
  position: relative;
  --su-phone-prefix-pad: 54px;
}
.su-phone-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt, var(--reasoned-text, #f4f6f8));
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}
.su-phone-prefix:empty {
  display: none;
}
.su-phone-input-wrap #su-phone {
  padding-left: var(--su-phone-prefix-pad, 54px);
}
.su-phone-prefix:empty + #su-phone {
  padding-left: 14px;
}
@media (max-width: 420px) {
  .su-phone-group {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }
}

/* Inline CentralHost signup (Education / Recruitment / shared mounts) */
.rt-central-signup,
.rt-profile-completion {
  color: var(--reasoned-text, #cfcfcf);
}
.rt-central-signup .su-ft,
.rt-profile-completion .su-ft {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--reasoned-text, #fff);
}
.rt-central-signup .su-fsub,
.rt-profile-completion .su-fsub {
  font-size: 14px;
  color: var(--reasoned-text-secondary, #9aa7a3);
  margin-bottom: 16px;
}
.rt-central-signup .flabel,
.rt-profile-completion .flabel {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--reasoned-text-secondary, #9aa7a3);
}
.rt-central-signup .finput,
.rt-central-signup .su-university-trigger,
.rt-profile-completion .finput,
.rt-profile-completion .su-university-trigger {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.12));
  background: rgba(255,255,255,.03);
  color: var(--reasoned-text, #cfcfcf);
  padding: 10px 14px;
  font-size: 14px;
}
.rt-central-signup .fg2,
.rt-profile-completion .fg2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rt-central-signup .form-g > div,
.rt-central-signup .form-g > label,
.rt-profile-completion .form-g > div,
.rt-profile-completion .form-g > label {
  margin-bottom: 12px;
}
.rt-central-signup .fcheck,
.rt-profile-completion .fcheck {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--reasoned-text-secondary, #9aa7a3);
  margin: 10px 0;
}
.rt-central-signup .btn-p,
.rt-profile-completion .btn-p {
  background: var(--reasoned-accent, #00c281);
  color: #001c13;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.rt-profile-completion,
.rt-profile-completion * {
  box-sizing: border-box;
}
.rt-profile-completion .reasoned-field__control,
.rt-profile-completion .su-university-trigger {
  min-width: 0;
}
.rt-profile-completion select.reasoned-field__control,
.rt-profile-completion select.reasoned-field__control option {
  color-scheme: dark;
  background-color: var(--reasoned-surface, #12121a);
  color: var(--reasoned-text, #f0f0f5);
}
.rt-profile-completion .su-university-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.rt-profile-completion .su-phone-group {
  margin-top: 0;
}
.rt-profile-completion .su-phone-group .su-country-trigger {
  width: 46px;
  height: 46px;
  min-height: 46px;
  border-radius: var(--reasoned-radius-control, 10px);
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.12));
  background: rgba(255,255,255,.03);
  color: var(--reasoned-text, #f0f0f5);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.rt-profile-completion .fcheck {
  font-size: 14px;
  line-height: 1.45;
  color: var(--reasoned-text-secondary);
  margin: 0;
}
.rt-profile-completion .fcheck input {
  accent-color: var(--reasoned-primary, #00c281);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.rt-profile-completion .fcheck a {
  color: var(--reasoned-primary, #00c281);
}
.rt-profile-completion .su-uni-msg {
  font-size: 12px;
  color: var(--reasoned-primary, #00c281);
  margin: 6px 0 0;
}
.rt-central-signup .btn-s {
  background: transparent;
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.12));
  color: var(--reasoned-text-secondary, #9aa7a3);
  border-radius: 8px;
  cursor: pointer;
}
.rt-central-signup .su-progress-wrap {
  margin-bottom: 16px;
}
.rt-central-signup .su-progress-lbl {
  font-size: 12px;
  color: var(--reasoned-text-secondary, #9aa7a3);
  margin-bottom: 6px;
}
.rt-central-signup .su-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.rt-central-signup .su-progress-fill {
  height: 100%;
  background: var(--reasoned-accent, #00c281);
}
.rt-central-signup .su-reassurance {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 11px;
  color: var(--reasoned-text-secondary, #9aa7a3);
  margin: 8px 0 4px;
}
.rt-central-signup .su-reassurance span {
  background: var(--reasoned-surface, rgba(255,255,255,.04));
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.12));
  border-radius: 18px;
  padding: 4px 10px;
  font-weight: 600;
}
.rt-central-signup .already {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: var(--reasoned-text-secondary, #9aa7a3);
}
.su-university-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  color: var(--reasoned-text-secondary, #9aa7a3);
}
.su-university-trigger.is-selected {
  color: var(--reasoned-text, #cfcfcf);
}
.su-university-trigger::after {
  content: "▾";
  font-size: 12px;
  margin-left: 10px;
  opacity: .7;
}
.su-country-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.72);
}
.su-country-modal.open {
  display: flex;
}
.su-country-modal-card {
  width: min(480px, 100%);
  max-height: min(70vh, 560px);
  overflow: auto;
  background: #12161c;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 16px;
}
.su-university-modal .su-country-modal-card {
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.su-uni-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.su-uni-search-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--reasoned-text-secondary, #9aa7a3);
}
.su-uni-search,
#su-uni-search.finput,
#su-uni-search,
#su-country-search.finput,
#su-country-search {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.14));
  background: rgba(255,255,255,.04);
  color: var(--reasoned-text, #f0f0f5);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
}
#su-uni-search:focus,
#su-country-search:focus {
  outline: none;
  border-color: var(--reasoned-primary, #00c281);
  box-shadow: 0 0 0 3px rgba(0, 194, 129, 0.14);
}
.su-university-results,
#su-uni-results {
  overflow: auto;
  flex: 1;
  min-height: 220px;
  margin-top: 12px;
  border: 1px solid var(--reasoned-border, rgba(255,255,255,.12));
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  padding: 6px;
}
.su-university-section-title {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--reasoned-text-muted, #5a6a65);
  font-weight: 700;
  margin: 8px 4px;
}
.su-university-empty {
  padding: 14px 12px;
  margin: 0;
  color: var(--reasoned-text-secondary, #9aa7a3);
  font-size: 14px;
}
.su-country-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.su-country-modal-head h3 {
  margin: 0;
  font-size: 16px;
  color: #fff;
}
.su-country-close {
  border: 0;
  background: transparent;
  color: #9aa7a3;
  font-size: 22px;
  cursor: pointer;
}
.su-country-list {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}
.su-country-option,
.su-university-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #cfcfcf;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.su-country-option:hover,
.su-university-option:hover,
.su-country-option[aria-selected="true"],
.su-university-option[aria-selected="true"] {
  background: rgba(0,194,129,.12);
  color: #00c281;
}
.su-university-option-meta {
  display: block;
  margin-top: 3px;
  color: #5a6a65;
  font-size: 11px;
}
.su-country-empty {
  color: #9aa7a3;
  font-size: 13px;
  padding: 8px;
}
.su-country-trigger {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #cfcfcf;
  cursor: pointer;
}
