/* ============================================================
   MyAnnuityStore.com — Annuity Application Form
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #1A4FA8;
  --blue-light: #e8f0fe;
  --blue-hover: #1444921a;
  --green:      #22c55e;
  --text:       #1a1a2e;
  --text-muted: #64748b;
  --border:     #dde3ed;
  --bg:         #f0f4f9;
  --white:      #ffffff;
  --sidebar-w:  240px;
  --header-h:   60px;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Kill Elementor sticky header padding injected via wp_head() ── */
body.apply-page,
body.apply-page.elementor-page {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
/* Offset app-header for WP admin bar when logged in */
.admin-bar .app-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .app-header { top: 46px; }
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh; }

/* ── App shell ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.app-header__logo { flex-shrink: 0; }
.logo-text { font-size: 1.1rem; font-weight: 400; color: #1a1a2e; letter-spacing: -.02em; }
.logo-text strong { font-weight: 800; }
.logo-dot { display: inline-block; width: 4px; height: 4px; background: var(--blue); border-radius: 50%; margin: 0 1px 3px; }
.logo-com { color: var(--blue); font-weight: 400; }
.app-header__product { flex: 1; text-align: center; }
.product-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.app-header__actions { flex-shrink: 0; }
.btn-ghost {
  background: var(--blue) !important;
  border: none !important;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: .85rem;
  font-weight: 600;
  color: #fff !important;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
}
.btn-ghost:hover { background: #153d82 !important; }

/* ── Body layout ── */
.app-body { display: flex; flex: 1; }

/* ── Sidebar ── */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 0 20px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.admin-bar .app-sidebar { top: calc(var(--header-h) + 32px); height: calc(100vh - var(--header-h) - 32px); }

