/* =========================================================
   SIP Calculator · Montserrat stylesheet
   (inherits tokens from style.css)
   ========================================================= */

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

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

.sip-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;
}
.sip-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdigris);
  animation: sip-pulse 2s ease-in-out infinite;
}
@keyframes sip-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

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

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

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

.sip-form-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Three equal input columns at desktop width */
.sip-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.75rem;
  position: relative;
  z-index: 1;
}

/* =========================================================
   RESULTS CARD — highlighted navy panel with large numbers
   ========================================================= */
.sip-results { padding: 1rem 0 3rem; }

.sip-result-card {
  background: var(--ink);
  color: var(--paper);
  padding: 2.5rem 2.5rem;
  text-align: center;
  position: relative;
  margin-bottom: 3rem;
  overflow: hidden;
}
.sip-result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid rgba(245, 241, 230, 0.14);
  pointer-events: none;
}
.sip-result-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at center top, rgba(52, 90, 82, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.sip-result-strap {
  font-size: 14.5px;
  font-weight: 400;
  color: rgba(245, 241, 230, 0.75);
  line-height: 1.55;
  max-width: 44rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.sip-result-strap strong {
  color: var(--paper);
  font-weight: 600;
}

.sip-result-primary {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 200;
  color: #FBD660;
  letter-spacing: -0.03em;
  margin-top: 0.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.sip-result-secondary {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 300;
  color: var(--paper);
  letter-spacing: -0.025em;
  margin-top: 0.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.sip-result-mult {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 300;
  color: #B5A567;
  letter-spacing: -0.025em;
  margin-top: 0.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.sip-result-mult span {
  font-size: 0.45em;
  font-weight: 500;
  color: rgba(245, 241, 230, 0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 0.25em;
  vertical-align: middle;
}

.sip-result-rule {
  border: 0;
  border-top: 0.5px solid rgba(245, 241, 230, 0.12);
  width: 72px;
  margin: 1.5rem auto;
  position: relative;
  z-index: 1;
}

/* =========================================================
   MATRIX
   ========================================================= */
.matrix-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.matrix-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem 1.5rem;
  padding: 0 0.5rem 1rem;
  scrollbar-width: thin;
}
.matrix-table {
  /* table-layout: fixed locks column widths to their declared percentages
     regardless of cell content — so typing into the custom row/column
     inputs doesn't resize the whole table. */
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--paper);
}
/* Explicit column widths — corner is widest, four data columns share equally */
.matrix-table thead th:nth-child(1) { width: 22%; }
.matrix-table thead th:nth-child(2),
.matrix-table thead th:nth-child(3),
.matrix-table thead th:nth-child(4),
.matrix-table thead th:nth-child(5) { width: 19.5%; }

/* Corner cell — stacks "Expected Returns" and "Investment Period" */
.mtx-corner {
  background: var(--paper-deep);
  padding: 1rem 0.75rem;
  text-align: center;
  border: 0.5px solid var(--hairline);
  vertical-align: middle;
  min-width: 150px;
  position: relative;
}
.mtx-corner-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.08em;
  line-height: 1.3;
}
.mtx-corner-label-sub {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 10px;
}
.mtx-corner-sep {
  display: block;
  width: 50%;
  margin: 0.4rem auto;
  border-top: 0.5px solid var(--hairline);
}

.matrix-table thead th {
  background: var(--paper-deep);
  padding: 1rem 0.75rem;
  text-align: center;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  border: 0.5px solid var(--hairline);
  vertical-align: middle;
}

.matrix-table tbody td,
.matrix-table tbody th {
  padding: 0.95rem 0.75rem;
  text-align: center;
  border: 0.5px solid var(--hairline);
  color: var(--ink);
  vertical-align: middle;
}
.matrix-table tbody th {
  background: var(--paper-deep);
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  min-width: 90px;
}

/* Value cells */
.mtx-value {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--verdigris);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.mtx-value.is-highlight {
  background: #FFF7D6;
  color: var(--ink);
  font-weight: 600;
  position: relative;
}
.mtx-value.is-highlight::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid #B5A567;
  pointer-events: none;
}
.mtx-dash {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 14px;
}

/* Editable custom column header and row header */
.mtx-custom-col,
.mtx-custom-row {
  background: #FFFBE6 !important;
}
.mtx-custom-col input,
.mtx-custom-row input {
  width: 100%;
  max-width: 72px;
  padding: 0.4rem 0.3rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.mtx-custom-col input:focus,
.mtx-custom-row input:focus {
  border-color: var(--verdigris);
  background: #fff;
}
.mtx-custom-col input::placeholder,
.mtx-custom-row input::placeholder {
  color: var(--ink-muted);
  font-weight: 400;
  opacity: 0.65;
}
/* Remove number spinners */
.mtx-custom-col input::-webkit-inner-spin-button,
.mtx-custom-row input::-webkit-inner-spin-button,
.mtx-custom-col input::-webkit-outer-spin-button,
.mtx-custom-row input::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.mtx-custom-col input,
.mtx-custom-row input { -moz-appearance: textfield; }

.matrix-note {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.55;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
  max-width: 48rem;
}

/* =========================================================
   CTA strip at bottom
   ========================================================= */
.sip-cta-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 2.25rem;
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  margin-bottom: 2rem;
  position: relative;
}
.sip-cta-strip::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}
.sip-cta-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}
.sip-cta-title {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.sip-cta-strip .btn {
  position: relative;
  z-index: 1;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .sip-field-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2rem; }
}
@media (max-width: 768px) {
  .sip-main { padding-top: 6rem; }
  .sip-form { padding: 2rem 1.25rem; }
  .sip-field-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }
  .sip-result-card { padding: 2rem 1.5rem; }
  .sip-cta-strip { grid-template-columns: 1fr; padding: 1.75rem 1.5rem; }
  .sip-cta-strip .btn { justify-self: start; }
}
@media (max-width: 480px) {
  .matrix-table { font-size: 12.5px; min-width: 540px; }
  .matrix-table thead th,
  .matrix-table tbody td,
  .matrix-table tbody th { padding: 0.65rem 0.4rem; }
  .mtx-value { font-size: 12.5px; }
  .mtx-corner { min-width: 110px; padding: 0.75rem 0.4rem; }
  .mtx-corner-label { font-size: 9.5px; }
}
