/* ============================================================
   LCF Finance Calculator — v2 Stacked Layout (popup-friendly)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

.lcf-calc-wrap {
  --lcf-primary: #116767;
  --lcf-accent: #e8621a;
  --lcf-chart-borrow: #35b3b3;
  --lcf-chart-interest: #e8621a;
  --lcf-dark: #1a2424;
  --lcf-white: #ffffff;
  --lcf-gray-50: #f8fafa;
  --lcf-gray-100: #f0f4f4;
  --lcf-gray-200: #dfe6e6;
  --lcf-gray-300: #bcc8c8;
  --lcf-gray-400: #8a9e9e;
  --lcf-gray-500: #5e7575;
  --lcf-gray-700: #2a3838;
  --lcf-gray-800: #1a2424;
  --lcf-radius: 14px;
  --lcf-font-display: 'Plus Jakarta Sans', sans-serif;
  --lcf-font-body: 'DM Sans', sans-serif;
  font-family: var(--lcf-font-body);
  color: var(--lcf-gray-700);
  line-height: 1.5;
  max-width: 680px;
  margin: 0 auto;
}
.lcf-calc-wrap *, .lcf-calc-wrap *::before, .lcf-calc-wrap *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

/* ─── Shared: Dark Header Bar ─── */
.lcf-header {
  background: var(--lcf-dark);
  padding: 18px 28px;
  border-radius: var(--lcf-radius) var(--lcf-radius) 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lcf-header h2 {
  font-family: var(--lcf-font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--lcf-white);
  margin: 0;
}
.lcf-back-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: none;
  color: var(--lcf-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.lcf-back-btn:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); }

/* ─── Controls Section ─── */
.lcf-controls {
  background: var(--lcf-white);
  padding: 24px 28px 20px;
}

.lcf-step { margin-bottom: 20px; }
.lcf-step:last-child { margin-bottom: 0; }

.lcf-step-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--lcf-font-display);
  font-size: 13px; font-weight: 700;
  color: var(--lcf-gray-800);
  margin-bottom: 10px;
}
.lcf-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--lcf-primary);
  color: var(--lcf-white);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Loan Type Buttons — horizontal row */
.lcf-loan-types {
  display: flex; gap: 8px;
}
.lcf-loan-type-btn {
  flex: 1;
  padding: 11px 12px;
  border: 2px solid var(--lcf-gray-200);
  border-radius: 8px;
  background: var(--lcf-white);
  font-family: var(--lcf-font-display);
  font-size: 13px; font-weight: 600;
  color: var(--lcf-gray-500);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}
.lcf-loan-type-btn:hover { border-color: var(--lcf-primary); color: var(--lcf-primary); }
.lcf-loan-type-btn.active {
  background: var(--lcf-primary); border-color: var(--lcf-primary); color: var(--lcf-white);
}

/* Amount Input */
.lcf-amount-input-wrap { position: relative; margin-bottom: 10px; }
.lcf-currency {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--lcf-font-display); font-size: 18px; font-weight: 700; color: var(--lcf-gray-400);
}
.lcf-amount-input {
  width: 100%; padding: 14px 20px 14px 38px;
  border: 2px solid var(--lcf-gray-200); border-radius: 10px;
  background: var(--lcf-white);
  font-family: var(--lcf-font-display); font-size: 20px; font-weight: 700;
  color: var(--lcf-gray-800);
  outline: none; transition: border-color 0.2s;
}
.lcf-amount-input:focus { border-color: var(--lcf-primary); }

/* Range Slider (amount only) */
.lcf-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--lcf-gray-200); outline: none; cursor: pointer;
}
.lcf-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--lcf-chart-borrow);
  border: 3px solid var(--lcf-white);
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
  cursor: pointer; transition: transform 0.15s;
}
.lcf-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.lcf-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--lcf-chart-borrow);
  border: 3px solid var(--lcf-white);
  box-shadow: 0 1px 6px rgba(0,0,0,0.18); cursor: pointer;
}
.lcf-range-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.lcf-range-labels span { font-size: 11px; color: var(--lcf-chart-borrow); font-weight: 600; }

/* Steps 3 & 4 side by side */
.lcf-step-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 0;
}
.lcf-step-half { margin-bottom: 0; }

.lcf-hint {
  font-size: 11px; font-style: italic;
  color: var(--lcf-gray-400); margin-top: 6px;
}
.lcf-hint em { color: var(--lcf-gray-500); font-style: italic; }

