/**
 * COEPLUS Car Loan Calculator — Stylesheet
 * Plugin: coeplus-car-loan-calculator
 * Version: 1.1.0
 *
 * Moved from wp_add_inline_style() into a proper .css file so this
 * stylesheet loads at the same cascade level as COEPLUS Pro's external
 * stylesheet (coeplus-pro.css), rather than as an inline <style> block
 * which loses specificity battles against external stylesheets. This
 * eliminates the recurring cross-plugin CSS collision where COEPLUS Pro's
 * generic .cp-content-section rules were overriding the white text and
 * blue background on the highlighted Monthly Instalment result card.
 */

/* ── Fallback CSS variables ─────────────────────────────────────────────
   Only meaningful when COEPLUS Pro is NOT active — when it is active,
   its own :root declarations take precedence and these have no effect. */
:root {
  --cp-green: #2563EB;
  --cp-green-dark: #1D4ED8;
  --cp-green-light: #eff6ff;
  --cp-navy: #1a1a2e;
  --cp-gray: #f8f9fa;
  --cp-border: #e0e0e0;
  --cp-text-light: #666;
  --cp-text-muted: #999;
}

/* ── Calculator wrapper ──────────────────────────────────────────────── */
.cp-calculator {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  overflow: hidden;
}

/* ── Form section ────────────────────────────────────────────────────── */
.cp-calc-form { padding: 28px 32px 20px; }

.cp-calc-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.cp-calc-bar { width: 4px; height: 40px; background: var(--cp-green); border-radius: 2px; flex-shrink: 0; }
.cp-calc-title { font-size: 18px; font-weight: 800; color: var(--cp-navy); margin: 0; }
.cp-calc-sub { font-size: 13px; color: var(--cp-text-light); margin: 4px 0 0; }

.cp-calc-group { margin-bottom: 18px; }
.cp-calc-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--cp-navy);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.cp-field-hint { font-size: 11px; color: var(--cp-text-muted); font-weight: 400; text-transform: none; }

.cp-input-wrap { display: flex; align-items: center; gap: 6px; }
.cp-num-input {
  padding: 8px 10px;
  border: 2px solid var(--cp-border);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cp-navy);
  background: #fff;
}
.cp-num-input:focus { outline: none; border-color: var(--cp-green); }
.cp-input-suffix { font-size: .85rem; color: var(--cp-text-muted); white-space: nowrap; }

/* ── Tenure toggle buttons ───────────────────────────────────────────── */
.cp-toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-toggle {
  background: #fff;
  border: 1.5px solid var(--cp-border);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--cp-navy);
  transition: all .2s;
}
.cp-toggle:hover { border-color: var(--cp-green); color: var(--cp-green); }
.cp-toggle.active { background: var(--cp-green); border-color: var(--cp-green); color: #fff; }

/* ── Custom tenure input ─────────────────────────────────────────────── */
.cp-custom-tenure { margin-top: 10px; display: none; }
.cp-custom-tenure input {
  padding: 8px 12px;
  border: 2px solid var(--cp-green);
  border-radius: 6px;
  font-size: 13px;
  width: 180px;
  color: var(--cp-navy);
}
.cp-custom-tenure input:focus { outline: none; }

/* ── Results section ─────────────────────────────────────────────────── */
.cp-calc-results { padding: 20px 32px 24px; border-top: 1px solid var(--cp-border); }
.cp-results-title { font-size: 15px; font-weight: 700; color: var(--cp-navy); margin: 0 0 14px; }

/* Fixed 2×2 grid — consistent across all viewport widths above mobile.
   auto-fit/minmax caused the 4th card to wrap unpredictably depending on
   the page's container width, giving either 4-in-a-row or 3+1 layouts
   that both looked inconsistent. 2×2 is always clean and balanced. */
.cp-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .cp-results-grid { grid-template-columns: 1fr; }
}

.cp-result-card { background: var(--cp-gray); border-radius: 8px; padding: 14px 16px; }

/* ── Highlighted Monthly Instalment card ─────────────────────────────── 
   Uses !important on color properties because COEPLUS Pro's external
   stylesheet (.cp-content-section p, .cp-content-section h2, etc.)
   can override inherited text colors on child elements when the
   calculator is placed inside a .cp-content-section wrapper — which is
   the case on most pages. Since this file now loads as an external
   stylesheet (same cascade level as COEPLUS Pro), !important here is
   sufficient and correct rather than a workaround. */
.cp-result-card-highlight {
  background: var(--cp-green) !important;
  background-color: var(--cp-green) !important;
}
.cp-result-card-highlight .cp-result-label,
.cp-result-card-highlight .cp-result-val,
.cp-result-card-highlight p,
.cp-result-card-highlight div,
.cp-result-card-highlight span {
  color: #ffffff !important;
}

/* ── Non-highlighted cards ───────────────────────────────────────────── */
.cp-result-card:not(.cp-result-card-highlight) .cp-result-val {
  color: var(--cp-navy);
  font-size: 18px;
  font-weight: 800;
}
.cp-result-label {
  font-size: 11px;
  color: var(--cp-text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}

/* ── Disclaimer & CTA ────────────────────────────────────────────────── */
.cp-results-disclaimer {
  font-size: 11px;
  color: var(--cp-text-muted);
  line-height: 1.6;
  margin-top: 14px;
}
.cp-btn-primary {
  display: inline-block;
  background: var(--cp-green);
  color: #fff !important;
  padding: 11px 24px;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 14px;
}
.cp-btn-primary:hover { background: var(--cp-green-dark); }
