/* ============================================================
   HPUSA Rent-to-Own Calculator — Stylesheet
   File: hpusa-rto-calc.css
   Deployed: 2026-06-13
   Mobile-first: base styles at 375px, wider at 640px+
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.hpusa-rto-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: #1a1a1a;
}

/* ── Progress indicator ──────────────────────────────────── */
.hpusa-rto-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.hpusa-rto-progress-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #999;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.hpusa-rto-progress-step.active {
  background: #1a5276;
  color: #fff;
}
.hpusa-rto-progress-step.done {
  background: #27ae60;
  color: #fff;
}
.hpusa-rto-progress-line {
  flex: 1;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: background 0.3s;
}
.hpusa-rto-progress-line.done {
  background: #27ae60;
}
.hpusa-rto-progress-label {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

/* ── Screen card ─────────────────────────────────────────── */
.hpusa-rto-screen {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  padding: 28px 20px;
  display: none;
}
.hpusa-rto-screen.active {
  display: block;
}
.hpusa-rto-screen h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a5276;
  margin: 0 0 6px;
  line-height: 1.3;
}
.hpusa-rto-screen .hpusa-rto-sub {
  font-size: 14px;
  color: #555;
  margin: 0 0 22px;
}

/* ── Field groups ────────────────────────────────────────── */
.hpusa-rto-field {
  margin-bottom: 20px;
}
.hpusa-rto-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #222;
}
.hpusa-rto-field .hpusa-rto-field-note {
  font-size: 12px;
  color: #777;
  margin-bottom: 6px;
  margin-top: -4px;
}

/* ── Price slider ────────────────────────────────────────── */
.hpusa-rto-price-display {
  font-size: 28px;
  font-weight: 700;
  color: #1a5276;
  margin-bottom: 10px;
}
.hpusa-rto-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #1a5276 0%, #1a5276 var(--slider-pct, 20%), #d0d0d0 var(--slider-pct, 20%), #d0d0d0 100%);
  outline: none;
  cursor: pointer;
  margin: 8px 0 4px;
}
.hpusa-rto-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a5276;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
.hpusa-rto-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a5276;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
.hpusa-rto-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #999;
}

/* ── State select ────────────────────────────────────────── */
.hpusa-rto-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  background: #fafafa;
  color: #222;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231a5276' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.hpusa-rto-select:focus {
  border-color: #1a5276;
}

/* ── Text input ──────────────────────────────────────────── */
.hpusa-rto-text-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
}
.hpusa-rto-text-input:focus {
  border-color: #1a5276;
}

/* ── Card-style radio buttons ────────────────────────────── */
.hpusa-rto-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hpusa-rto-card-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border: 2px solid #d0d0d0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 52px;
  background: #fafafa;
}
.hpusa-rto-card-label:hover {
  border-color: #1a5276;
  background: #f0f5fa;
}
.hpusa-rto-card-label.selected {
  border-color: #1a5276;
  background: #eaf1f9;
}
.hpusa-rto-card-label input[type="radio"] {
  display: none;
}
.hpusa-rto-card-dot {
  width: 20px;
  height: 20px;
  border: 2px solid #aaa;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}
.hpusa-rto-card-label.selected .hpusa-rto-card-dot {
  border-color: #1a5276;
}
.hpusa-rto-card-label.selected .hpusa-rto-card-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #1a5276;
  border-radius: 50%;
  display: block;
}
.hpusa-rto-card-text {
  flex: 1;
}
.hpusa-rto-card-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
  line-height: 1.3;
}
.hpusa-rto-card-sub {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Navigation buttons ──────────────────────────────────── */
.hpusa-rto-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.hpusa-rto-btn-primary {
  flex: 1;
  padding: 15px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  min-height: 50px;
}
.hpusa-rto-btn-primary:hover {
  background: #154360;
}
.hpusa-rto-btn-secondary {
  padding: 15px 20px;
  background: #fff;
  color: #1a5276;
  border: 2px solid #1a5276;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 50px;
}
.hpusa-rto-btn-secondary:hover {
  background: #f0f5fa;
}
.hpusa-rto-validation-msg {
  color: #c0392b;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

/* ── Result screen ───────────────────────────────────────── */
.hpusa-rto-result-header {
  background: linear-gradient(135deg, #1a5276, #2980b9);
  border-radius: 10px;
  padding: 18px 18px 16px;
  color: #fff;
  margin-bottom: 16px;
}
.hpusa-rto-result-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}
.hpusa-rto-result-header .hpusa-rto-tier-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 4px;
}
.hpusa-rto-assumptions {
  font-size: 12px;
  color: #777;
  background: #f5f5f5;
  border-left: 3px solid #aaa;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
}

/* ── Result rows ─────────────────────────────────────────── */
.hpusa-rto-result-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.hpusa-rto-result-row:last-child {
  border-bottom: none;
}
.hpusa-rto-result-label {
  font-size: 14px;
  color: #555;
  flex: 1;
}
.hpusa-rto-result-label .hpusa-rto-sublabel {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.hpusa-rto-result-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a5276;
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}
.hpusa-rto-result-value.medium {
  font-size: 17px;
}
.hpusa-rto-info-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  background: #aaa;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 15px;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
}
.hpusa-rto-tooltip {
  display: none;
  position: absolute;
  left: 20px;
  top: -4px;
  background: #333;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  width: 220px;
  z-index: 10;
  line-height: 1.5;
}
.hpusa-rto-info-icon:hover .hpusa-rto-tooltip {
  display: block;
}

