/* ==========================================================================
   Retirement Planning Page
   ========================================================================== */

/* ── Step Progress Bar (shared component) ── */
.step-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 0;
}

.spb-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  color: var(--nav-gray-light, #9CA3AF);
  font-family: Inter, sans-serif;
}

.spb-step:hover {
  background: #f9fafb;
}

.spb-step.active {
  color: #1E40AF;
}

.spb-step.completed {
  color: #059669;
}

.spb-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: #f3f4f6;
  color: #9CA3AF;
  transition: all 0.2s;
}

.spb-step.active .spb-circle {
  background: #1E40AF;
  color: #fff;
}

.spb-step.completed .spb-circle {
  background: #059669;
  color: #fff;
}

.spb-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.spb-connector {
  width: 32px;
  height: 2px;
  background: #e5e7eb;
  flex-shrink: 0;
  border-radius: 1px;
  transition: background 0.2s;
}

.spb-connector.completed {
  background: #059669;
}

@media (max-width: 640px) {
  .spb-label { display: none; }
  .spb-step { padding: 6px 8px; }
  .spb-connector { width: 20px; }
}

/* ── Page Layout ── */
.rp-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .rp-container {
    padding: 24px;
  }
}

.rp-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 20px 24px;
}

.rp-step-header {
  margin-bottom: 20px;
}

.rp-step-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
  font-family: Inter, sans-serif;
}

.rp-step-desc {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
}

/* ── Navigation Buttons ── */
.rp-nav {
  display: flex;
  justify-content: space-between;
}

.rp-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: Inter, sans-serif;
}

.rp-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rp-nav-prev {
  background: #fff;
  color: #6B7280;
  border: 1px solid #e5e7eb;
}

.rp-nav-prev:not(:disabled):hover {
  background: #f9fafb;
}

.rp-nav-next {
  background: #1E40AF;
  color: #fff;
}

.rp-nav-next:not(:disabled):hover {
  background: #1E3A8A;
}

.rp-nav-next:not(:disabled):active {
  transform: scale(0.98);
}

/* ── Gap Calculator ── */
.rgc-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .rgc-input-grid { grid-template-columns: 1fr; }
}

.rgc-label {
  display: block;
  font-size: 12px;
  color: #6B7280;
  font-weight: 500;
  margin-bottom: 4px;
}

.rgc-select {
  width: 100%;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: Inter, sans-serif;
  color: #111827;
  appearance: auto;
}

.rgc-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #3B82F6;
}

/* Gap Alert */
.rgc-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.rgc-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rgc-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.rgc-alert-title {
  font-size: 18px;
  font-weight: 700;
  color: #DC2626;
  margin: 0 0 4px 0;
}

.rgc-alert-desc {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.rgc-alert-note {
  font-size: 12px;
  color: #9CA3AF;
  margin: 0;
}

/* Chart */
.rgc-chart-section {
  margin-bottom: 20px;
}

.rgc-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.rgc-canvas {
  display: block;
  width: 100%;
  height: 200px;
}

.rgc-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.rgc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rgc-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.rgc-legend-item span {
  font-size: 10px;
  color: #6B7280;
}

/* What-If Simulator */
.rgc-whatif {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 16px;
  padding: 16px;
}

.rgc-whatif-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #7C3AED;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: Inter, sans-serif;
}

.rgc-whatif-result {
  margin-top: 12px;
}

.rgc-whatif-hint {
  font-size: 12px;
  color: #6B7280;
  margin: 0 0 8px 0;
}

.rgc-whatif-answer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e9d5ff;
}

.rgc-whatif-sparkle {
  flex-shrink: 0;
  margin-top: 2px;
}

.rgc-whatif-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.rgc-whatif-detail {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Plan Comparison Cards ── */
.pcc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .pcc-grid { grid-template-columns: 1fr; }
}

.pcc-card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pcc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pcc-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pcc-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.pcc-bookmark {
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
}

