/* ===== Design tokens ===== */
:root {
  --navy: #1B365D;
  --navy-dark: #122544;
  --navy-soft: #2c4d7a;
  --orange: #E8962E;
  --orange-dark: #c97d1c;
  --cream: #FAF7F2;
  --cream-2: #f3eee5;
  --sage: #38A169;
  --amber: #D69E2E;
  --ink: #1a202c;
  --ink-2: #2d3748;
  --muted: #4a5568;
  --line: #d8d2c7;
  --line-2: #e8e2d6;
  --white: #ffffff;
  --danger: #c53030;
  --focus: #3182ce;

  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-body: 21px;
  --fs-input: 26px;
  --fs-h1: clamp(30px, 4vw, 36px);
  --fs-h2: clamp(24px, 3vw, 28px);
  --fs-h3: 22px;
  --fs-meta: 19px;
  --lh-body: 1.6;

  --radius: 12px;
  --radius-lg: 16px;
  --tap: 56px;
  --tap-lg: 64px;

  --shadow-sm: 0 1px 2px rgba(18, 37, 68, 0.06), 0 1px 3px rgba(18, 37, 68, 0.08);
  --shadow-md: 0 4px 12px rgba(18, 37, 68, 0.10);
  --shadow-lg: 0 12px 32px rgba(18, 37, 68, 0.18);

  --gap: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;

  --max-w: 1200px;
  --max-w-wide: 1200px;
  --max-w-narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--cream);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--navy-dark); }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.rmc-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rmc-stage {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap) calc(var(--gap-xl) * 2);
}

.rmc-screens { width: 100%; }

.rmc-trust {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.rmc-trust-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 12px var(--gap);
  display: flex;
  align-items: center;
  gap: 12px;
}
.rmc-trust-logo {
  height: 44px;
  width: auto;
  flex: 0 0 auto;
}
.rmc-trust-text {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-meta);
  color: var(--ink-2);
}
.rmc-trust-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rmc-trust-row:first-child { font-weight: 600; color: var(--navy); }
.rmc-trust-meta { color: var(--muted); font-size: 17px; }
.rmc-trust-dot { color: var(--line); }
.rmc-trust-text a { color: var(--muted); text-decoration: none; font-weight: 600; }
.rmc-trust-text a:hover { color: var(--navy); text-decoration: underline; }

.rmc-account-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--cream-2);
  color: var(--navy);
  font-weight: 600;
  font-size: var(--fs-meta);
}
.rmc-account-btn:hover { background: var(--line-2); }

@media (max-width: 520px) {
  .rmc-trust-meta { display: none; }
  .rmc-trust-logo { height: 36px; }
  .rmc-account-btn { padding: 0 12px; }
}

.rmc-progress {
  height: 6px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--gap-lg);
}
.rmc-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--navy);
  transition: width 280ms ease;
}

.rmc-error {
  margin-bottom: var(--gap);
  padding: 14px 16px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: var(--danger);
  border-radius: var(--radius);
  font-weight: 600;
}

.rmc-foot {
  width: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap);
  font-size: 17px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line-2);
}
.rmc-foot p { margin: 6px 0; }
.rmc-foot-account { margin-top: 14px !important; }
.rmc-foot-account a { color: var(--navy); font-weight: 600; }

.rmc-screen {
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl) var(--gap-lg);
  box-shadow: var(--shadow-sm);
}
.rmc-screen + .rmc-screen { margin-top: var(--gap-lg); }

/* Narrow screens (welcome, processing, OTP verify) — keep them tight and centered
   inside the wider 1200px stage. Looks better than stretched. */
.rmc-screen-narrow {
  max-width: var(--max-w-narrow);
  margin-left: auto;
  margin-right: auto;
}

/* On desktop, split input steps into 2 columns: title/copy on the left,
   form fields on the right. The first three children (eyebrow, title, sub)
   go in the left column; everything else flows in the right column. */
@media (min-width: 900px) {
  .rmc-screen-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--gap-xl);
    row-gap: 16px;
    align-items: start;
    padding: var(--gap-xl);
  }
  .rmc-screen-split > .rmc-screen-eyebrow,
  .rmc-screen-split > .rmc-screen-title,
  .rmc-screen-split > .rmc-screen-sub {
    grid-column: 1;
    margin-bottom: 0;
  }
  .rmc-screen-split > *:not(.rmc-screen-eyebrow):not(.rmc-screen-title):not(.rmc-screen-sub) {
    grid-column: 2;
  }
  /* Make the title block stick to the top of the form column visually */
  .rmc-screen-split > .rmc-screen-title { font-size: clamp(26px, 2.6vw, 32px); }
}

.rmc-screen-eyebrow {
  font-size: var(--fs-meta);
  font-weight: 700;
  color: var(--navy-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.rmc-screen-title {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
  line-height: 1.2;
}
.rmc-screen-sub {
  font-size: var(--fs-body);
  color: var(--ink-2);
  margin: 0 0 var(--gap-lg);
}

.rmc-field { margin-bottom: var(--gap-lg); }
.rmc-label {
  display: block;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}
.rmc-help {
  font-size: var(--fs-meta);
  color: var(--muted);
  margin: 6px 0 0;
}

.rmc-input,
.rmc-select {
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  font-size: var(--fs-input);
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}
.rmc-input:focus,
.rmc-select:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--navy);
}

