/* =========================================================
   RV Loan Calculator — rv- prefix
   Header: #14532d (dark forest green)
   clamp(MIN, fluid, MAX) for fluid scaling
   ========================================================= */

/* ── Reset ── */
.rv-wrap *, .rv-wrap *::before, .rv-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Wrapper ── */
.rv-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #1c1917;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  overflow: hidden;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Header ── */
.rv-header {
  background: #14532d;
  color: #fff;
  padding: clamp(14px, 2.5vw, 22px) clamp(14px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 16px);
}
.rv-header-icon {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
}
.rv-header-title {
    color: white;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.rv-header-sub {
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  color: #86efac;
  letter-spacing: 0.01em;
}

/* ── Body Layout ── */
.rv-body {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

/* ── Form (Left) ── */
.rv-form {
  flex: 0 0 44%;
  padding: clamp(14px, 2.5vw, 24px) clamp(12px, 2.5vw, 24px) clamp(16px, 3vw, 28px);
  background: #ffffff;
  border-right: 1.5px solid #e7e5e4;
}

/* ── Section Title ── */
.rv-section-title {
  font-size: clamp(0.66rem, 1.4vw, 0.72rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #78716c;
  margin: clamp(12px, 2vw, 18px) 0 10px;
  border-bottom: 1px solid #e7e5e4;
  padding-bottom: 6px;
}

/* ── Field Group ── */
.rv-field-group {
  margin-bottom: clamp(10px, 1.8vw, 14px);
}

/* ── Label ── */
.rv-label {
  display: block;
  font-size: clamp(0.76rem, 1.5vw, 0.82rem);
  font-weight: 600;
  color: #44403c;
  margin-bottom: 6px;
}
.rv-hint-inline {
  font-size: clamp(0.68rem, 1.4vw, 0.73rem);
  font-weight: 400;
  color: #78716c;
  margin-left: 4px;
}

/* ── RV Type Grid ── */
.rv-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(4px, 1vw, 6px);
}
.rv-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(7px, 1.4vw, 9px) clamp(4px, 1vw, 6px) clamp(6px, 1.2vw, 8px);
  border: 1.5px solid #d6d3d1;
  border-radius: 7px;
  background: #fafaf9;
  font-size: clamp(0.70rem, 1.4vw, 0.76rem);
  font-weight: 600;
  color: #44403c;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
  gap: 2px;
}
.rv-type-btn:hover {
    color: #1F542F;
  border-color: #14532d;
  background: #f0fdf4;
}
.rv-type-btn.active {
  background: #14532d;
  border-color: #14532d;
  color: #ffffff;
}
.rv-type-sub {
  font-size: clamp(0.60rem, 1.2vw, 0.65rem);
  font-weight: 400;
  opacity: 0.75;
  display: block;
}
.rv-type-info {
  margin-top: 6px;
  padding: 6px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 5px;
  font-size: clamp(0.68rem, 1.4vw, 0.73rem);
  color: #15803d;
  font-weight: 600;
}

/* ── Choice Buttons ── */
.rv-choices {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(4px, 1vw, 6px);
}
.rv-choice {
  flex: 1;
  min-width: 0;
  padding: clamp(6px, 1.2vw, 8px) clamp(7px, 1.5vw, 10px);
  border: 1.5px solid #d6d3d1;
  border-radius: 7px;
  background: #fafaf9;
  font-size: clamp(0.72rem, 1.4vw, 0.78rem);
  font-weight: 500;
  color: #44403c;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.rv-choice:hover {
    color: #1F542F;
  border-color: #14532d;
  background: #f0fdf4;
}
.rv-choice.active {
  background: #14532d;
  border-color: #14532d;
  color: #ffffff;
}
.rv-choice-sub {
  font-size: clamp(0.60rem, 1.2vw, 0.65rem);
  font-weight: 400;
  opacity: 0.8;
}
.rv-credit-choices .rv-choice {
  flex: 1 1 auto;
  min-width: 60px;
}

/* ── Age / Credit Warn ── */
.rv-age-warn, .rv-credit-warn {
  margin-top: 6px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: clamp(0.70rem, 1.4vw, 0.76rem);
  font-weight: 600;
}

/* ── Input (with unit suffix) ── */
.rv-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s;
  background: #fff;
}
.rv-input-wrap:focus-within { border-color: #14532d; }
.rv-input-wrap .rv-input {
  border: none;
  outline: none;
  padding: 8px 10px;
  font-size: clamp(0.82rem, 1.6vw, 0.9rem);
  flex: 1;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.rv-input-wrap .rv-input::-webkit-inner-spin-button,
.rv-input-wrap .rv-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.rv-unit {
  padding: 0 10px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #78716c;
  background: #f5f5f4;
  border-left: 1.5px solid #d1d5db;
  height: 100%;
  display: flex;
  align-items: center;
}

/* ── Input Group ($) ── */
.rv-input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s;
  background: #fff;
}
.rv-input-group:focus-within { border-color: #14532d; }
.rv-input-addon {
  padding: 8px 10px;
  background: #f5f5f4;
  border-right: 1.5px solid #d1d5db;
  font-size: 0.85rem;
  font-weight: 600;
  color: #78716c;
  display: flex;
  align-items: center;
}
.rv-input-addon-field {
  border: none;
  outline: none;
  padding: 8px 10px;
  font-size: clamp(0.82rem, 1.6vw, 0.9rem);
  flex: 1;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.rv-input-addon-field::-webkit-inner-spin-button,
.rv-input-addon-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* ── Range Slider ── */
.rv-slider {
  width: 100%;
  margin: 6px 0 2px;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 4px;
  background: #e7e5e4;
  outline: none;
  cursor: pointer;
}
.rv-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #14532d;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.rv-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #14532d;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.rv-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #a8a29e;
  margin-top: 2px;
}

/* ── Hint / Highlight ── */
.rv-hint {
  font-size: clamp(0.68rem, 1.4vw, 0.72rem);
  color: #78716c;
  margin-top: 4px;
  line-height: 1.4;
}
.rv-highlight {
  font-weight: 700;
  color: #14532d;
}

/* ── Disclaimer ── */
.rv-disclaimer {
  margin-top: clamp(12px, 2vw, 16px);
  padding: clamp(10px, 1.8vw, 12px) clamp(11px, 2vw, 14px);
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 7px;
  font-size: clamp(0.68rem, 1.4vw, 0.72rem);
  color: #78716c;
  line-height: 1.5;
}

/* ── Results (Right) ── */
.rv-results {
  flex: 1 1 0;
  min-width: 0;
 
  padding: clamp(14px, 2.5vw, 24px) clamp(12px, 2.5vw, 24px) clamp(16px, 3vw, 28px);
  background: #f9fafb;
}

/* ── Placeholder ── */
.rv-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(36px, 8vw, 60px) 20px;
  gap: 14px;
}
.rv-placeholder-icon { font-size: clamp(2rem, 4vw, 2.5rem); }
.rv-placeholder p {
  color: #a8a29e;
  font-size: clamp(0.80rem, 1.6vw, 0.88rem);
  max-width: 300px;
  line-height: 1.5;
}

/* ── Hero Card ── */
.rv-hero-card {
  background: #14532d;
  color: #fff;
  border-radius: 10px;
  padding: clamp(14px, 2.5vw, 22px) clamp(12px, 2.5vw, 20px);
  margin-bottom: clamp(10px, 1.8vw, 14px);
  text-align: center;
}
.rv-hero-label {
  font-size: clamp(0.60rem, 1.2vw, 0.72rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 8px;
}
.rv-hero-value {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.rv-hero-sub {
  font-size: clamp(0.76rem, 1.6vw, 0.82rem);
  opacity: 0.75;
}

/* ── Cards ── */
.rv-card {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: clamp(12px, 2vw, 16px);
  margin-bottom: clamp(10px, 1.8vw, 14px);
}
.rv-card-title {
  font-size: clamp(0.68rem, 1.4vw, 0.76rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #78716c;
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

/* ── True Cost Card ── */
.rv-true-cost-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.rv-true-cost-card .rv-card-title { color: #15803d; }
.rv-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.rv-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: clamp(6px, 1.2vw, 7px) clamp(8px, 1.5vw, 10px);
  background: rgba(255,255,255,0.7);
  border-radius: 5px;
  font-size: clamp(0.74rem, 1.5vw, 0.82rem);
  color: #1c1917;
}
.rv-cost-total {
  font-weight: 700;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  background: #14532d !important;
  color: #fff !important;
  border-radius: 6px;
  margin-top: 4px;
}
.rv-true-cost-note {
  font-size: clamp(0.70rem, 1.4vw, 0.76rem);
  color: #15803d;
  font-weight: 500;
  line-height: 1.4;
  border-top: 1px solid #bbf7d0;
  padding-top: 8px;
}

/* ── Equity Card ── */
.rv-equity-card {
  border-color: #fde68a;
  background: #fffbeb;
}
.rv-equity-card .rv-card-title { color: #b45309; }
.rv-equity-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
}
.rv-equity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  min-width: 300px;
}
.rv-equity-table th {
  background: #fef3c7;
  font-weight: 700;
  font-size: clamp(0.64rem, 1.3vw, 0.70rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b45309;
  padding: clamp(6px, 1.2vw, 8px) clamp(7px, 1.5vw, 10px);
  text-align: left;
  border-bottom: 2px solid #fde68a;
}
.rv-equity-table td {
  padding: clamp(7px, 1.4vw, 9px) clamp(7px, 1.5vw, 10px);
  border-bottom: 1px solid #fef9c3;
  color: #1c1917;
  vertical-align: middle;
}
.rv-equity-table tbody tr:last-child td { border-bottom: none; }
.rv-equity-neg { color: #dc2626; font-weight: 700; }
.rv-equity-pos { color: #15803d; font-weight: 700; }
.rv-equity-warn {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 6px;
  padding: clamp(8px, 1.5vw, 10px) clamp(10px, 1.8vw, 12px);
  font-size: clamp(0.72rem, 1.4vw, 0.78rem);
  color: #b91c1c;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}
.rv-crossover-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
  border-radius: 20px;
  padding: 5px clamp(10px, 2vw, 14px);
  font-size: clamp(0.70rem, 1.4vw, 0.78rem);
  font-weight: 700;
}

/* ── Compare Table ── */
.rv-compare-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rv-compare-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(2px, 0.8vw, 4px);
}
.rv-compare-header {
  font-weight: 700;
  font-size: clamp(0.64rem, 1.3vw, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rv-compare-row div {
  padding: clamp(6px, 1.2vw, 8px) clamp(7px, 1.5vw, 10px);
  background: #fafaf9;
  border-radius: 5px;
  font-size: clamp(0.70rem, 1.4vw, 0.80rem);
  color: #1c1917;
}
.rv-compare-header div {
  background: #f5f5f4;
  color: #78716c;
  font-weight: 700;
}
.rv-compare-verdict div { font-weight: 700; }
.rv-compare-verdict div:first-child { background: transparent; }

/* ── Stats Grid ── */
.rv-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.5vw, 10px);
}
.rv-stat {
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 8px;
  padding: clamp(10px, 1.8vw, 14px) clamp(8px, 1.5vw, 14px) clamp(9px, 1.7vw, 12px);
  text-align: center;
}
.rv-stat-label {
  font-size: clamp(0.60rem, 1.2vw, 0.68rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #a8a29e;
  margin-bottom: 6px;
}
.rv-stat-value {
  font-size: clamp(0.92rem, 2vw, 1.15rem);
  font-weight: 800;
  color: #14532d;
  letter-spacing: -0.01em;
}
.rv-stat-sm { font-size: clamp(0.80rem, 1.7vw, 0.9rem); }

/* ==============================================
   SCREEN 1 — MOBILE: max 480px
   ============================================== */
@media (max-width: 480px) {
  .rv-body          { flex-direction: column; }
  .rv-form          { flex: none; width: 100%; border-right: none; border-bottom: 1.5px solid #e7e5e4; }
  .rv-results       { width: 100%; }
  .rv-type-grid     { grid-template-columns: 1fr 1fr; }
  .rv-stats-grid    { grid-template-columns: 1fr 1fr; }
}

/* ==============================================
   SCREEN 2 — TABLET: 481px – 899px
   ============================================== */
@media (min-width: 481px) and (max-width: 899px) {
  .rv-body          { flex-direction: column; }
  .rv-form          { flex: none; width: 100%; border-right: none; border-bottom: 1.5px solid #e7e5e4; }
  .rv-results       { width: 100%; }
  .rv-type-grid     { grid-template-columns: repeat(3, 1fr); }
  .rv-stats-grid    { grid-template-columns: repeat(4, 1fr); }
}

/* ==============================================
   SCREEN 3 — DESKTOP: 900px+
   ============================================== */
@media (min-width: 900px) {
  .rv-form          { overflow-y: auto; }
  .rv-stats-grid    { grid-template-columns: repeat(4, 1fr); }
}