/* Button Strips (term + credit) */
.lcf-btn-strip {
  display: flex; gap: 0;
  border-radius: 8px; overflow: hidden;
  border: 2px solid var(--lcf-gray-200);
  background: var(--lcf-white);
}
.lcf-term-btn, .lcf-credit-btn {
  flex: 1; padding: 9px 2px;
  border: none; background: var(--lcf-white);
  font-family: var(--lcf-font-display);
  font-size: 12px; font-weight: 600;
  color: var(--lcf-gray-400);
  cursor: pointer; transition: all 0.2s;
  text-align: center;
  border-right: 1px solid var(--lcf-gray-200);
}
.lcf-term-btn:last-child, .lcf-credit-btn:last-child { border-right: none; }
.lcf-term-btn:hover:not(.disabled), .lcf-credit-btn:hover {
  background: var(--lcf-gray-50); color: var(--lcf-gray-700);
}
.lcf-term-btn.active, .lcf-credit-btn.active {
  background: var(--lcf-dark); color: var(--lcf-white); font-weight: 700;
  border-right-color: var(--lcf-dark);
}
.lcf-term-btn.disabled {
  color: var(--lcf-gray-300); background: var(--lcf-gray-100);
  cursor: not-allowed; opacity: 0.5;
}

/* ─── Results Panel ─── */
.lcf-results {
  background: var(--lcf-dark);
  padding: 24px 28px 20px;
}

/* Top row: Monthly + stats */
.lcf-results-top {
  display: flex; align-items: flex-end; gap: 24px;
  margin-bottom: 20px;
}
.lcf-monthly { flex-shrink: 0; }
.lcf-monthly-label {
  display: block;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 2px;
}
.lcf-monthly-amount {
  font-family: var(--lcf-font-display);
  font-size: 42px; font-weight: 800;
  color: var(--lcf-white); line-height: 1;
}

.lcf-stats {
  display: flex; gap: 0; flex: 1;
  justify-content: flex-end;
}
.lcf-stat {
  text-align: center;
  padding: 0 16px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.lcf-stat:last-child { border-right: none; padding-right: 0; }
.lcf-stat-label {
  display: block; font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 2px;
}
.lcf-stat strong {
  font-family: var(--lcf-font-display);
  font-size: 16px; font-weight: 700; color: var(--lcf-white);
}
.lcf-stat-apr strong { color: var(--lcf-chart-borrow); }

/* Bar chart */
.lcf-bar-section { margin-bottom: 18px; }
.lcf-bar-legend {
  display: flex; gap: 16px; margin-bottom: 8px;
}
.lcf-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 500;
}
.lcf-legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.lcf-legend-borrow { background: var(--lcf-chart-borrow); }
.lcf-legend-interest { background: var(--lcf-chart-interest); }

.lcf-bar-track {
  width: 100%; height: 28px;
  border-radius: 6px; overflow: hidden;
  display: flex;
  background: rgba(255,255,255,0.06);
}
.lcf-bar-borrow {
  height: 100%;
  background: var(--lcf-chart-borrow);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px 0 0 6px;
  min-width: 2px;
}
.lcf-bar-interest {
  height: 100%;
  background: var(--lcf-chart-interest);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 6px 6px 0;
  min-width: 2px;
}
.lcf-bar-labels {
  display: flex; justify-content: space-between;
  margin-top: 6px;
}
.lcf-bar-labels span {
  font-size: 12px; color: rgba(255,255,255,0.5);
}
.lcf-bar-labels strong {
  font-family: var(--lcf-font-display);
  font-weight: 700; color: var(--lcf-white);
}

/* Bottom row: Enquire + note */
.lcf-results-bottom {
  display: flex; align-items: center; gap: 20px;
}
.lcf-enquire-btn {
  padding: 14px 36px;
  background: var(--lcf-accent);
  color: var(--lcf-white);
  font-family: var(--lcf-font-display);
  font-size: 15px; font-weight: 700;
  border: none; border-radius: 8px;
  cursor: pointer; transition: all 0.25s;
  flex-shrink: 0;
}
.lcf-enquire-btn:hover {
  background: #d45510;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232,98,26,0.3);
}
.lcf-no-credit-impact {
  font-size: 11px; color: rgba(255,255,255,0.35);
  text-align: right; flex: 1;
  line-height: 1.4;
}

/* Disclaimer */
.lcf-disclaimer {
  background: var(--lcf-white);
  font-size: 11px; color: var(--lcf-gray-400);
  line-height: 1.5; padding: 14px 28px;
  border-radius: 0 0 var(--lcf-radius) var(--lcf-radius);
  border-top: 1px solid var(--lcf-gray-200);
}
.lcf-disclaimer strong { color: var(--lcf-accent); }