.rmc-money-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.rmc-money-row:focus-within { border-color: var(--navy); outline: 3px solid var(--focus); outline-offset: 1px; }
.rmc-money-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--cream-2);
  font-size: var(--fs-input);
  font-weight: 700;
  color: var(--navy);
  border-right: 2px solid var(--line);
}
.rmc-money-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  font-size: var(--fs-input);
  font-family: inherit;
  background: transparent;
  color: var(--ink);
}

.rmc-slider-wrap { padding: 4px 4px 0; }
.rmc-slider {
  width: 100%;
  height: 40px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.rmc-slider:focus { outline: none; }
.rmc-slider::-webkit-slider-runnable-track {
  height: 12px;
  background: var(--cream-2);
  border-radius: 999px;
}
.rmc-slider::-moz-range-track {
  height: 12px;
  background: var(--cream-2);
  border-radius: 999px;
}
.rmc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  border: 4px solid var(--white);
  box-shadow: var(--shadow-md);
  margin-top: -12px;
  cursor: pointer;
}
.rmc-slider::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  border: 4px solid var(--white);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.rmc-slider:focus::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.4); }
.rmc-slider:focus::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.4); }

.rmc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.rmc-chip {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--navy);
  font-weight: 600;
  font-size: var(--fs-meta);
  border: 2px solid transparent;
}
.rmc-chip:hover { background: var(--line-2); }
.rmc-chip.is-active { background: var(--navy); color: var(--white); }

.rmc-options {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
.rmc-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: var(--tap-lg);
  padding: 16px 18px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.rmc-option:hover { border-color: var(--navy-soft); }
.rmc-option.is-active { border-color: var(--navy); background: var(--cream-2); }
.rmc-option-sub {
  margin-top: 4px;
  font-size: var(--fs-meta);
  font-weight: 400;
  color: var(--muted);
}

.rmc-dob-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 10px;
}

.rmc-actions {
  display: flex;
  gap: 12px;
  margin-top: var(--gap-lg);
}
.rmc-actions.rmc-actions-stack { flex-direction: column; }

.rmc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 22px;
  border-radius: var(--radius);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 120ms ease, transform 80ms ease;
}
.rmc-btn:active { transform: translateY(1px); }
.rmc-btn-primary { background: var(--navy); color: var(--white); }
.rmc-btn-primary:hover { background: var(--navy-dark); }
.rmc-btn-accent { background: var(--orange); color: var(--white); }
.rmc-btn-accent:hover { background: var(--orange-dark); }
.rmc-btn-ghost { background: var(--cream-2); color: var(--navy); }
.rmc-btn-ghost:hover { background: var(--line-2); }
.rmc-btn-link { background: transparent; color: var(--navy); text-decoration: underline; min-height: 44px; padding: 0 8px; }
.rmc-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.rmc-btn-block { flex: 1 1 auto; }

.rmc-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--cream-2);
  border-top-color: var(--navy);
  border-radius: 50%;
  margin: 0 auto var(--gap);
  animation: rmc-spin 900ms linear infinite;
}
@keyframes rmc-spin { to { transform: rotate(360deg); } }

.rmc-processing-steps {
  list-style: none;
  margin: var(--gap) 0 0;
  padding: 0;
  font-size: var(--fs-meta);
  color: var(--muted);
}
.rmc-processing-steps li { padding: 6px 0; }
.rmc-processing-steps li.is-done { color: var(--sage); font-weight: 600; }
.rmc-processing-steps li.is-active { color: var(--navy); font-weight: 600; }

.rmc-otp-input {
  width: 100%;
  min-height: 72px;
  font-size: 32px;
  letter-spacing: 0.4em;
  text-align: center;
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  color: var(--navy);
  background: var(--white);
}
.rmc-otp-input:focus { border-color: var(--navy); outline: 3px solid var(--focus); outline-offset: 1px; }
.rmc-otp-meta { text-align: center; font-size: var(--fs-meta); color: var(--muted); margin-top: 12px; }

.rmc-summary {
  background: var(--cream-2);
  padding: 16px 18px;
  border-radius: var(--radius);
  margin-bottom: var(--gap-lg);
}
.rmc-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: var(--fs-meta);
}
.rmc-summary-row strong { color: var(--navy); font-weight: 700; }

.rmc-results-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--gap-xl);
  align-items: center;
}
.rmc-results-numbers { display: flex; flex-direction: column; gap: 12px; }
.rmc-result-stat {
  background: var(--cream-2);
  padding: 18px 20px;
  border-radius: var(--radius);
}
.rmc-result-stat-label {
  font-size: var(--fs-meta);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.rmc-result-stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.rmc-chart-wrap { position: relative; max-width: 360px; margin: 0 auto; }

.rmc-chart-heading { text-align: center; margin: 0 0 14px; }
.rmc-chart-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 4px;
}
.rmc-chart-program {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}
.rmc-chart-note {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  text-align: center;
  margin: 14px 0 0;
}