.step-nav { flex: 1; padding: 0 16px; }
.step-nav__list { list-style: none; }
.step-nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: default;
  transition: background .15s;
  position: relative;
}
/* Connector line between steps */
.step-nav__item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 25px;
  top: 38px;
  width: 2px;
  height: 16px;
  background: #e5e7eb;
}
.step-nav__item.completed:not(:last-child)::after { background: var(--blue); opacity: .3; }
.step-nav__indicator {
  width: 30px;
  height: 30px;
  position: relative;
  flex-shrink: 0;
}
.step-nav__indicator svg { width: 30px; height: 30px; position: absolute; top: 0; left: 0; color: #d1d5db; }
.step-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #9ca3af;
}
.check-path { opacity: 0; }
.step-nav__label { font-size: .85rem; font-weight: 500; color: #9ca3af; line-height: 1.35; }

/* Active step */
.step-nav__item.active { background: var(--blue-light); }
.step-nav__item.active .step-nav__indicator svg { color: var(--blue); }
.step-nav__item.active .step-number { color: var(--blue); font-weight: 800; }
.step-nav__item.active .step-nav__label { color: var(--blue); font-weight: 600; }

/* Completed step */
.step-nav__item.completed .step-nav__indicator svg { color: var(--blue); }
.step-nav__item.completed .check-path { opacity: 1; }
.step-nav__item.completed .step-number { opacity: 0; }
.step-nav__item.completed .step-nav__label { color: var(--text); font-weight: 500; }

/* Sidebar actions */
.sidebar-actions { padding: 16px 20px; border-top: 1px solid var(--border); }
.btn-save-exit {
  display: block; width: 100%;
  background: none; border: 1.5px solid var(--blue);
  border-radius: var(--radius); padding: 10px 12px;
  font-size: .85rem; font-weight: 600; color: var(--blue);
  cursor: pointer; font-family: var(--font); margin-bottom: 10px;
  transition: background .15s;
}
.btn-save-exit:hover { background: var(--blue-light); }
.btn-cancel {
  display: block; width: 100%; text-align: center;
  background: none; border: none;
  font-size: .85rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; font-family: var(--font);
  padding: 6px 0;
  text-decoration: none;
}
.btn-cancel:hover { color: #ef4444; }

/* Progress bar */
.progress-bar-wrap { padding: 12px 20px; }
.progress-bar-track { height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.progress-bar-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: .75rem; color: var(--text-muted); display: flex; justify-content: space-between; }

/* ── Main ── */
.app-main { flex: 1; padding: 36px 48px 80px; max-width: 840px; }

/* ── Form steps ── */
.form-step { display: none; animation: stepIn .22s ease; }
.form-step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.step-header { margin-bottom: 32px; }
.step-title { font-size: 1.9rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.step-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Form sections ── */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}
.form-section__title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.form-section__desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 16px; margin-top: -12px; }
.form-subsection__title { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 16px; }

.required-note { font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-left: auto; }
.optional-note { font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.req { color: #ef4444; }

/* ── Field grid ── */
.field-grid { display: grid; gap: 24px; margin-bottom: 24px; }
.field-grid--2 { grid-template-columns: 1fr 1fr; }
.field-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

/* Standalone fields (not in a grid) get bottom spacing */
.field { display: flex; flex-direction: column; gap: 8px; }
.form-section > .field { margin-bottom: 24px; }
.field-label { font-size: .85rem; font-weight: 600; color: #374151; }
.field-input, .field-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
.field-input:focus, .field-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,79,168,.1);
}
.field-input.error, .field-select.error { border-color: #ef4444; }
.field-input::placeholder { color: #c4c9d4; }
.field-hint { font-size: .78rem; color: var(--text-muted); }
.field-hint-inline { font-size: .78rem; color: var(--text-muted); font-weight: 400; }

/* Select chevron */
.field-select { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* SSN toggle */
.field-input-wrap { position: relative; }
.field-input-wrap .field-input { padding-right: 44px; }
.field-toggle-vis { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; }
.field-toggle-vis:hover { color: var(--blue); }

/* Currency input */
.field-currency { position: relative; }
.currency-symbol { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .9rem; color: var(--text-muted); pointer-events: none; z-index: 1; }
.field-currency .field-input { padding-left: 28px; }

/* Info banner */
.info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .82rem;
  color: #1e40af;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Net worth row */
.networth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.networth-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.networth-card--highlight {
  background: var(--blue-light);
  border-color: var(--blue);
}
.networth-card__label { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.networth-card__value { font-size: 1.6rem; font-weight: 700; color: var(--blue); }
.networth-card__hint { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }
.networth-card--highlight .networth-card__label { color: var(--blue); }
.networth-card--highlight .field-currency .field-input { background: var(--white); }

/* Checkboxes */
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
.checkbox-item span { font-size: .875rem; color: #374151; }

/* Risk scale */
.risk-scale { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.risk-item { flex: 1; }
.risk-item input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.risk-label {
  display: block;
  text-align: center;
  padding: 10px 6px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background .15s, color .15s;
  line-height: 1.3;
}
.risk-item:last-child .risk-label { border-right: none; }
.risk-item input[type="radio"]:checked + .risk-label {
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}
.risk-label:hover { background: var(--blue-light); color: var(--blue); }

/* Yes/No questions */
.yn-questions { display: flex; flex-direction: column; gap: 0; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.yn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.yn-row:last-child { border-bottom: none; }
.yn-row:hover { background: #fafbfc; }
.yn-question { font-size: .875rem; color: #374151; flex: 1; line-height: 1.45; }
.yn-btns { display: flex; gap: 6px; flex-shrink: 0; }
.yn-btn {
  padding: 6px 18px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.yn-btn:hover { border-color: var(--blue); color: var(--blue); }
.yn-btn.selected-yes { background: var(--blue); border-color: var(--blue); color: var(--white); }
.yn-btn.selected-no  { background: #f1f5f9; border-color: #94a3b8; color: #334155; }

/* Add section button */
.btn-add-section {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: 1.5px dashed var(--blue);
  border-radius: var(--radius);
  background: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s;
}
.btn-add-section:hover { background: var(--blue-light); }

/* Collapsible sections */
.collapsible { display: none; }
.collapsible.open { display: block; }

/* Beneficiary percentage tracker */
.ben-pct-tracker { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 10px 14px; background: #f0f4f9; border-radius: 8px; font-size: .875rem; }
.ben-pct-tracker__label { color: var(--text-muted); font-weight: 500; }
.ben-pct-tracker__value { font-weight: 700; }
.ben-pct-tracker__value.ok { color: #16a34a; }
.ben-pct-tracker__value.over { color: #ef4444; }
.ben-pct-tracker__value.under { color: #d97706; }

/* Beneficiary cards */
.ben-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ben-card__pct { font-size: 1.1rem; font-weight: 700; color: var(--blue); min-width: 48px; text-align: right; margin-right: 16px; }
.ben-card__info { }
.ben-card__name { font-weight: 600; font-size: .9rem; }
.ben-card__meta { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.ben-card__actions { display: flex; gap: 8px; }
.ben-card__btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: .8rem; cursor: pointer; font-family: var(--font); }
.ben-card__btn--remove { color: #ef4444; border-color: #fca5a5; }
.ben-card__btn--remove:hover { background: #fef2f2; }
.ben-card__btn--edit { color: var(--blue); }
.ben-card__btn--edit:hover { background: var(--blue-light); }

/* Funding source cards */
.funding-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
}
.funding-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.funding-card__title { font-weight: 600; font-size: .9rem; }
.funding-card__remove { background: none; border: none; color: #ef4444; cursor: pointer; font-size: .8rem; font-family: var(--font); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 4px;
}
.modal-title { font-size: 1.15rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 20px 24px 24px; }

/* Type toggle (Individual / Trust) */
.type-toggle { display: flex; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.type-toggle__btn {
  flex: 1; padding: 10px;
  background: none; border: none;
  font-size: .9rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer; font-family: var(--font);
  transition: background .15s, color .15s;
}
.type-toggle__btn.active { background: var(--blue); color: var(--white); }
.type-toggle__btn:first-child { border-right: 1.5px solid var(--border); }

/* ── Review step ── */
.review-section {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.review-section__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.review-section__title { font-size: .95rem; font-weight: 700; }
.review-edit-btn { background: none; border: 1px solid var(--blue); border-radius: 6px; padding: 5px 14px; font-size: .8rem; font-weight: 600; color: var(--blue); cursor: pointer; font-family: var(--font); }
.review-edit-btn:hover { background: var(--blue-light); }
.review-section__body { padding: 16px 20px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.review-item__label { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.review-item__value { font-size: .9rem; color: var(--text); margin-top: 2px; font-weight: 500; }

/* Disclosure */
.disclosure-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Submit button */
.btn-submit {
  display: block; width: 100%;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, transform .1s;
}
.btn-submit:hover { background: #153d82; transform: translateY(-1px); }
.btn-submit:active { transform: none; }

/* Spinner + success */
.submit-spinner { display: none; align-items: center; justify-content: center; gap: 10px; padding: 20px; font-size: .9rem; color: var(--text-muted); }
.submit-spinner.active { display: flex; }
.spinner-svg { width: 28px; height: 28px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.submit-success { display: none; text-align: center; padding: 40px 20px; }
.submit-success.active { display: block; }
.submit-success h2 { font-size: 1.4rem; margin: 16px 0 8px; color: var(--text); }
.submit-success p { color: var(--text-muted); }

/* ── Step footer ── */
.step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.btn-back {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 11px 20px;
  font-size: .9rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; font-family: var(--font); transition: all .15s;
}
.btn-back:hover { border-color: var(--blue); color: var(--blue); }
.btn-back.hidden { visibility: hidden; }
.btn-continue {
  display: flex; align-items: center; gap: 6px;
  background: var(--blue); border: none;
  border-radius: var(--radius); padding: 11px 28px;
  font-size: .9rem; font-weight: 700; color: var(--white);
  cursor: pointer; font-family: var(--font); transition: background .15s, transform .1s;
}
.btn-continue:hover { background: #153d82; transform: translateY(-1px); }
.btn-continue.hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-sidebar { display: none; }
  .app-main { padding: 24px 20px 60px; max-width: 100%; }
  .field-grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .field-grid--2, .field-grid--3 { grid-template-columns: 1fr; }
  .networth-row { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .risk-scale { flex-direction: column; }
  .risk-label { border-right: none !important; border-bottom: 1px solid var(--border); }
  .yn-row { flex-direction: column; align-items: flex-start; }
}

/* ── Product Banner ── */
.product-banner {
  background: linear-gradient(135deg, #1A4FA8 0%, #0c2d6b 100%);
  border-radius: 12px;
  padding: 22px 28px;
  margin-bottom: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.product-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.product-banner__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
}
.product-banner__name {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.product-banner__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-banner__meta span {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ── Step title refinement ── */
.step-title { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -.02em; }

/* ── Form section refinement ── */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.form-section__title { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); padding-bottom: 12px; }

/* ── Field improvements ── */
.field-input, .field-select {
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: .9rem;
  background: #fafbfc;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field-input:focus, .field-select:focus {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,79,168,.08);
}

