/* The Gilded Pilgrim - Financial Planning Styles */
/* Extends the main site stylesheet */

/* ========================================
   CSS Variables (Planning-specific)
   ======================================== */
:root {
  /* Status colors */
  --status-green: #2E7D32;
  --status-green-light: #4CAF50;
  --status-amber: #F9A825;
  --status-amber-light: #FFC107;
  --status-red: #C62828;
  --status-red-light: #EF5350;
  
  /* Pyramid level colors */
  --level-1-color: var(--burgundy);      /* Cash Flow - Foundation */
  --level-2-color: #A03030;              /* Wealth - slightly lighter */
  --level-3-color: #B85050;              /* Risk - lighter */
  --level-4-color: #D07070;              /* Legacy - apex, lightest */
  
  /* Planning-specific */
  --planning-card-shadow: 0 2px 8px rgba(139, 0, 0, 0.08);
  --planning-card-shadow-hover: 0 4px 16px rgba(139, 0, 0, 0.12);
  --input-border: rgba(139, 0, 0, 0.2);
  --input-border-focus: var(--burgundy);
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

/* Visible focus indicator for keyboard navigation */
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Ensure touch targets are at least 44px */
.btn, button {
  min-height: 44px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --input-border: rgba(139, 0, 0, 0.5);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Planning Section Layout
   ======================================== */
.planning-section {
  padding: 5rem 0;
}

.planning-header {
  text-align: center;
  margin-bottom: 3rem;
}

.planning-header h1 {
  margin-bottom: 1rem;
}

.planning-header__subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

/* ========================================
   Pyramid Visualization
   ======================================== */
.pyramid-container {
  max-width: 600px;
  margin: 0 auto 3rem;
  position: relative;
}

.pyramid {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* Aspect ratio */
}

.pyramid-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pyramid-level {
  cursor: pointer;
  transition: all 0.3s ease;
}

.pyramid-level:hover {
  filter: brightness(1.1);
}

.pyramid-level--inactive {
  opacity: 0.3;
}

.pyramid-level--active {
  opacity: 1;
}

.pyramid-level--complete {
  opacity: 1;
}

.pyramid-label {
  font-family: 'Georgia', serif;
  font-size: 14px;
  fill: var(--white);
  pointer-events: none;
  text-anchor: middle;
}

.pyramid-score {
  font-family: 'Georgia', serif;
  font-size: 18px;
  font-weight: bold;
  fill: var(--white);
  pointer-events: none;
  text-anchor: middle;
}

/* Pyramid Legend */
.pyramid-legend {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.pyramid-legend__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--planning-card-shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.pyramid-legend__item:hover {
  box-shadow: var(--planning-card-shadow-hover);
  transform: translateX(4px);
}

.pyramid-legend__item--level-1 { border-left-color: var(--level-1-color); }
.pyramid-legend__item--level-2 { border-left-color: var(--level-2-color); }
.pyramid-legend__item--level-3 { border-left-color: var(--level-3-color); }
.pyramid-legend__item--level-4 { border-left-color: var(--level-4-color); }

.pyramid-legend__level {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pyramid-legend__title {
  font-size: 1.1rem;
  color: var(--burgundy);
  margin: 0.25rem 0;
}

.pyramid-legend__desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* ========================================
   Diagnostic Flow
   ======================================== */
.diagnostic-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Progress Indicator - Pyramid Style */
.progress-pyramid {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.progress-pyramid__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.progress-level {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--cream);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
}

.progress-level--level-1 { width: 280px; }
.progress-level--level-2 { width: 220px; }
.progress-level--level-3 { width: 160px; }
.progress-level--level-4 { width: 100px; }

.progress-level--active {
  background: var(--burgundy);
  color: var(--white);
  font-weight: 500;
}

.progress-level--complete {
  background: var(--status-green);
  color: var(--white);
}

.progress-level__score {
  position: absolute;
  right: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Section Cards */
.diagnostic-section {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--planning-card-shadow);
  padding: 2.5rem;
  margin-bottom: 2rem;
  display: none;
}

.diagnostic-section--active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.diagnostic-section__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.diagnostic-section__level {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.diagnostic-section__title {
  font-size: 1.75rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.diagnostic-section__intro {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
  margin-bottom: 1.75rem;
}

.form-group__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-group__label-text {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}

.form-group__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: help;
  border: 1px solid var(--input-border);
}

.form-group__tooltip {
  display: none;
  position: absolute;
  background: var(--text);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  max-width: 280px;
  z-index: 100;
  line-height: 1.5;
}

.form-group__help:hover + .form-group__tooltip,
.form-group__tooltip:hover {
  display: block;
}

/* Text Input */
.input-text {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.input-text--currency {
  padding-left: 2rem;
}

.input-currency-wrapper {
  position: relative;
}

.input-currency-wrapper::before {
  content: '$';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-family: 'Georgia', serif;
}

/* Slider */
.input-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.input-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: var(--cream);
  border-radius: 4px;
  outline: none;
}

.input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--burgundy);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.input-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.input-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--burgundy);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.input-slider-value {
  min-width: 120px;
  max-width: 140px;
  padding: 0.5rem 0.75rem;
  background: var(--cream);
  border-radius: 4px;
  text-align: center;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  color: var(--burgundy);
  font-weight: 500;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  cursor: text;
}

.input-slider-value:hover {
  background: var(--white);
  border-color: var(--input-border);
}

.input-slider-value:focus {
  outline: none;
  background: var(--white);
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.input-slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Toggle Group */
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toggle-option {
  flex: 1;
  min-width: 100px;
}

.toggle-option input {
  display: none;
}

.toggle-option label {
  display: block;
  padding: 0.875rem 1.25rem;
  text-align: center;
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.toggle-option label:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: var(--gold);
}

.toggle-option input:checked + label {
  background: var(--gold);
  color: var(--burgundy-dark);
  font-weight: 500;
}

/* Stepper Input */
.input-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.input-stepper__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--burgundy);
  background: var(--white);
  color: var(--burgundy);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-stepper__btn:hover {
  background: var(--burgundy);
  color: var(--white);
}

.input-stepper__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.input-stepper__value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--burgundy);
  min-width: 50px;
  text-align: center;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checklist-item:hover {
  background: rgba(201, 162, 39, 0.1);
}

.checklist-item input {
  display: none;
}

.checklist-item__checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--input-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checklist-item input:checked ~ .checklist-item__checkbox {
  background: var(--status-green);
  border-color: var(--status-green);
}

.checklist-item input:checked ~ .checklist-item__checkbox::after {
  content: '✓';
  color: var(--white);
  font-size: 14px;
  font-weight: bold;
}

.checklist-item__label {
  flex: 1;
}

.checklist-item__title {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.checklist-item__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Three-way toggle (Yes/No/Not Sure) */
.three-way-toggle {
  display: flex;
  gap: 0.5rem;
}

.three-way-toggle .toggle-option {
  flex: 1;
  min-width: auto;
}

.three-way-toggle .toggle-option label {
  padding: 0.625rem 0.75rem;
  font-size: 0.85rem;
}

/* ========================================
   Navigation Buttons
   ======================================== */
.diagnostic-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(139, 0, 0, 0.1);
}

.diagnostic-nav__back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  font-family: 'Georgia', serif;
}

.diagnostic-nav__back:hover {
  color: var(--burgundy);
}

.diagnostic-nav__next {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   Results Page
   ======================================== */
.results-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Overall Score */
.results-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.results-score {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--cream);
  margin-bottom: 1.5rem;
  position: relative;
}

.results-score__number {
  font-size: 4rem;
  font-weight: 500;
  line-height: 1;
}

.results-score__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.results-score--green { background: rgba(46, 125, 50, 0.1); }
.results-score--green .results-score__number { color: var(--status-green); }

.results-score--amber { background: rgba(249, 168, 37, 0.1); }
.results-score--amber .results-score__number { color: var(--status-amber); }

.results-score--red { background: rgba(198, 40, 40, 0.1); }
.results-score--red .results-score__number { color: var(--status-red); }

.results-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.results-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Cash Flow Summary Badge */
.cash-flow-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--cream);
  border-radius: 8px;
  margin-top: 1.5rem;
  border: 1px solid rgba(139, 0, 0, 0.1);
}

