/* ===================================================================
   LK Finance — Calculator Suite Styles
   =================================================================== */

/* ===== TABS ===== */
.calc-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow-1);
}
.calc-tab {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 12px;
  text-align: right;
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all .25s ease;
  color: var(--ink-2);
}
.calc-tab:hover {
  background: rgba(46,164,160,0.06);
  color: var(--navy);
}
.calc-tab.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(46,164,160,0.32);
}
.calc-tab-num {
  font-size: 11px;
  font-weight: 700;
  opacity: .55;
  letter-spacing: 0.08em;
}
.calc-tab.active .calc-tab-num { opacity: .8; }
.calc-tab-label {
  font-size: 17px;
  font-weight: 800;
}
.calc-tab-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: .65;
  margin-top: 2px;
}
.calc-tab.active .calc-tab-sub { opacity: .9; }

@media (max-width: 980px) {
  .calc-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .calc-tab-sub { display: none; }
}
@media (max-width: 480px) {
  .calc-tabs {
    grid-template-columns: 1fr 1fr;
  }
  .calc-tab-label { font-size: 14px; }
}

/* ===== PANELS ===== */
.calc-panel {
  display: none;
  animation: fadeUp .4s ease;
}
.calc-panel.active { display: block; }

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

/* ===== GRID LAYOUT ===== */
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ===== CARDS ===== */
.calc-card,
.calc-result-card {
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-2);
}
.calc-result-card {
  background: linear-gradient(180deg, rgba(46,164,160,0.04), rgba(27,123,184,0.04));
  border-color: rgba(46,164,160,0.25);
  position: sticky;
  top: 88px;
}
@media (max-width: 980px) {
  .calc-result-card { position: static; }
}

/* ===== HEAD ===== */
.calc-head { margin-bottom: 24px; }
.calc-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: rgba(46,164,160,0.08);
  border: 1px solid rgba(46,164,160,0.18);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.calc-badge.teal {
  color: var(--teal-2);
  background: rgba(46,164,160,0.14);
  border-color: rgba(46,164,160,0.3);
}
.calc-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.calc-sub {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

/* ===== INPUTS ===== */
.calc-inputs {
  display: grid;
  gap: 18px;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.calc-field input[type="number"] {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  padding: 12px 16px;
  border: 1.5px solid var(--hairline-2);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  -moz-appearance: textfield;
  text-align: right;
  direction: ltr;
}
.calc-field input[type="number"]::-webkit-outer-spin-button,
.calc-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-field input:focus {
  outline: 0;
  border-color: var(--teal-2);
  box-shadow: 0 0 0 4px rgba(46,164,160,0.12);
}
.calc-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

/* ===== TRACK INPUTS (mortgage) ===== */
.calc-tracks-head {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px dashed var(--hairline-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calc-track {
  background: rgba(46,164,160,0.04);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  padding: 12px 14px;
}
.calc-track-row {
  display: grid;
  grid-template-columns: 1fr 70px 18px 70px 18px;
  gap: 8px;
  align-items: center;
}
.calc-track-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.calc-track-name small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.calc-track input {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid var(--hairline-2);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  -moz-appearance: textfield;
}
.calc-track input::-webkit-outer-spin-button,
.calc-track input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-track input:focus {
  outline: 0;
  border-color: var(--teal-2);
}
.calc-warn {
  margin-top: 8px;
  color: #c0392b;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
}

/* ===== RESULT STATS ===== */
.calc-result-head { margin-bottom: 18px; }
.calc-stat {
  padding: 18px 0;
  border-bottom: 1px dashed var(--hairline-2);
}
.calc-stat:last-of-type { border-bottom: 0; }
.calc-stat.compact { padding: 14px 0; }
.calc-stat-label {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.calc-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.calc-stat-value.sm { font-size: 26px; }
.calc-stat-value.teal { color: var(--teal-2); }
.calc-stat-value.danger { color: #c0392b; }
.calc-stat-meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ===== EXPLAINER + INSIGHT ===== */
.calc-explainer,
.calc-insight {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.calc-explainer {
  background: rgba(15, 110, 86, 0.04);
  border: 1px solid rgba(46, 164, 160, 0.14);
}
.calc-insight {
  background: linear-gradient(135deg, rgba(46,164,160,0.08), rgba(27,123,184,0.06));
  border: 1px solid rgba(46,164,160,0.22);
}
.calc-explainer h4,
.calc-insight h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
}
.calc-explainer p,
.calc-insight p {
  margin: 0 0 6px;
  color: var(--ink);
}
.calc-explainer p.muted { color: var(--muted); font-size: 12px; }
.calc-explainer code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--hairline-2);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  direction: ltr;
  color: var(--navy);
}

/* ===== MINI TABLE (mortgage breakdown) ===== */
.calc-mini-table {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--hairline-2);
  border-radius: 14px;
  background: #fff;
}
.calc-mini-table h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}
.calc-mini-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.calc-mini-table th,
.calc-mini-table td {
  padding: 8px 6px;
  text-align: right;
  border-bottom: 1px dashed var(--hairline-2);
}
.calc-mini-table th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.calc-mini-table tr:last-child td { border-bottom: 0; }
.calc-mini-table td:first-child {
  font-weight: 700;
  color: var(--ink);
}
.calc-mini-table td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
}

/* ===== DISCLAIMER ===== */
.calc-disclaimer {
  background: rgba(27, 123, 184, 0.05);
  border: 1px solid rgba(27, 123, 184, 0.18);
  border-radius: 20px;
  padding: 32px;
}
.calc-disclaimer p {
  color: var(--ink-2);
  line-height: 1.75;
  margin: 0 0 12px;
}
.calc-disclaimer p:last-child { margin-bottom: 0; }
.link-bold {
  color: var(--teal-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-bold:hover { color: var(--navy); }

/* ===== ACTIVE NAV LINK ===== */
.nav-links a.active {
  color: var(--teal-2);
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--teal-2));
  border-radius: 2px;
}

/* ===== MOBILE TWEAKS ===== */
@media (max-width: 720px) {
  .calc-card,
  .calc-result-card {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .calc-title { font-size: 22px; }
  .calc-stat-value { font-size: 30px; }
  .calc-stat-value.sm { font-size: 22px; }
  .calc-track-row {
    grid-template-columns: 1fr 60px 16px 60px 16px;
    font-size: 13px;
  }
  .calc-disclaimer { padding: 22px 18px; }
}
