/* DSCR Loan Calculator — Scoped CSS | Plugin: smarttools-finance */

.dscr-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.dscr-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1020px;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
}

/* =====================
   HEADER
   ===================== */
.dscr-header {
  background: #134e4a;
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dscr-header-icon { font-size: 34px; flex-shrink: 0; }
.dscr-header-title { color:white; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.dscr-header-sub { font-size: 12px; color: #5eead4; }

/* =====================
   BODY — Mobile first
   ===================== */
.dscr-body { display: flex; flex-direction: column; }

/* Tablet 481–899px */
@media(min-width: 481px) and (max-width: 899px) {
  .dscr-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .dscr-maxloan-body { flex-direction: row; }
}

/* Desktop 900px+ — NO sticky, NO max-height */
@media(min-width: 900px) {
  .dscr-body { flex-direction: row; align-items: flex-start; }
  .dscr-form { width: 43%; border-right: 1px solid #e2e8f0; flex-shrink: 0; }
  .dscr-results { width: 57%; }
}

/* =====================
   FORM
   ===================== */
.dscr-form { padding: 20px; }
.dscr-field-group { margin-bottom: 14px; }

.dscr-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dscr-hint-inline {
  font-weight: 400;
  color: #6b7280;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

/* Section titles in form */
.dscr-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 16px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ccfbf1;
}

/* Choice Buttons */
.dscr-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.dscr-toggle { flex-wrap: nowrap; }
.dscr-choice {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dscr-choice:hover { border-color: #134e4a; color: #ffffff; }
.dscr-choice.active { background: #134e4a; border-color: #134e4a; color: #fff; }
.dscr-toggle .dscr-choice { flex: 1; text-align: center; font-size: 12px; }

/* Input Wrap (% suffix) */
.dscr-input-wrap { position: relative; display: flex; align-items: center; }
.dscr-input {
  width: 100%;
  padding: 9px 38px 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  color: #1f2937;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.dscr-input::-webkit-inner-spin-button,
.dscr-input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.dscr-input:focus { border-color: #134e4a; box-shadow: 0 0 0 3px rgba(19,78,74,0.1); }
.dscr-unit { position: absolute; right: 12px; color: #6b7280; font-size: 13px; pointer-events: none; }

/* Input Group ($ prefix) */
.dscr-input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.dscr-input-group:focus-within {
  border-color: #134e4a;
  box-shadow: 0 0 0 3px rgba(19,78,74,0.1);
}
.dscr-input-addon {
  display: flex;
  align-items: center;
  padding: 0 10px 0 12px;
  color: #6b7280;
  font-size: 14px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.dscr-input-addon-field {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
}

.dscr-hint { font-size: 11px; color: #9ca3af; margin-top: 5px; font-style: italic; }

.dscr-disclaimer {
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 11px;
  color: #713f12;
  line-height: 1.6;
  margin-top: 16px;
}

/* =====================
   RESULTS PANEL
   ===================== */
.dscr-results { background: #f0fdfa; padding: 20px; }

.dscr-placeholder { text-align: center; padding: 50px 24px; color: #6b7280; }
.dscr-placeholder-icon { font-size: 52px; margin-bottom: 14px; }
.dscr-placeholder p { font-size: 13px; line-height: 1.7; }

/* =====================
   F. STR WARNING
   ===================== */
.dscr-str-warning {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.dscr-str-warning-title { font-size: 12px; font-weight: 700; color: #9a3412; margin-bottom: 8px; }
.dscr-str-row { font-size: 11px; color: #92400e; padding: 3px 0; line-height: 1.5; }

/* =====================
   A. DSCR VERDICT HERO
   ===================== */
.dscr-verdict-card {
  background: #134e4a;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
  color: #fff;
}
.dscr-verdict-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}
.dscr-verdict-label { font-size: 11px; color: #5eead4; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.dscr-verdict-number { font-size: 48px; font-weight: 900; letter-spacing: -2px; line-height: 1; }
.dscr-verdict-badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 6px;
}
/* Badge colors */
.dscr-badge-red    { background: #fee2e2; color: #dc2626; }
.dscr-badge-amber  { background: #fef3c7; color: #92400e; }
.dscr-badge-ok     { background: #d1fae5; color: #065f46; }
.dscr-badge-strong { background: #a7f3d0; color: #064e3b; }

/* DSCR Status Bar */
.dscr-bar-wrap { margin-bottom: 14px; }
.dscr-bar-track {
  position: relative;
  height: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  margin-bottom: 20px;
  overflow: visible;
}
.dscr-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: #2dd4bf;
  transition: width 0.4s ease, background 0.3s ease;
}
.dscr-bar-marker {
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
}
.dscr-marker-line {
  width: 2px;
  height: 14px;
  background: rgba(255,255,255,0.5);
  margin: 0 auto;
}
.dscr-marker-lbl {
  font-size: 9px;
  text-align: center;
  color: #99f6e4;
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
}
.dscr-marker-lbl span { color: #5eead4; font-size: 8px; }
.dscr-pointer {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
}
.dscr-pointer-head {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2dd4bf;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.dscr-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #5eead4;
}
.dscr-verdict-text {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}
.dscr-rate-suggest {
  font-size: 11px;
  color: #99f6e4;
  font-style: italic;
}

/* =====================
   B. PITIA BREAKDOWN
   ===================== */
.dscr-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.dscr-card-title {
  background: #134e4a;
  color: #fff;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
}
.dscr-pitia-body { padding: 0; }
.dscr-pitia-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 12px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.dscr-pitia-row span:last-child { font-weight: 600; color: #111827; }
.dscr-pitia-rent { background: #f0fdfa; font-weight: 600; }
.dscr-pitia-rent span:last-child { color: #0f766e; font-size: 14px; font-weight: 700; }
.dscr-pitia-divider {
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6b7280;
  background: #f9fafb;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #f3f4f6;
}
.dscr-pitia-total {
  background: #f9fafb;
  font-weight: 700;
}
.dscr-pitia-total span { font-weight: 700 !important; font-size: 13px !important; }
.dscr-pitia-formula {
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
  background: #f0fdfa;
  border-top: 2px solid #99f6e4;
}

/* =====================
   C. LOAN DETAILS + G. STATS
   ===================== */
.dscr-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media(min-width: 481px) {
  .dscr-stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.dscr-stat {
  background: #fff;
  border: 1px solid #ccfbf1;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.dscr-stat-label { font-size: 10px; color: #6b7280; margin-bottom: 4px; line-height: 1.3; }
.dscr-stat-value { font-size: 14px; font-weight: 700; color: #134e4a; }

.dscr-ltv-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  color: #9a3412;
  margin-bottom: 12px;
  display: none;
}

/* =====================
   D. CASH FLOW
   ===================== */
.dscr-cashflow-rows { }
.dscr-cf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 12px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.dscr-cf-income { background: #f0fdfa; font-weight: 600; }
.dscr-cf-income span:last-child { color: #0f766e; font-weight: 700; }
.dscr-cf-net {
  font-weight: 700;
  font-size: 13px;
  background: #f9fafb;
}
.dscr-cf-net span:last-child { font-size: 15px; }

/* =====================
   E. MAX LOAN
   ===================== */
.dscr-maxloan-body {
  display: flex;
  flex-direction: column;
}
@media(min-width: 481px) {
  .dscr-maxloan-body { flex-direction: row; }
  .dscr-maxloan-item { flex: 1; }
  .dscr-maxloan-sep { width: 1px; background: #e2e8f0; flex-shrink: 0; }
}
.dscr-maxloan-item { padding: 14px; text-align: center; border-bottom: 1px solid #f3f4f6; }
@media(min-width: 481px) {
  .dscr-maxloan-item { border-bottom: none; border-right: 1px solid #f3f4f6; }
  .dscr-maxloan-item:last-child { border-right: none; }
}
.dscr-maxloan-threshold { font-size: 11px; font-weight: 700; color: #374151; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dscr-threshold-tag { background: #fef3c7; color: #92400e; border-radius: 4px; padding: 1px 6px; font-size: 10px; }
.dscr-tag-green { background: #d1fae5; color: #065f46; }
.dscr-maxloan-value { font-size: 22px; font-weight: 800; color: #134e4a; margin-bottom: 4px; }
.dscr-maxloan-note { font-size: 10px; color: #6b7280; line-height: 1.4; }
.dscr-maxloan-sep { display: none; }
@media(min-width: 481px) { .dscr-maxloan-sep { display: block; } }

/* Utility */
.dscr-red   { color: #dc2626; }
.dscr-green { color: #15803d; }

/* =====================
   MOBILE (max 480px)
   ===================== */
@media(max-width: 480px) {
  .dscr-form, .dscr-results { padding: 14px; }
  .dscr-header { padding: 14px; gap: 10px; }
  .dscr-header-icon { font-size: 26px; }
  .dscr-header-title { font-size: 16px; }
  .dscr-header-sub { font-size: 11px; }
  .dscr-verdict-number { font-size: 36px; }
  .dscr-choice { padding: 6px 10px; font-size: 11px; }
  .dscr-toggle .dscr-choice { font-size: 11px; padding: 7px 8px; }
  .dscr-pitia-row { font-size: 11px; }
  .dscr-cf-row { font-size: 11px; }
}
