/* ═══════════════════════════════════════════════════════════════════
   shell.css  —  FinNavigator™ v1.0
   Page layout, sidebar, topbar, card shell, navigation, toast
   ═══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════════════════════ */

.fn-page {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.fn-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.fn-main-nosidebar { margin-left: 0; }

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════ */

.fn-sidebar {
  width:      var(--sidebar-w);
  min-width:  var(--sidebar-w);
  background: var(--navy);
  display:    flex;
  flex-direction: column;
  position:   fixed;
  top: 0; left: 0; bottom: 0;
  z-index:    200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.fn-sidebar::-webkit-scrollbar { display: none; }

/* Branding block */
.fn-sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: rgba(255,255,255,.1);
}
.fn-sb-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: var(--navy);
  flex-shrink: 0; overflow: hidden;
}
.fn-sb-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.fn-sb-brand-text  { display: flex; flex-direction: column; }
.fn-sb-firm-name   { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.fn-sb-firm-sub    { font-size: 10px; color: rgba(255,255,255,.45); }
.fn-sb-powered     { font-size: 10px; font-style: italic; color: rgba(255,255,255,.7); margin-top: 2px; }

/* Back to homepage button */
.fn-sb-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 12px 0;
  padding: 7px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  flex-shrink: 0;
}
.fn-sb-home-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Progress ring */
.fn-sb-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.fn-sb-ring { width: 44px; height: 44px; flex-shrink: 0; }
.fn-sb-prog-num   { font-size: 18px; font-weight: 800; color: var(--gold); line-height: 1; }
.fn-sb-prog-label { font-size: 10px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; }

/* Nav */
.fn-sb-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.fn-sb-nav::-webkit-scrollbar { display: none; }

.fn-sb-group { margin-bottom: 4px; }
.fn-sb-group-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 16px 4px;
}
.fn-sb-group-label-advisor { color: rgba(200,168,75,.6); }

