/* CCP Mortgage Calculator styles (scoped) */
.ccp-mc-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ccp-mc-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d2d2d2;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  font-family: 'Montserrat', sans-serif;
}

.ccp-mc-card input,
.ccp-mc-card button,
.ccp-mc-card select,
.ccp-mc-card textarea {
  font-family: inherit;
}

.ccp-mc-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.ccp-mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ccp-mc-field span {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.ccp-mc-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c8c8c8;
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ccp-mc-field input[data-field="price"],
.ccp-mc-field input[data-field="income"] {
  letter-spacing: 0.04em;
}

.ccp-mc-field input:focus {
  border-color: #1D5AD2;
  box-shadow: 0 0 0 3px rgba(29, 90, 210, 0.12);
}

/* noUiSlider wrapper */
.ccp-mc-slider { margin-top: 10px; }

/* Scope all noUiSlider overrides to the calculator only */
.ccp-mc-card .ccp-mc-slider .noUi-target {
  position: relative;
  margin-top: 10px;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.ccp-mc-card .ccp-mc-slider .noUi-connects {
  background: #f2f2f2 !important;
  height: 6px !important;
  top: 0 !important;
  transform: none !important;
  border-radius: 10px !important;
}

.ccp-mc-card .ccp-mc-slider .noUi-connect {
  background-color: #1D5AD2 !important;
  opacity: 0.3 !important;
  height: 6px !important;
  top: 0 !important;
  transform: none !important;
  border-radius: 10px !important;
}

/* Round handle (circle) — Safari-safe */
.ccp-mc-card .ccp-mc-slider .noUi-handle {
  background-color: #1D5AD2 !important;
  border-radius: 999px !important;
  border: none !important;
  box-shadow: none !important;
  width: 20px !important;
  height: 20px !important;
  top: -7px !important;
  transform: none !important;
  cursor: pointer;
  overflow: hidden !important; /* Safari/WebKit: clip children */
}

/* Some themes style the inner touch area (can make the handle look square). Force it to be round too. */
.ccp-mc-card .ccp-mc-slider .noUi-handle .noUi-touch-area {
  width: 100% !important;
  height: 100% !important;
  border-radius: 999px !important;
  background-color: inherit !important;
  background-image: none !important;
}

/* Centering the circle on the track */
.ccp-mc-card .ccp-mc-slider .noUi-handle-lower,
.ccp-mc-card .ccp-mc-slider .noUi--lower { margin-left: -10px !important; }

.ccp-mc-card .ccp-mc-slider .noUi-handle-upper,
.ccp-mc-card .ccp-mc-slider .noUi--upper { margin-right: -10px !important; }

/* Remove default handle “bars” and tooltips */
.ccp-mc-card .ccp-mc-slider .noUi-handle:before,
.ccp-mc-card .ccp-mc-slider .noUi-handle:after,
.ccp-mc-card .ccp-mc-slider .noUi-tooltip { display: none !important; }

/* Results */
.ccp-mc-results {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f7f7;
}

.ccp-mc-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.ccp-mc-kpi {
  display: block;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e2e2;
}

.ccp-mc-kpi-label {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.ccp-mc-kpi-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Tabs */
.ccp-mc-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px 0;
}

.ccp-mc-card .ccp-mc-tabs button.ccp-mc-tab {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #bdbdbd !important;
  background-color: #C0C0C0 !important;
  color: #222 !important;
  cursor: pointer;
  font-weight: 600;
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.ccp-mc-card .ccp-mc-tabs button.ccp-mc-tab.active {
  background-color: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
  font-weight: 700;
}

/* Upfront costs */
.ccp-mc-upfront {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  background: #fff;
}

.ccp-mc-upfront-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.ccp-mc-upfront-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.ccp-mc-upfront-item > div:last-child {
  text-align: right;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.ccp-mc-income-estimate {
  margin: 14px 0;
  padding: 14px;
  border-color: rgba(29, 90, 210, 0.18);
  background: rgba(29, 90, 210, 0.04);
}

.ccp-mc-income-estimate .ccp-mc-upfront-title {
  color: #111;
}

.ccp-mc-income-estimate .ccp-mc-upfront-item:last-child {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 90, 210, 0.18);
  font-size: 14px;
}

.ccp-mc-note { margin-top: 10px; font-size: 12px; opacity: 0.7; }
.ccp-mc-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(176, 0, 32, 0.22);
  border-radius: 10px;
  background: rgba(176, 0, 32, 0.06);
  color: #b00020;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .ccp-mc-card { padding: 14px; }
  .ccp-mc-grid { grid-template-columns: 1fr; }
  .ccp-mc-kpis { grid-template-columns: 1fr; }
  .ccp-mc-tabs { gap: 8px; }
  .ccp-mc-upfront-item { align-items: flex-start; }
}