/* JRMRC client onboarding — page-specific styles */
.onboarding-page {
  --ob-brand: #153e35;
  --ob-brand-deep: #0e2f28;
  --ob-brand-soft: #e9f1ed;
  --ob-accent: #d59c53;
  --ob-accent-soft: #f7eddf;
  --ob-ink: #16201c;
  --ob-muted: #66736d;
  --ob-line: #e2e7e3;
  --ob-bg: #f5f7f4;
  --ob-surface: #ffffff;
  --ob-danger: #9c3434;
  --ob-shadow: 0 24px 70px rgba(20, 44, 35, .10);
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 5%, rgba(213, 156, 83, .11), transparent 25rem),
    radial-gradient(circle at 100% 20%, rgba(21, 62, 53, .08), transparent 32rem),
    var(--ob-bg);
  color: var(--ob-ink);
}

.onboarding-page * { box-sizing: border-box; }
.onboarding-page button,
.onboarding-page input,
.onboarding-page textarea,
.onboarding-page select { font: inherit; }
.onboarding-page button { cursor: pointer; }
.onboarding-page svg { display: block; }
.onboarding-page .hidden { display: none !important; }

.onboarding-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.onboarding-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(226, 231, 227, .9);
  background: rgba(255, 255, 255, .87);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.onboarding-topbar-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.onboarding-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.onboarding-logo {
  display: block;
  width: auto;
  max-width: 190px;
  height: 42px;
  object-fit: contain;
}

.onboarding-logo-light {
  object-position: left center;
}

.sidebar-logo-wrap {
  display: flex;
  align-items: center;
  margin: -4px 0 24px;
}

.sidebar-logo {
  display: block;
  width: min(215px, 100%);
  max-height: 78px;
  object-fit: contain;
  object-position: left center;
  border-radius: 12px;
}

.onboarding-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ob-brand);
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(21, 62, 53, .18);
}

.onboarding-brand-copy { display: grid; line-height: 1.1; }
.onboarding-brand-copy strong { font-size: .98rem; letter-spacing: .08em; }
.onboarding-brand-copy small { margin-top: 4px; color: var(--ob-muted); font-size: .72rem; font-weight: 600; }

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--ob-line);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: var(--ob-muted);
  font-size: .78rem;
  font-weight: 700;
}
.secure-badge svg { width: 16px; height: 16px; fill: var(--ob-brand); }

.onboarding-main { padding: 44px 0 52px; }

.onboarding-loading {
  width: min(640px, 100%);
  min-height: 150px;
  margin: 80px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--ob-line);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--ob-shadow);
}
.onboarding-loading div { display: grid; gap: 3px; }
.onboarding-loading strong { font-size: .98rem; }
.onboarding-loading span:not(.loading-spinner) { color: var(--ob-muted); font-size: .86rem; }
.loading-spinner {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 3px solid var(--ob-brand-soft);
  border-top-color: var(--ob-brand);
  border-radius: 50%;
  animation: obSpin .8s linear infinite;
}
@keyframes obSpin { to { transform: rotate(360deg); } }

.onboarding-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 26px;
}

.onboarding-sidebar {
  position: sticky;
  top: 98px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(155deg, var(--ob-brand-deep), var(--ob-brand) 62%, #1e594a);
  color: #fff;
  box-shadow: 0 26px 70px rgba(14, 47, 40, .20);
}

.onboarding-sidebar::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -110px;
  top: -80px;
  border-radius: 50%;
  border: 44px solid rgba(255,255,255,.035);
}

