/* Interest-Only Loan Calculator — Scoped CSS | Plugin: smarttools-finance */

.iol-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.iol-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
}

/* =====================
   HEADER
   ===================== */
.iol-header {
  background: #1e3a5f;
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.iol-header-icon { font-size: 34px; flex-shrink: 0; }
.iol-header-title { color:white; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.iol-header-sub { font-size: 12px; color: #93c5fd; }

/* =====================
   BODY — Mobile first (single col)
   ===================== */
.iol-body { display: flex; flex-direction: column; }

/* Tablet 481–899px */
@media(min-width: 481px) and (max-width: 899px) {
  .iol-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .iol-extra-grid { grid-template-columns: repeat(2, 1fr); }
  .iol-cashflow-body { flex-direction: row; }
}

/* Desktop 900px+ — side by side, NO sticky, NO max-height */
@media(min-width: 900px) {
  .iol-body { flex-direction: row; align-items: flex-start; }
  .iol-form { width: 42%; border-right: 1px solid #e2e8f0; flex-shrink: 0; }
  .iol-results { width: 58%; }
}

/* =====================
   FORM
   ===================== */
.iol-form { padding: 20px; }
.iol-field-group { margin-bottom: 15px; }

.iol-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.iol-hint-inline {
  font-weight: 400;
  color: #6b7280;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

/* Choice Buttons */
.iol-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.iol-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;
}
.iol-choice:hover { border-color: #1e3a5f; color: #ffffff; }
.iol-choice.active { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }

/* Input Wrap (% suffix) */
.iol-input-wrap { position: relative; display: flex; align-items: center; }
.iol-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;
}
.iol-input::-webkit-inner-spin-button,
.iol-input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.iol-input:focus { border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30,58,95,0.09); }
.iol-unit { position: absolute; right: 12px; color: #6b7280; font-size: 13px; pointer-events: none; }

/* Input Group ($ prefix — no overlap) */
.iol-input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.iol-input-group:focus-within {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.09);
}
.iol-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;
}
.iol-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;
}

.iol-hint { font-size: 11px; color: #9ca3af; margin-top: 5px; font-style: italic; }
.iol-divider { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0 12px; }

.iol-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
   ===================== */
.iol-results { background: #f0f6ff; padding: 20px; }

.iol-placeholder { text-align: center; padding: 50px 24px; color: #6b7280; }
.iol-placeholder-icon { font-size: 52px; margin-bottom: 14px; }
.iol-placeholder p { font-size: 13px; line-height: 1.7; }

/* Context Card */
.iol-context-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #1e3a5f;
  font-weight: 500;
  margin-bottom: 12px;
}
.iol-context-icon { font-size: 18px; flex-shrink: 0; }

/* =====================
   A. TWO-PHASE HERO
   ===================== */
.iol-hero-card {
  background: #1e3a5f;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  color: #fff;
}
.iol-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}
.iol-phase { text-align: center; flex: 1; }
.iol-phase-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #93c5fd;
  background: rgba(147,197,253,0.15);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.iol-phase-pi .iol-phase-tag {
  color: #6ee7b7;
  background: rgba(110,231,183,0.15);
}
.iol-phase-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.iol-phase-sub { font-size: 12px; color: #93c5fd; margin-bottom: 2px; }
.iol-phase-note { font-size: 10px; color: #64748b; }
.iol-phase-pi .iol-phase-value { color: #6ee7b7; }
.iol-phase-arrow {
  font-size: 24px;
  color: #4b6d8f;
  flex-shrink: 0;
  padding: 0 4px;
}

/* Mobile: stack phases vertically */
@media(max-width: 480px) {
  .iol-phase-row { flex-direction: column; gap: 12px; }
  .iol-phase-arrow { transform: rotate(90deg); }
  .iol-phase-value { font-size: 22px; }
}

/* =====================
   B. PAYMENT SHOCK
   ===================== */
.iol-shock-card {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.iol-shock-title {
  background: #1e3a5f;
  color: #fff;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
}
.iol-shock-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.iol-shock-icon { font-size: 28px; flex-shrink: 0; }
.iol-shock-numbers { flex: 1; }
.iol-shock-pct { font-size: 22px; font-weight: 800; color: #1f2937; }
.iol-shock-dollar { font-size: 13px; color: #6b7280; margin-top: 2px; }
.iol-shock-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.iol-shock-warn {
  padding: 9px 14px;
  font-size: 11px;
  color: #374151;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
  line-height: 1.5;
}

/* Shock severity colors */
.iol-shock-low    { background: #dcfce7; color: #15803d; }
.iol-shock-mod    { background: #fef9c3; color: #92400e; }
.iol-shock-high   { background: #ffedd5; color: #9a3412; }
.iol-shock-extreme{ background: #fee2e2; color: #dc2626; }

/* =====================
   C. BALLOON CARD
   ===================== */
.iol-balloon-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.iol-balloon-icon { font-size: 30px; flex-shrink: 0; }
.iol-balloon-title { font-size: 12px; font-weight: 700; color: #9a3412; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.iol-balloon-amount { font-size: 24px; font-weight: 800; color: #c2410c; margin-bottom: 4px; }
.iol-balloon-sub { font-size: 11px; color: #92400e; line-height: 1.5; }

/* =====================
   SECTION CARDS (D, E, F)
   ===================== */
.iol-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.iol-card-title {
  background: #1e3a5f;
  color: #fff;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
}

/* D. Comparison Table */
.iol-compare-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  padding: 9px 14px;
  font-size: 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  align-items: center;
  gap: 4px;
}
.iol-compare-last { border-bottom: none; }
.iol-compare-header {
  background: #f0f4f8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e3a5f;
  letter-spacing: 0.3px;
}
.iol-compare-row div:not(:first-child) { text-align: center; font-weight: 600; }

/* E. Cash Flow */
.iol-cashflow-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
@media(min-width: 481px) {
  .iol-cashflow-body { flex-direction: row; }
  .iol-cashflow-item { flex: 1; }
  .iol-cashflow-item + .iol-cashflow-item { border-left: 1px solid #f3f4f6; }
}
.iol-cashflow-item { padding: 14px; text-align: center; border-bottom: 1px solid #f3f4f6; }
.iol-cashflow-label { font-size: 11px; color: #6b7280; margin-bottom: 4px; }
.iol-cashflow-value { font-size: 22px; font-weight: 800; }
.iol-cashflow-note {
  padding: 8px 14px;
  font-size: 11px;
  color: #374151;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
  font-style: italic;
}
.iol-cashflow-warn {
  padding: 8px 14px;
  font-size: 11px;
  color: #9a3412;
  background: #fff7ed;
  border-top: 1px solid #fed7aa;
}

/* F. Extra Payment Impact */
.iol-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.iol-extra-item {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}
.iol-extra-item:nth-child(odd) { border-right: 1px solid #f3f4f6; }
.iol-extra-label { font-size: 10px; color: #6b7280; margin-bottom: 4px; line-height: 1.3; }
.iol-extra-value { font-size: 16px; font-weight: 700; color: #1f2937; }

/* G. Stats Grid */
.iol-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
@media(min-width: 481px) {
  .iol-stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.iol-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.iol-stat-label { font-size: 10px; color: #6b7280; margin-bottom: 4px; line-height: 1.3; }
.iol-stat-value { font-size: 14px; font-weight: 700; color: #1e3a5f; }
.iol-stat-sm { font-size: 12px; }

/* Utility colors */
.iol-green { color: #15803d; }
.iol-red   { color: #dc2626; }

/* =====================
   MOBILE (max 480px)
   ===================== */
@media(max-width: 480px) {
  .iol-form, .iol-results { padding: 14px; }
  .iol-header { padding: 14px; gap: 10px; }
  .iol-header-icon { font-size: 26px; }
  .iol-header-title { font-size: 16px; }
  .iol-header-sub { font-size: 11px; }
  .iol-choice { padding: 6px 10px; font-size: 11px; }
  .iol-shock-body { flex-wrap: wrap; gap: 8px; }
  .iol-compare-row { font-size: 11px; padding: 8px 10px; }
  .iol-cashflow-item { border-right: none !important; }
}