/* ─── Outer container shape ─── */
.lcf-calc-view {
  border-radius: var(--lcf-radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(10,61,61,0.12);
}

/* ─── Enquiry Form View ─── */
.lcf-form-view {
  border-radius: var(--lcf-radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(10,61,61,0.12);
  animation: lcfSlideIn 0.35s ease-out;
}
@keyframes lcfSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.lcf-form-body {
  background: var(--lcf-white);
  padding: 24px 28px 28px;
}
.lcf-form-summary {
  display: flex; align-items: center; gap: 10px;
  background: var(--lcf-primary);
  color: var(--lcf-white);
  padding: 10px 18px; border-radius: 8px;
  font-family: var(--lcf-font-display);
  font-size: 12px; font-weight: 600;
  margin-bottom: 22px; flex-wrap: wrap;
}
.lcf-form-sum-sep { opacity: 0.3; }

.lcf-form-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 20px;
}
.lcf-field-full { grid-column: 1 / -1; }
.lcf-field-half { grid-column: span 1; }
.lcf-field-label {
  display: block; font-family: var(--lcf-font-display);
  font-size: 12px; font-weight: 600;
  color: var(--lcf-gray-700); margin-bottom: 4px;
}
.lcf-req { color: var(--lcf-accent); margin-left: 2px; }
.lcf-input {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--lcf-gray-200); border-radius: 8px;
  background: var(--lcf-white);
  font-family: var(--lcf-font-body); font-size: 13px;
  color: var(--lcf-gray-800);
  outline: none; transition: border-color 0.2s;
}
.lcf-input:focus { border-color: var(--lcf-primary); }
.lcf-textarea { resize: vertical; min-height: 70px; }
.lcf-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a9e9e' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}

/* Checkbox */
.lcf-checkbox-label {
  display: flex; align-items: flex-start; gap: 8px;
  cursor: pointer; font-size: 12px; color: var(--lcf-gray-500); line-height: 1.5;
}
.lcf-checkbox-label input { display: none; }
.lcf-checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--lcf-gray-200); border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; margin-top: 1px;
}
.lcf-checkbox-label input:checked + .lcf-checkmark {
  background: var(--lcf-primary); border-color: var(--lcf-primary);
}
.lcf-checkbox-label input:checked + .lcf-checkmark::after {
  content: '✓'; color: var(--lcf-white); font-size: 11px; font-weight: 700;
}

/* Submit */
.lcf-submit-btn {
  display: block; width: 100%; padding: 14px;
  background: var(--lcf-accent); color: var(--lcf-white);
  font-family: var(--lcf-font-display); font-size: 15px; font-weight: 700;
  border: none; border-radius: 8px; cursor: pointer; transition: all 0.25s;
}
.lcf-submit-btn:hover { background: #d45510; transform: translateY(-1px); }
.lcf-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.lcf-spinner { animation: lcfSpin 1s linear infinite; }
@keyframes lcfSpin { to { transform: rotate(360deg); } }

.lcf-form-error {
  margin-top: 10px; padding: 10px 14px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px;
  font-size: 12px; color: #991b1b;
}

/* ─── Success View ─── */
.lcf-success-view {
  border-radius: var(--lcf-radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(10,61,61,0.12);
}
.lcf-success-inner {
  text-align: center;
  padding: 56px 32px;
  background: var(--lcf-white);
  animation: lcfSlideIn 0.35s ease-out;
}
.lcf-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(53,179,179,0.12); color: var(--lcf-chart-borrow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.lcf-success-inner h2 {
  font-family: var(--lcf-font-display); font-size: 22px; font-weight: 800;
  color: var(--lcf-gray-800); margin-bottom: 10px;
}
.lcf-success-inner p { font-size: 14px; color: var(--lcf-gray-500); max-width: 440px; margin: 0 auto 24px; }
.lcf-back-calc-btn {
  display: inline-flex; padding: 12px 28px;
  background: var(--lcf-primary); color: var(--lcf-white);
  font-family: var(--lcf-font-display); font-size: 13px; font-weight: 700;
  border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.lcf-back-calc-btn:hover { opacity: 0.9; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .lcf-calc-wrap { max-width: 100%; }
  .lcf-header { padding: 14px 20px; }
  .lcf-header h2 { font-size: 17px; }
  .lcf-controls { padding: 20px 20px 16px; }
  .lcf-results { padding: 20px; }
  .lcf-disclaimer { padding: 12px 20px; }
  .lcf-form-body { padding: 20px; }

  .lcf-loan-types { flex-wrap: wrap; }
  .lcf-loan-type-btn { flex: 1 1 calc(50% - 4px); font-size: 12px; padding: 10px 8px; }

  .lcf-step-row { grid-template-columns: 1fr; gap: 16px; }

  .lcf-results-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .lcf-monthly-amount { font-size: 34px; }
  .lcf-stats { width: 100%; justify-content: space-between; }
  .lcf-stat { padding: 0 10px; }
  .lcf-stat:first-child { padding-left: 0; }
  .lcf-stat strong { font-size: 14px; }

  .lcf-results-bottom { flex-direction: column; gap: 10px; }
  .lcf-enquire-btn { width: 100%; text-align: center; }
  .lcf-no-credit-impact { text-align: center; }

  .lcf-form-fields { grid-template-columns: 1fr; }
  .lcf-field-half { grid-column: 1 / -1; }
}