.sidebar-inner { position: relative; z-index: 1; padding: 30px 27px; }
.sidebar-kicker {
  margin-bottom: 10px;
  color: #cfb17e;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.onboarding-sidebar h1 {
  max-width: 290px;
  margin: 0 0 13px;
  color: #fff;
  font-size: clamp(1.75rem, 2.5vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.onboarding-sidebar > .sidebar-inner > p {
  margin: 0;
  color: rgba(255,255,255,.70);
  font-size: .88rem;
  line-height: 1.65;
}

.client-overview {
  margin: 24px 0 26px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
}
.client-overview-row {
  display: grid;
  gap: 2px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.client-overview-row:last-child { border-bottom: 0; }
.client-overview-row span { color: rgba(255,255,255,.55); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.client-overview-row strong { overflow-wrap: anywhere; font-size: .88rem; font-weight: 700; }

.onboarding-stepper {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.onboarding-stepper::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 16px;
  width: 1px;
  background: rgba(255,255,255,.14);
}
.onboarding-stepper li {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr 22px;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 7px 8px 7px 0;
  border-radius: 12px;
  color: rgba(255,255,255,.55);
  transition: .2s ease;
}
.onboarding-stepper .step-number {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: #17443a;
  font-size: .72rem;
  font-weight: 800;
}
.step-copy { min-width: 0; display: grid; line-height: 1.25; }
.step-copy strong { color: inherit; font-size: .82rem; }
.step-copy small { margin-top: 3px; color: inherit; font-size: .68rem; }
.step-check { display: none; color: #fff; font-weight: 800; }
.onboarding-stepper li.active { color: #fff; }
.onboarding-stepper li.active .step-number { border-color: var(--ob-accent); background: var(--ob-accent); color: #173b33; box-shadow: 0 0 0 4px rgba(213,156,83,.12); }
.onboarding-stepper li.completed { color: rgba(255,255,255,.82); }
.onboarding-stepper li.completed .step-number { border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.12); color: transparent; }
.onboarding-stepper li.completed .step-check { display: block; }

.sidebar-help {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-help svg { width: 18px; height: 18px; fill: #cfb17e; }
.sidebar-help div { display: grid; gap: 3px; }
.sidebar-help strong { font-size: .76rem; }
.sidebar-help span { color: rgba(255,255,255,.58); font-size: .70rem; line-height: 1.5; }

.onboarding-card {
  overflow: hidden;
  border: 1px solid var(--ob-line);
  border-radius: 24px;
  background: var(--ob-surface);
  box-shadow: var(--ob-shadow);
}

.mobile-client-strip,
.mobile-step-nav { display: none; }

.form-progress { height: 4px; background: #edf1ee; }
.form-progress span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--ob-brand), #2a705d);
  transition: width .3s ease;
}

#onboardingForm { margin: 0; }
.form-step { display: none; padding: 46px 48px 16px; }
.form-step.active { display: block; animation: obFade .24s ease; }
@keyframes obFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.step-heading {
  max-width: 690px;
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ob-line);
}
.step-eyebrow {
  margin-bottom: 9px;
  color: var(--ob-brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.step-heading h2 {
  margin: 0 0 10px;
  color: var(--ob-ink);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.step-heading p { max-width: 620px; margin: 0; color: var(--ob-muted); font-size: .92rem; line-height: 1.65; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 23px 20px;
}
.form-grid.single-column { grid-template-columns: 1fr; }
.form-field { min-width: 0; }
.form-field.full-width { grid-column: 1 / -1; }
.form-field label:not(.confirmation-check) {
  display: block;
  margin-bottom: 8px;
  color: #27342f;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .01em;
}
.form-field label:not(.confirmation-check) > span { color: #ad5a45; }
.form-field input:not([type="checkbox"]),
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid #dce3de;
  border-radius: 11px;
  background: #fbfcfb;
  color: var(--ob-ink);
  outline: none;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-field textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: #a2aba6; }
.form-field input:not([type="checkbox"]):hover,
.form-field textarea:hover,
.form-field select:hover { border-color: #cad4ce; background: #fff; }
.form-field input:not([type="checkbox"]):focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #3f7969;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(39,103,86,.09);
}
.form-field input:invalid:not(:placeholder-shown),
.form-field textarea:invalid:not(:placeholder-shown) { border-color: #d8a19b; }
.field-help { display: block; margin-top: 7px; color: var(--ob-muted); font-size: .70rem; line-height: 1.4; }

.confirmation-check {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 11px;
  padding: 15px 16px;
  border: 1px solid var(--ob-line);
  border-radius: 12px;
  background: #f8faf8;
  color: #34423c;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.confirmation-check input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #c6d0ca;
  border-radius: 6px;
  background: #fff;
  color: transparent !important;
  font-size: .70rem;
  transition: .18s ease;
}
.confirmation-check input:checked + .custom-check { border-color: var(--ob-brand); background: var(--ob-brand); color: #fff !important; }
.confirmation-check input:focus-visible + .custom-check { box-shadow: 0 0 0 4px rgba(39,103,86,.10); }

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding: 20px 48px 24px;
  border-top: 1px solid var(--ob-line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.action-progress { flex: 1; text-align: center; color: var(--ob-muted); font-size: .72rem; font-weight: 700; }
.onboarding-btn {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border: 0;
  border-radius: 11px;
  font-size: .80rem;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.onboarding-btn svg { width: 17px; height: 17px; fill: currentColor; }
.onboarding-btn:hover { transform: translateY(-1px); }
.onboarding-btn-primary { background: var(--ob-brand); color: #fff; box-shadow: 0 8px 18px rgba(21,62,53,.16); }
.onboarding-btn-primary:hover { background: #1d5446; box-shadow: 0 10px 22px rgba(21,62,53,.20); }
.onboarding-btn-secondary { border: 1px solid var(--ob-line); background: #f7f9f7; color: #3d4b45; }
.onboarding-btn-secondary:hover { background: #eef2ef; }
.onboarding-btn:disabled { opacity: .62; cursor: not-allowed; transform: none; box-shadow: none; }

.onboarding-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 600;
}
.onboarding-notice-error { border: 1px solid #e7c4c0; background: #fff5f3; color: var(--ob-danger); }
#submitError { margin: 26px 48px 0; }

.success-panel {
  width: min(760px, 100%);
  margin: 50px auto;
  padding: 56px;
  text-align: center;
  border: 1px solid var(--ob-line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--ob-shadow);
}
.success-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ob-brand-soft);
}
.success-icon svg { width: 28px; height: 28px; fill: var(--ob-brand); }
.success-kicker { margin-bottom: 10px; color: var(--ob-brand); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.success-panel h2 { max-width: 600px; margin: 0 auto 14px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -.04em; }
.success-panel > p { max-width: 570px; margin: 0 auto; color: var(--ob-muted); font-size: .92rem; line-height: 1.7; }
.success-next {
  max-width: 570px;
  display: grid;
  gap: 4px;
  margin: 28px auto 0;
  padding: 17px 18px;
  text-align: left;
  border: 1px solid var(--ob-line);
  border-radius: 14px;
  background: #f8faf8;
}
.success-next strong { font-size: .78rem; }
.success-next span { color: var(--ob-muted); font-size: .75rem; line-height: 1.55; }

.onboarding-footer { padding: 4px 0 34px; color: var(--ob-muted); }
.onboarding-footer .onboarding-shell { display: flex; justify-content: space-between; gap: 20px; font-size: .70rem; }

@media (max-width: 980px) {
  .onboarding-layout { grid-template-columns: 285px minmax(0, 1fr); gap: 18px; }
  .sidebar-inner { padding: 25px 22px; }
  .form-step { padding: 38px 32px 12px; }
  .form-actions { padding: 18px 32px 21px; }
  #submitError { margin-inline: 32px; }
}

@media (max-width: 800px) {
  .onboarding-main { padding-top: 24px; }
  .onboarding-layout { display: block; }
  .onboarding-sidebar { display: none; }
  .onboarding-card { border-radius: 20px; }
  .mobile-client-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--ob-line);
    background: #f8faf8;
  }
  .mobile-client-strip div { min-width: 0; display: grid; gap: 2px; }
  .mobile-client-strip span { color: var(--ob-muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
  .mobile-client-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
  .mobile-step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 15px 18px 12px;
  }
  .mobile-step-nav span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid var(--ob-line);
    border-radius: 50%;
    background: #fff;
    color: #8a948f;
    font-size: .65rem;
    font-weight: 800;
  }
  .mobile-step-nav span.active { border-color: var(--ob-brand); background: var(--ob-brand); color: #fff; }
  .mobile-step-nav span.completed { border-color: #cfe0d8; background: var(--ob-brand-soft); color: var(--ob-brand); }
  .form-progress { height: 3px; }
  .form-step { padding: 32px 28px 8px; }
  .form-actions { padding: 17px 28px 20px; }
  #submitError { margin-inline: 28px; }
}

@media (max-width: 600px) {
  .onboarding-shell { width: min(100% - 24px, 1180px); }
  .onboarding-topbar-inner { min-height: 64px; }
  .onboarding-brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .secure-badge { padding: 7px 10px; font-size: .68rem; }
  .secure-badge svg { width: 14px; height: 14px; }
  .onboarding-main { padding: 16px 0 30px; }
  .onboarding-card { border-radius: 16px; }
  .mobile-client-strip { padding: 14px 17px; }
  .form-step { padding: 27px 19px 4px; }
  .step-heading { margin-bottom: 26px; padding-bottom: 21px; }
  .step-heading h2 { font-size: 1.65rem; }
  .step-heading p { font-size: .82rem; }
  .form-grid { grid-template-columns: 1fr; gap: 19px; }
  .form-field.full-width { grid-column: auto; }
  .form-field input:not([type="checkbox"]),
  .form-field textarea,
  .form-field select { min-height: 48px; font-size: .85rem; }
  .form-actions { gap: 8px; padding: 15px 18px 18px; }
  .onboarding-btn { min-height: 45px; padding: 10px 14px; }
  .action-progress { display: none; }
  #prevBtn { margin-right: auto; }
  #nextBtn, #submitBtn { margin-left: auto; }
  #submitError { margin: 22px 19px 0; }
  .success-panel { margin: 24px auto; padding: 38px 22px; border-radius: 20px; }
  .onboarding-footer .onboarding-shell { flex-direction: column; align-items: center; gap: 4px; text-align: center; }
}

@media (max-width: 380px) {
  .secure-badge { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 0; }
  .secure-badge svg { width: 16px; height: 16px; }
  .mobile-client-strip { grid-template-columns: 1fr; }
  .mobile-client-strip div:last-child { display: none; }
}

/* Invisible bot-trap field. Real clients never see or fill this. */
.hp-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 640px) {
  .onboarding-logo { height: 34px; max-width: 150px; }
  .sidebar-logo { max-height: 64px; }
}