.cash-flow-summary__label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cash-flow-summary__value {
  font-size: 1.5rem;
  font-weight: 500;
}

.cash-flow-summary__value--positive { color: var(--status-green); }
.cash-flow-summary__value--negative { color: var(--status-red); }

/* Pyramid Results */
.results-pyramid {
  margin-bottom: 3rem;
}

/* Level Cards */
.level-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.level-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--planning-card-shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid;
}

.level-card:hover {
  box-shadow: var(--planning-card-shadow-hover);
  transform: translateX(4px);
}

.level-card--level-1 { border-left-color: var(--level-1-color); }
.level-card--level-2 { border-left-color: var(--level-2-color); }
.level-card--level-3 { border-left-color: var(--level-3-color); }
.level-card--level-4 { border-left-color: var(--level-4-color); }

.level-card__score {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--white);
}

.level-card__score--green { background: var(--status-green); }
.level-card__score--amber { background: var(--status-amber); }
.level-card__score--red { background: var(--status-red); }

.level-card__content {
  flex: 1;
}

.level-card__level {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.level-card__title {
  font-size: 1.25rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.level-card__findings {
  list-style: none;
  padding: 0;
  margin: 0;
}

.level-card__findings li {
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.level-card__findings li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.level-card__findings li.strength::before { background: var(--status-green); }
.level-card__findings li.gap::before { background: var(--status-red); }

.level-card__arrow {
  color: var(--gold);
  font-size: 1.5rem;
}

/* Cash Flow Impact Badge */
.cf-impact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.cf-impact--positive {
  background: rgba(46, 125, 50, 0.1);
  color: var(--status-green);
}

.cf-impact--negative {
  background: rgba(198, 40, 40, 0.1);
  color: var(--status-red);
}

/* Key Insights */
.insights-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.insights-column h3 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insights-column h3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.insights-column--strengths h3::before { background: var(--status-green); }
.insights-column--gaps h3::before { background: var(--status-red); }

.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insights-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(139, 0, 0, 0.05);
  font-size: 0.95rem;
  color: var(--text);
}

.insights-list li:last-child {
  border-bottom: none;
}

/* Actions Panel */
.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ========================================
   Privacy Notice
   ======================================== */
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(46, 125, 50, 0.05);
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.privacy-notice__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.privacy-notice__text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* ========================================
   Disclaimer Footer
   ======================================== */
.planning-disclaimer {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--cream);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.planning-disclaimer p {
  margin: 0;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 768px) {
  .diagnostic-section {
    padding: 1.5rem;
  }
  
  .progress-level--level-1 { width: 100%; }
  .progress-level--level-2 { width: 85%; }
  .progress-level--level-3 { width: 70%; }
  .progress-level--level-4 { width: 55%; }
  
  .toggle-group {
    flex-direction: column;
  }
  
  .toggle-option {
    min-width: 100%;
  }
  
  .input-slider-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-slider-value {
    text-align: center;
  }
  
  .level-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .level-card__score {
    margin: 0 auto;
  }
  
  .level-card__findings li {
    justify-content: center;
  }
  
  .level-card__arrow {
    display: none;
  }
  
  .insights-panel {
    grid-template-columns: 1fr;
  }
  
  .results-actions {
    flex-direction: column;
  }
  
  .results-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ========================================
   Animations
   ======================================== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes countUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.4s ease forwards;
}

.animate-pulse {
  animation: pulse 0.6s ease;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
