/* =========================================================
   Milestone Planner · Montserrat stylesheet
   (inherits tokens from style.css)
   ========================================================= */

.planner-body { padding-bottom: 3rem; }
.planner-main { padding-top: 5.5rem; }

/* ---------- Header ---------- */
.planner-head { padding-bottom: 1rem; }

.planner-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.25rem;
}
.planner-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdigris);
  animation: pk-pulse 2s ease-in-out infinite;
}
@keyframes pk-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.planner-title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 200;
  margin-bottom: 1rem;
}
.planner-title-line { display: block; }
.planner-title-italic {
  color: var(--verdigris);
  font-weight: 300;
  margin-left: 1rem;
}
.planner-amp {
  color: var(--ink);
  font-weight: 300;
}
.planner-period { color: var(--ink); font-weight: 500; }

.planner-intro {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 38rem;
  margin-top: 0.75rem;
  font-weight: 300;
}

/* =========================================================
   FORM
   ========================================================= */
.planner-form-wrap { padding: 1rem 0 3rem; }
.planner-form {
  background: var(--paper);
  padding: 2rem 2.25rem;
  border: 0.5px solid var(--hairline);
  position: relative;
}
.planner-form::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}

.form-head, .results-head, .milestone-head, .chart-head, .yearly-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.form-num {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 200;
  color: var(--verdigris);
  line-height: 1;
  letter-spacing: -0.03em;
}
.form-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1;
}
.form-sub {
  font-size: clamp(0.85rem, 1.1vw, 0.95rem);
  font-weight: 400;
  color: var(--ink-muted);
  flex-basis: 100%;
  margin-top: 0.2rem;
}
/* Section heads below the fold (results, milestone, chart, yearly) stay larger */
.results-head .form-num, .results-head .form-title,
.milestone-head .form-num, .milestone-head .form-title,
.chart-head .form-num, .chart-head .form-title,
.yearly-head .form-num, .yearly-head .form-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.results-head, .milestone-head, .chart-head, .yearly-head {
  margin-bottom: 2.5rem;
}

/* Field grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.75rem;
  position: relative;
  z-index: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  cursor: text;
}

.field-label {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.field-letter {
  color: var(--verdigris);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
}

.field-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--ink);
  padding: 0.45rem 0;
  transition: border-color 0.2s ease;
}
.field:focus-within .field-input-wrap {
  border-bottom-color: var(--verdigris);
  border-bottom-width: 1.5px;
}
.field-prefix, .field-suffix {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1;
}
.field-input-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 400;
  padding: 0;
  letter-spacing: -0.015em;
  min-width: 0;
}
.field-input-wrap input::placeholder { color: var(--ink-muted); opacity: 0.4; }
.field-input-wrap input[type="number"]::-webkit-inner-spin-button,
.field-input-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input-wrap input[type="number"] { -moz-appearance: textfield; }
.field-input-wrap input[type="month"] {
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 500;
}

.field-hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Form actions */
.form-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.form-error {
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: #FBEAEA;
  border-left: 2px solid #A32D2D;
  color: #501313;
  font-size: 13.5px;
  font-weight: 500;
}

/* =========================================================
   RESULTS
   ========================================================= */
.planner-results { padding: 4rem 0 3rem; }

/* Summary stats */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-left: 0.5px solid var(--hairline);
  margin-bottom: 4rem;
}
.summary-stat {
  padding: 2rem 1.5rem;
  border-right: 0.5px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.summary-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.summary-value {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}
.summary-sub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Milestone table */
.milestone-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem 4rem;
  padding: 0 0.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.milestone-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}