/* ── Affordability + credit badges ──────────────────────── */
.hpusa-rto-badge-row {
  margin: 16px 0;
  padding: 14px;
  border-radius: 8px;
  background: #f5f5f5;
}
.hpusa-rto-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.hpusa-rto-badge.green { background: #d5f5e3; color: #1e8449; }
.hpusa-rto-badge.yellow { background: #fef9e7; color: #9a7d0a; }
.hpusa-rto-badge.red { background: #fadbd8; color: #922b21; }
.hpusa-rto-badge.blue { background: #d6eaf8; color: #1a5276; }
.hpusa-rto-badge-msg {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  margin: 0;
}

/* ── Nudge block ─────────────────────────────────────────── */
.hpusa-rto-nudge {
  background: #fff8e6;
  border: 1px solid #f0c040;
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}
.hpusa-rto-nudge a {
  color: #1a5276;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Bridge copy block ───────────────────────────────────── */
.hpusa-rto-bridge {
  background: #f0f5fa;
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
  margin: 16px 0;
}

/* ── Compliance disclaimer ───────────────────────────────── */
.hpusa-rto-disclaimer {
  font-size: 11px;
  color: #888;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 16px 0;
  line-height: 1.6;
}

/* ── CTAs ────────────────────────────────────────────────── */
.hpusa-rto-cta-block {
  margin-top: 20px;
}
.hpusa-rto-cta-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  margin-bottom: 10px;
  transition: background 0.15s;
  min-height: 52px;
  box-sizing: border-box;
}
.hpusa-rto-cta-primary:hover { background: #c0392b; }
.hpusa-rto-cta-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: #fff;
  color: #1a5276;
  border: 2px solid #1a5276;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-bottom: 8px;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s;
}
.hpusa-rto-cta-secondary:hover { background: #f0f5fa; }
.hpusa-rto-cta-tertiary {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #1a5276;
  text-decoration: underline;
  margin-bottom: 8px;
  cursor: pointer;
}
.hpusa-rto-recalc {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 8px;
}

/* ── Lead capture overlay ────────────────────────────────── */
.hpusa-rto-overlay-bg {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hpusa-rto-overlay-bg.active {
  display: flex;
}
.hpusa-rto-overlay-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 20px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.hpusa-rto-overlay-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a5276;
  margin: 0 0 6px;
}
.hpusa-rto-overlay-card .hpusa-rto-sub {
  font-size: 13px;
  color: #666;
  margin: 0 0 20px;
}
.hpusa-rto-overlay-field {
  margin-bottom: 14px;
}
.hpusa-rto-overlay-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #222;
}
.hpusa-rto-overlay-field input[type="text"],
.hpusa-rto-overlay-field input[type="email"],
.hpusa-rto-overlay-field input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
}
.hpusa-rto-overlay-field input:focus {
  border-color: #1a5276;
}

/* ── TCPA consent ────────────────────────────────────────── */
.hpusa-rto-consent-block {
  margin: 14px 0 10px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}
.hpusa-rto-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.hpusa-rto-consent-row input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.hpusa-rto-consent-text {
  font-size: 12px;
  color: #444;
  line-height: 1.6;
}
.hpusa-rto-consent-text a {
  color: #1a5276;
}
.hpusa-rto-trust-line {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin-top: 10px;
}
.hpusa-rto-overlay-submit {
  width: 100%;
  padding: 15px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  min-height: 50px;
  transition: background 0.15s;
}
.hpusa-rto-overlay-submit:hover { background: #154360; }
.hpusa-rto-overlay-submit:disabled {
  background: #aaa;
  cursor: not-allowed;
}
.hpusa-rto-overlay-error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.hpusa-rto-overlay-close {
  float: right;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  margin: -8px -8px 0 0;
  padding: 4px 8px;
  line-height: 1;
}

/* ── Success state ───────────────────────────────────────── */
.hpusa-rto-success {
  text-align: center;
  padding: 30px 20px;
  display: none;
}
.hpusa-rto-success.active { display: block; }
.hpusa-rto-success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.hpusa-rto-success h2 {
  color: #1a5276;
  margin-bottom: 8px;
}

/* ── FAQ section below calc ──────────────────────────────── */
.hpusa-rto-faq {
  margin-top: 40px;
}
.hpusa-rto-faq h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a5276;
  margin-bottom: 16px;
}
.hpusa-rto-faq-item {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}
.hpusa-rto-faq-q {
  font-weight: 600;
  font-size: 15px;
  color: #222;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hpusa-rto-faq-q::after {
  content: '+';
  font-size: 20px;
  color: #1a5276;
  flex-shrink: 0;
}
.hpusa-rto-faq-item.open .hpusa-rto-faq-q::after {
  content: '−';
}
.hpusa-rto-faq-a {
  display: none;
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  padding-top: 10px;
}
.hpusa-rto-faq-item.open .hpusa-rto-faq-a {
  display: block;
}

/* ── Error state ─────────────────────────────────────────── */
.hpusa-rto-error-msg {
  color: #c0392b;
  font-size: 13px;
  padding: 10px;
  background: #fdedec;
  border-radius: 6px;
  margin-top: 10px;
  display: none;
}

/* ── Responsive: wider screens ───────────────────────────── */
@media (min-width: 480px) {
  .hpusa-rto-screen {
    padding: 32px 28px;
  }
  .hpusa-rto-screen h2 {
    font-size: 26px;
  }
  .hpusa-rto-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  /* Down payment cards stay full-width for dollar-amount readability */
  .hpusa-rto-cards.dp-cards {
    grid-template-columns: 1fr;
  }
}