.pcc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pcc-stat {
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px;
}

.pcc-stat-label {
  font-size: 10px;
  color: #6B7280;
  margin: 0 0 2px 0;
}

.pcc-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.pcc-risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pcc-risk-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.pcc-return {
  font-size: 10px;
  color: #6B7280;
}

.pcc-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pcc-steps-label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.pcc-step {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.pcc-step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #6B7280;
  flex-shrink: 0;
  margin-top: 2px;
}

.pcc-step-text {
  font-size: 12px;
  color: #6B7280;
  line-height: 1.5;
}

.pcc-ai-note {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px;
}

.pcc-ai-note p {
  font-size: 10px;
  color: #1E40AF;
  margin: 0;
  line-height: 1.5;
}

/* ── Tax Optimization ── */
.tax-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .tax-summary-grid { grid-template-columns: 1fr; }
}

.tax-summary-card {
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.tax-summary-current {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.tax-summary-potential {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.tax-summary-label {
  font-size: 12px;
  color: #6B7280;
  margin: 0 0 4px 0;
}

.tax-summary-value {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.tax-summary-extra {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  margin: 4px 0 0 0;
}

.tax-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.tax-row {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tax-row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tax-row-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.tax-row-annotation {
  font-size: 10px;
  color: #9CA3AF;
  margin: 2px 0 0 0;
  max-width: 280px;
}

.tax-row-saved {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 4px 8px;
  flex-shrink: 0;
}

.tax-row-saved span {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
}

.tax-row-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 4px;
}

.tax-progress-track {
  width: 100%;
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.tax-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #059669, #10B981);
  width: 0;
  transition: width 0.8s ease-out;
}

.tax-row-tip {
  font-size: 10px;
  font-weight: 500;
  color: #D97706;
  margin: 0;
}

.tax-optimize-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #059669;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: Inter, sans-serif;
}

.tax-optimize-btn:hover {
  background: #047857;
}

.tax-optimize-btn:active {
  transform: scale(0.98);
}

/* ── RIA Review Card ── */
.ria-card {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 20px;
  margin-bottom: 16px;
}

.ria-card-top {
  display: flex;
  gap: 16px;
}

.ria-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.ria-info {
  flex: 1;
  min-width: 0;
}

.ria-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.ria-sec {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #1E40AF;
  text-decoration: none;
  margin-top: 2px;
}

.ria-sec:hover {
  text-decoration: underline;
}

.ria-specialty {
  font-size: 12px;
  color: #6B7280;
  margin: 4px 0 0 0;
}

.ria-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.ria-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ria-rating-num {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.ria-rating-count {
  font-size: 10px;
  color: #9CA3AF;
}

.ria-experience {
  font-size: 10px;
  color: #6B7280;
}

.ria-case-study {
  margin-top: 16px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
}

.ria-case-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ria-case-label span {
  font-size: 10px;
  font-weight: 600;
  color: #6B7280;
}

.ria-case-label svg {
  color: #6B7280;
}

.ria-case-text {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
}

.ria-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1E40AF;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: Inter, sans-serif;
}

.ria-submit-btn:hover {
  background: #1E3A8A;
}

.ria-submit-btn:active {
  transform: scale(0.98);
}

/* Success state */
.ria-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 20px;
}

.ria-success-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ria-success-title {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
  margin: 0;
}

.ria-success-desc {
  font-size: 12px;
  color: #6B7280;
  margin: 2px 0 0 0;
}

.ria-eta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
}

.ria-eta p {
  font-size: 12px;
  color: #1E40AF;
  margin: 0;
}

.ria-timeline {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ria-timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9CA3AF;
}

.ria-timeline-item.active {
  color: #6B7280;
}

.ria-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}

.ria-timeline-dot.active {
  background: #059669;
}

.ria-timeline-time {
  font-size: 10px;
  color: #9CA3AF;
  margin-left: auto;
}
