/* =========================================================
   Mortgage Calculator Styles (matches your other calculators)
   File: assets/mc.css
   ========================================================= */

:root{
  --mc-ink:#1f2937;
  --mc-muted:#6b7280;
  --mc-line:#e6edf2;

  --mc-brand:#6e8f9f;
  --mc-brand2:#7fa6ba;

  --mc-card:#ffffff;
  --mc-soft:#f7fafc;
}

/* Screen-reader-only helper */
.mc-sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* Base wrapper */
.mc-wrap { max-width: 1120px; margin: 0 auto; padding: 12px; }

/* Layout: calculator on top, results below (matches your stacked calculators) */
.mc-shell { display: flex; flex-direction: column; gap: 20px; }

/* Panels */
.mc-panel {
  background: var(--mc-card);
  border: 1px solid var(--mc-line);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  overflow: hidden;
}

/* Panel header */
.mc-panel-head { padding: 16px 16px 8px; }
.mc-title { margin: 0; font-size: 24px; line-height: 1.15; color: #23303A; }
.mc-subtitle { margin-top: 6px; color: var(--mc-muted); font-size: 13px; }

/* Currency buttons */
.mc-currency-buttons {
  padding: 10px 16px 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.mc-currency-btn {
  border: 1px solid #DDE6EC;
  background: var(--mc-soft);
  border-radius: 12px;
  padding: 10px 0;
  font-weight: 900;
  font-size: 22px;
  color: #22313A;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.mc-currency-btn:active { transform: translateY(1px); }

.mc-currency-btn.is-active {
  background: var(--mc-brand);
  border-color: var(--mc-brand);
  color: #fff;
}

/* Form */
.mc-form { padding: 10px 16px 16px; }
.mc-field { margin: 12px 0; }

.mc-field label {
  display: block;
  font-weight: 800;
  color: #22313A;
  margin-bottom: 6px;
  font-size: 13px;
}

.mc-help { margin-top: 6px; color: var(--mc-muted); font-size: 12px; }

/* Inputs */
.mc-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.mc-prefix, .mc-suffix {
  border: 1px solid #DDE6EC;
  background: var(--mc-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  color: #22313A;
  flex: 0 0 auto;
  white-space: nowrap;
}

input[type="number"], input[type="date"], select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #DDE6EC;
  background: #FDFEFE;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  color: #111827;
  outline: none;
  min-width: 0;
}

select { padding-right: 34px; }

/* Layout helpers */
.mc-down-grid{
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}
@media (max-width: 520px){
  .mc-down-grid{ grid-template-columns: 1fr; }
}

.mc-row-money input { flex: 1 1 auto; min-width: 0; }
.mc-row-rate input { flex: 1 1 auto; min-width: 0; }

.mc-divider { height: 1px; background: #EEF3F6; margin: 14px 0; }

.mc-section-title {
  font-weight: 900;
  color: #22313A;
  margin-top: 4px;
  margin-bottom: 6px;
}

.mc-escrow-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mc-escrow-grid > div:nth-child(3){
  grid-column: 1 / -1;
}
@media (max-width: 520px){
  .mc-escrow-grid{ grid-template-columns: 1fr; }
  .mc-escrow-grid > div:nth-child(3){ grid-column: auto; }
}

/* Buttons */
.mc-actions { margin-top: 14px; }

.mc-actions-row { display: flex; gap: 10px; margin-top: 10px; }

.mc-btn {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #DDE6EC;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: #22313A;
  flex: 1 1 auto;
}

.mc-btn-primary {
  width: 100%;
  background: linear-gradient(180deg, var(--mc-brand2), var(--mc-brand));
  border-color: var(--mc-brand);
  color: #fff;
  font-size: 16px;
  padding: 14px 14px;
}

.mc-btn-light { background: var(--mc-soft); }

.mc-note { margin-top: 10px; color: var(--mc-muted); font-size: 12.5px; }

/* Results */
.mc-panel-results { padding-bottom: 10px; }
.mc-results-head { padding: 16px 16px 8px; }

.mc-results-title { font-size: 18px; font-weight: 900; color: #22313A; }

.mc-results-sub {
  margin-top: 6px;
  color: var(--mc-muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-pill {
  padding: 6px 10px;
  border: 1px solid var(--mc-line);
  border-radius: 999px;
  background: var(--mc-soft);
}

/* KPI Cards */
.mc-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 16px;
}
@media (max-width: 760px) { .mc-kpis { grid-template-columns: 1fr; } }

.mc-kpis-2{
  grid-template-columns: repeat(2, 1fr);
  padding-top: 0;
}
@media (max-width: 760px) { .mc-kpis-2 { grid-template-columns: 1fr; } }

.mc-kpi {
  border: 1px solid var(--mc-line);
  border-radius: 14px;
  background: #FDFEFE;
  padding: 12px;
}

.mc-kpi-label {
  color: var(--mc-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mc-kpi-value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
  color: #111827;
}

/* Viewbar */
.mc-viewbar {
  margin: 6px 16px 10px;
  border: 1px solid var(--mc-line);
  border-radius: 14px;
  background: var(--mc-soft);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mc-viewbar-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--mc-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.mc-view-toggle,
.mc-mini-actions {
  display: flex;
  gap: 8px;
}

.mc-view-btn,
.mc-mini-btn {
  border-radius: 12px;
  border: 1px solid #DDE6EC;
  background: #fff;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 12.5px;
  color: #22313A;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
  line-height: 1.1;
}

@media (max-width: 420px) {
  .mc-view-btn,
  .mc-mini-btn {
    min-width: 62px;
    font-size: 12px;
    padding: 10px 8px;
  }
}

.mc-view-btn.is-active {
  background: var(--mc-brand);
  border-color: var(--mc-brand);
  color: #fff;
}

/* TABLE */
.mc-table-wrap { padding: 0 16px 10px; }

.mc-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--mc-line);
  border-radius: 14px;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mc-table thead th {
  background: var(--mc-brand);
  color: #fff;
  text-align: left;
  padding: 10px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-table td {
  border-top: 1px solid #EEF3F6;
  padding: 9px 8px;
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-table tbody tr:nth-child(even) td { background: var(--mc-soft); }

.mc-col-num { text-align: right; }
.mc-center { text-align: center; }

@media (max-width: 520px) {
  .mc-table thead th { padding: 8px 6px; font-size: 10px; }
  .mc-table td { padding: 8px 6px; font-size: 12px; }
}

/* CHART */
.mc-chart-wrap { padding: 0 16px 10px; }

.mc-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--mc-muted);
  font-size: 12px;
  margin: 6px 0 10px;
}

.mc-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -2px;
}

.mc-swatch-balance { background: var(--mc-brand); }

.mc-chart {
  width: 100%;
  height: 320px;
  display: block;
  border: 1px solid var(--mc-line);
  border-radius: 14px;
  background: #fff;
}

/* Empty state */
.mc-results-empty { padding: 16px; color: var(--mc-muted); }

/* =========================================================
   MOBILE CARDS (matches the CDI mobile card system)
   ========================================================= */

.mc-cards { display: none; padding: 12px 16px 16px; }

.mc-card {
  border: 1px solid var(--mc-line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 12px;
}

.mc-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--mc-line);
  background: var(--mc-soft);
}

.mc-card-title { font-weight: 900; color: #22313A; }
.mc-card-sub { color: var(--mc-muted); font-weight: 800; }

.mc-card-body { padding: 10px 12px 12px; }

.mc-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eef3f6;
}

.mc-card-row:last-child { border-bottom: 0; padding-bottom: 0; }

.mc-card-label { color: var(--mc-muted); font-weight: 900; font-size: 12px; }
.mc-card-value { color: #111827; font-weight: 900; text-align: right; }

/* Switch: hide table on mobile, show cards */
@media (max-width: 760px) {
  .mc-table-scroll { display: none; }
  .mc-cards { display: block; }
}