.rmc-products {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--gap-lg);
}
.rmc-product {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--white);
}
.rmc-product.is-best { border-color: var(--navy); background: var(--cream-2); }
.rmc-product-name { font-size: var(--fs-h3); font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.rmc-product-rate { font-size: 17px; color: var(--muted); margin: 0 0 10px; }
.rmc-product-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--fs-meta); }
.rmc-product-row span:last-child { font-weight: 600; color: var(--ink); }

.rmc-contact-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--gap-lg);
}
.rmc-contact-row .rmc-btn { width: 100%; }

.rmc-callout {
  margin-top: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  background: var(--cream-2);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: var(--fs-meta);
  color: var(--ink-2);
}
.rmc-callout strong { color: var(--navy); }
.rmc-callout-warn { border-left-color: var(--amber); }
.rmc-callout-warn strong { color: #7a4f02; }
.rmc-result-stat-value-neg { color: var(--danger); }
.rmc-result-stat-help { font-size: 16px; color: var(--muted); margin: 4px 0 0; }
.rmc-shortfall-actions { margin-top: var(--gap-lg); }

/* Landing-mode top header (paid-ad destination only) */
.rmc-landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 10;
}
.rmc-landing-logo { display: inline-flex; align-items: center; }
.rmc-landing-logo img { height: 38px; width: auto; display: block; }
.rmc-landing-signin {
  background: transparent;
  border: 1.5px solid var(--navy, #1B365D);
  color: var(--navy, #1B365D);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}
.rmc-landing-signin:hover { background: var(--navy, #1B365D); color: #fff; }
@media (max-width: 640px) {
  .rmc-landing-header { padding: 10px 16px; }
  .rmc-landing-logo img { height: 32px; }
  .rmc-landing-signin { font-size: 14px; padding: 8px 16px; }
}

.rmc-proposal {
  margin-top: var(--gap-lg);
  background: var(--cream-2);
  border: 2px solid var(--accent, #E8962E);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  text-align: center;
}
.rmc-proposal-title { margin: 0 0 6px; color: var(--navy); font-size: var(--fs-h3); }
.rmc-proposal-sub { margin: 0 0 14px; color: var(--ink-2); font-size: var(--fs-meta); }
.rmc-proposal-btn { font-weight: 700; }
.rmc-proposal-status { margin: 12px 0 0; color: var(--ink-2); font-size: 17px; }

.rmc-heirs {
  margin-top: var(--gap-lg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px;
}
.rmc-heirs h3 { margin: 0 0 8px; color: var(--navy); font-size: var(--fs-h3); }
.rmc-heirs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.rmc-heirs-cell { background: var(--cream-2); border-radius: 10px; padding: 12px; text-align: center; }
.rmc-heirs-cell strong { display: block; font-size: 20px; color: var(--navy); }
.rmc-heirs-cell span { font-size: 16px; color: var(--muted); }

.rmc-specialist {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: var(--gap-lg);
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.rmc-specialist-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cream-2);
}
.rmc-specialist-name { margin: 0; font-weight: 700; color: var(--navy); font-size: var(--fs-h3); }
.rmc-specialist-tag { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); }

.rmc-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
}
.rmc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 37, 68, 0.5);
}
.rmc-modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl) var(--gap-lg) var(--gap-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.rmc-modal-card-wide { max-width: 760px; }
.rmc-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  color: var(--muted);
}
.rmc-modal-close:hover { background: var(--cream-2); color: var(--navy); }
.rmc-modal-title {
  margin: 0 0 var(--gap-lg);
  font-size: var(--fs-h2);
  color: var(--navy);
}

.rmc-account-body { display: flex; flex-direction: column; gap: 12px; }

.rmc-calendar-frame iframe { width: 100%; min-height: 560px; border: 0; border-radius: var(--radius); }

.rmc-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 12px rgba(18, 37, 68, 0.08);
}
.rmc-sticky-cta {
  flex: 1;
  min-height: var(--tap);
  border-radius: var(--radius);
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-h3);
}
.rmc-sticky-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-size: 24px;
}
.rmc-sticky-call::before { content: "☎"; }

.rmc-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 110;
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: var(--fs-meta);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  text-align: center;
}

@media (max-width: 640px) {
  .rmc-stage { padding: var(--gap) 12px calc(var(--gap-xl) * 2); }
  .rmc-screen { padding: var(--gap-lg) var(--gap); border-radius: var(--radius); }
  .rmc-screen-split { display: block; padding: var(--gap-lg) var(--gap); }
  .rmc-results-hero { grid-template-columns: 1fr; }
  .rmc-options { grid-template-columns: 1fr; }
  .rmc-contact-row { grid-template-columns: 1fr; }
  .rmc-heirs-grid { grid-template-columns: 1fr; }
  .rmc-actions { flex-direction: column; }
  .rmc-actions .rmc-btn { width: 100%; }
  .rmc-sticky { display: flex; }
  .rmc-stage { padding-bottom: 96px; }
}