/* Nav items */
.fn-sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .15s, color .15s;
  position: relative;
}
.fn-sb-item:hover { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.fn-sb-item.done  { color: rgba(255,255,255,.6); }
.fn-sb-item.done:hover { color: #fff; }
.fn-sb-item.done .fn-sb-item-icon { color: #4ade80; font-size: 11px; font-weight: 800; }
.fn-sb-item.active { background: rgba(200,168,75,.12); color: #fff; font-weight: 700; }
.fn-sb-item-icon   { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.fn-sb-item-label  { flex: 1; }
.fn-sb-item-pip {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--gold); border-radius: 3px 0 0 3px;
}

/* Bottom actions */
.fn-sb-actions {
  padding: 10px 12px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}
.fn-sb-autosave { font-size: 10px; color: var(--gold); font-weight: 600; min-height: 14px; text-align: center; }
.fn-sb-version {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: rgba(255,255,255,.05);
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.07);
  margin-bottom: 2px;
}
.fn-sb-ver-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.4); text-transform: uppercase; }
.fn-sb-ver-num   { font-size: 12px; font-weight: 800; color: var(--gold); font-family: 'Courier New', monospace; }
.fn-sb-btn {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; border: none; transition: opacity .15s;
}
.fn-sb-btn:hover { opacity: .85; }
.fn-sb-btn-save  { background: rgba(255,255,255,.09); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.fn-sb-btn-clear { background: rgba(220,38,38,.12);  color: #fca5a5; border: 1px solid rgba(220,38,38,.2); }

/* Overlay (mobile) */
.fn-sb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 190;
  backdrop-filter: blur(2px);
}
.fn-sb-overlay.open { display: block; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE TOPBAR
   ══════════════════════════════════════════════════════════════════ */

.fn-topbar-mobile {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--navy-mid);
  z-index: 150;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.fn-hamburger {
  background: none; border: none; padding: 4px;
  display: flex; flex-direction: column; gap: 5px;
}
.fn-hamburger span { display: block; width: 22px; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; }
.fn-mb-brand   { display: flex; align-items: center; gap: 8px; flex: 1; }
.fn-mb-prog    { display: flex; align-items: center; gap: 8px; }
.fn-mb-bar-wrap{ width: 80px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.fn-mb-bar     { height: 100%; background: var(--gold); border-radius: 2px; transition: width .4s; }

/* ══════════════════════════════════════════════════════════════════
   PILL NAV
   ══════════════════════════════════════════════════════════════════ */

.fn-pills-wrap {
  padding: 10px 24px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 100;
}
.fn-pill-row {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none;
}
.fn-pill-row::-webkit-scrollbar { display: none; }
.fn-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: var(--bg); color: var(--text-light);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  transition: all .15s;
}
.fn-pill:hover  { border-color: var(--blue); color: var(--blue); background: var(--light-blue); }
.fn-pill.done   { border-color: var(--green-bdr); color: var(--green); background: var(--green-bg); }
.fn-pill.active {
  background: var(--navy); color: #fff; border-color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.fn-pill-review { font-style: italic; }
.fn-step-counter {
  font-size: 11px; color: var(--muted); text-align: center;
  padding: 4px 0 6px;
}

/* ══════════════════════════════════════════════════════════════════
   WIZARD CARD
   ══════════════════════════════════════════════════════════════════ */

.fn-card {
  /* Full width — fills the content area like v10.8.6 */
  width: 100%;
  margin: 0;
  padding: 0;
}

.fn-card-header {
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: 0;
  padding: 24px 30px;
  position: relative; overflow: hidden;
}
.fn-card-header::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.fn-card-icon   { font-size: 28px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.fn-card-titles { flex: 1; min-width: 0; }
.fn-card-title  { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: #fff; line-height: 1.2; }
.fn-card-title::after { content: ' —'; color: rgba(255,255,255,.3); font-weight: 300; }
.fn-card-sub    { font-size: 13px; color: rgba(255,255,255,.82); margin-top: 4px; line-height: 1.4; }

.fn-card-body {
  background: var(--surface);
  border: none;
  border-top: none;
  padding: var(--card-pad);

}

.fn-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface);
  border-top: 1.5px solid var(--border-light);
  border-radius: 0;
  padding: 16px 30px;
  position: sticky; bottom: 0; z-index: 10;
}
.fn-nav-step { font-size: 12px; color: var(--muted); }

.fn-btn-back {
  padding: 9px 20px;
  background: var(--surface); color: var(--navy-mid);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: border-color .15s;
}
.fn-btn-back:hover:not(:disabled) { border-color: var(--navy); }
.fn-btn-back:disabled { opacity: .4; cursor: default; }

.fn-btn-next {
  padding: 10px 24px;
  background: var(--navy); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  transition: background .15s, transform .1s;
}
.fn-btn-next:hover { background: var(--navy-mid); transform: translateY(-1px); }

/* Generic primary button */
.fn-btn-primary {
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(15,37,64,.25);
  transition: opacity .15s;
}
.fn-btn-primary:hover { opacity: .88; }

/* ══════════════════════════════════════════════════════════════════
   TOAST + RESUME BANNER + ERROR CARD
   ══════════════════════════════════════════════════════════════════ */

.fn-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff;
  padding: 10px 22px; border-radius: 24px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  box-shadow: var(--shadow-lg); z-index: 9999;
  opacity: 0; transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; white-space: nowrap;
}
.fn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

.fn-resume-banner {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--surface);
  border: 1.5px solid var(--light-blue);
  border-radius: var(--radius); padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); flex-wrap: wrap; justify-content: center;
}
.fn-resume-banner span { font-weight: 600; color: var(--navy); font-size: 13px; }
.fn-btn-resume  { padding: 8px 18px; background: var(--navy); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.fn-btn-dismiss { padding: 8px 14px; background: none; color: var(--muted); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; }

.fn-error-card {
  max-width: 480px; margin: 60px auto; padding: 40px;
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--red-bdr);
  text-align: center; box-shadow: var(--shadow);
}
.fn-error-icon  { font-size: 36px; margin-bottom: 14px; }
.fn-error-title { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.fn-error-msg   { font-size: 12px; color: var(--muted); margin-bottom: 20px; font-family: monospace; background: var(--red-bg); padding: 8px 12px; border-radius: var(--radius-xs); }

.fn-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px; color: var(--muted); font-size: 13px;
}
.fn-loading-icon { font-size: 32px; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .fn-sidebar { transform: translateX(-100%); width: 240px; }
  .fn-sidebar.open { transform: translateX(0); }
  .fn-topbar-mobile { display: flex; }
  .fn-main { margin-left: 0; padding-top: 52px; }
  .fn-main-nosidebar { padding-top: 0; }
  .fn-pills-wrap { display: none; }
}

@media (max-width: 600px) {
  .fn-card { margin: 0; padding: 0; }
  .fn-card-header { padding: 16px 18px; gap: 12px; border-radius: 0; }
  .fn-card-title  { font-size: 18px; }
  .fn-card-body   { padding: var(--card-pad-sm); border-radius: 0; }
  .fn-nav         { padding: 12px 16px; border-radius: 0; gap: 8px; }
  .fn-nav-step    { display: none; }
}

@media (max-width: 400px) {
  .fn-card-header { padding: 12px 14px; }
  .fn-card-body   { padding: 14px 12px; }
}

/* ── Legacy button class aliases (used by carried-over review/insurance renderers) ── */
.btn-back {
  padding: 9px 20px;
  background: var(--surface); color: var(--navy-mid);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s;
}
.btn-back:hover:not(:disabled) { border-color: var(--navy); }
.btn-back:disabled { opacity: .4; cursor: default; }
.btn-next {
  padding: 10px 24px;
  background: var(--navy); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-next:hover { background: var(--navy-mid); transform: translateY(-1px); }
.btn-nav { /* alias used in some legacy nav */ }