.milestone-table thead th {
  text-align: left;
  padding: 1rem 1rem 0.75rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.milestone-table tbody tr {
  transition: background 0.15s ease;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.milestone-table tbody tr:hover { background: var(--paper-deep); }
.milestone-table tbody td {
  padding: 1rem;
  vertical-align: baseline;
}
.milestone-table .cell-crore {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.milestone-table .cell-crore em {
  color: var(--verdigris);
  font-weight: 500;
  font-size: 0.75em;
  margin-left: 2px;
}
.milestone-table .cell-time {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}
.milestone-table .cell-month {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.milestone-table .cell-stage {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.milestone-table .cell-stage.during {
  color: var(--verdigris);
}
.milestone-table .cell-value,
.milestone-table .cell-real {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.milestone-table .cell-returns {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--verdigris);
  letter-spacing: -0.02em;
}
.milestone-table .cell-returns::after {
  content: "%";
  font-size: 0.65em;
  color: var(--ink-muted);
  margin-left: 2px;
}
.milestone-table .cell-dash { color: var(--ink-muted); font-weight: 400; }

/* Chart */
.chart-wrap {
  margin: 0 0 4rem;
  padding: 1.5rem 0.5rem 0.5rem;
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  position: relative;
}
#growthChart {
  width: 100%;
  height: auto;
  display: block;
}
.chart-legend {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--hairline);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.6rem; }
.legend-swatch {
  display: inline-block;
  width: 24px;
  height: 2px;
}
.legend-swatch.legend-portfolio { background: var(--ink); }
.legend-swatch.legend-contrib { background: var(--verdigris); height: 0; border-top: 1.5px dashed var(--verdigris); }
.legend-swatch.legend-sipend { background: var(--stone); width: 2px; height: 14px; }
.legend-swatch.legend-death { background: #9F4444; width: 2px; height: 14px; }

/* Chart internals */
.chart-grid { stroke: var(--hairline); stroke-width: 0.5; stroke-dasharray: 2 3; }
.chart-axis { stroke: var(--ink); stroke-width: 0.8; fill: none; }
.chart-axis-label {
  fill: var(--ink-muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.chart-tick-label {
  fill: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
}
.chart-portfolio-area { fill: var(--ink); opacity: 0.08; }
.chart-portfolio-line {
  stroke: var(--ink);
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-contrib-line {
  stroke: var(--verdigris);
  stroke-width: 1.25;
  fill: none;
  stroke-dasharray: 5 3;
  stroke-linecap: round;
}
.chart-sipend-line {
  stroke: var(--stone);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chart-death-line {
  stroke: #9F4444;
  stroke-width: 1;
  stroke-dasharray: 1.5 2.5;
}
.chart-death-label {
  fill: #9F4444;
}
.chart-milestone-dot {
  fill: var(--verdigris);
}
.chart-milestone-label {
  fill: var(--verdigris);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.chart-end-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

/* Yearly table */
.yearly-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem 4rem;
  padding: 0 0.5rem 1rem;
  max-height: 540px;
  overflow-y: auto;
}
.yearly-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.yearly-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 0.75rem 0.75rem;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  z-index: 2;
  white-space: nowrap;
}
.yearly-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 0.5px dotted var(--hairline);
  color: var(--ink);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.yearly-table tbody tr:hover { background: var(--paper-deep); }
.yearly-table .y-asof {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.yearly-table .y-sipstopped {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 12.5px;
}
.yearly-table .y-cross {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--verdigris);
  margin-left: 0.5em;
}
.yearly-table .y-cr {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* Methodology */
.methodology {
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  padding: 2.5rem 2rem;
  margin-bottom: 3rem;
  position: relative;
}
.methodology::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}
.method-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  letter-spacing: -0.015em;
}
.methodology ul {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.methodology li {
  padding-left: 1.5rem;
  position: relative;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-soft);
}
.methodology li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 8px;
  height: 1px;
  background: var(--verdigris);
}

/* PDF download strip */
.pdf-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 2.5rem;
  margin: 0 0 2.5rem;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.pdf-strip::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid rgba(245, 241, 230, 0.14);
  pointer-events: none;
}
.pdf-strip::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 240px;
  height: 100%;
  background: radial-gradient(circle at 70% 50%, rgba(52, 90, 82, 0.4) 0%, transparent 70%);
  pointer-events: none;
}
.pdf-strip-text { position: relative; z-index: 1; }
.pdf-strip-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #B5A567;
  margin-bottom: 0.75rem;
}
.pdf-strip-title {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 300;
  color: var(--paper);
  margin-bottom: 0.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.pdf-strip-title .accent-medium {
  color: #B5A567;
  font-weight: 500;
  display: block;
}
.pdf-strip-sub {
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(245, 241, 230, 0.65);
  line-height: 1.55;
  max-width: 38rem;
}
.pdf-btn {
  position: relative;
  z-index: 1;
  background: #B5A567;
  color: var(--ink);
  border-color: #B5A567;
  flex-shrink: 0;
  cursor: pointer;
}
.pdf-btn::before { content: none !important; }
.pdf-btn:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.pdf-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.pdf-btn-icon {
  font-size: 1.1em;
  margin-right: 0.1em;
}

/* Results CTA */
.results-cta {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 0.5px solid var(--hairline);
  border-bottom: 0.5px solid var(--hairline);
  margin-bottom: 2.5rem;
}
.results-cta-text {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-inline: auto;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .pdf-strip {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }
  .pdf-btn { justify-self: start; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-stat:nth-child(1), .summary-stat:nth-child(2) {
    border-bottom: 0.5px solid var(--hairline);
  }
}

/* Narrower tablet / small-laptop screens — drop field grid to 2 columns */
@media (max-width: 960px) {
  .field-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2rem; }
}

@media (max-width: 768px) {
  .planner-main { padding-top: 6rem; }
  .planner-meta {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    align-items: center;
  }
  .planner-title-italic { margin-left: 0; }
  .planner-form { padding: 2rem 1.25rem; }
  .field-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-stat {
    border-bottom: 0.5px solid var(--hairline);
    padding: 1.5rem 1.25rem;
  }
  .form-head, .results-head, .milestone-head, .chart-head, .yearly-head {
    gap: 1rem;
    margin-bottom: 1.75rem;
  }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }
  .results-cta { padding: 2.5rem 1rem; }
}
