/* ===== RESET ===== */
.io-wrap *, .io-wrap *::before, .io-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== BASE ===== */
.io-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(13px, 1.5vw, 15px);
  color: #1e293b; max-width: 1060px; margin: 0 auto;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; overflow: hidden;
}

/* ===== HEADER ===== */
.io-header {
  padding: clamp(14px, 2vw, 22px) clamp(14px, 2.5vw, 24px);
  background: #78350f;
  display: flex; align-items: center; gap: clamp(10px, 1.5vw, 14px);
}
.io-header-icon {
  width: clamp(40px, 5vw, 50px); height: clamp(40px, 5vw, 50px);
  border-radius: 12px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fcd34d; flex-shrink: 0;
}
.io-title    { font-size: clamp(16px, 2vw, 20px); font-weight: 700; color: #fff; margin-bottom: 3px; }
.io-subtitle { font-size: clamp(11px, 1.3vw, 13px); color: rgba(255,255,255,0.7); line-height: 1.4; }

/* ===== BODY — default stacked ===== */
.io-body    { display: flex; flex-direction: column; }
.io-form    { padding: 16px; display: flex; flex-direction: column; gap: 13px; width: 100%; }
.io-results { padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #fdfaf6; width: 100%; border-top: 1px solid #e2e8f0; }

/* ===== SECTION LABELS ===== */
.io-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b;
  padding-bottom: 4px; border-bottom: 1px solid #f1f5f9;
  margin-top: 2px; display: flex; align-items: center; gap: 8px;
}
.io-section-tag {
  font-size: 9.5px; font-weight: 600; background: #dcfce7; color: #15803d;
  padding: 2px 7px; border-radius: 20px; text-transform: none; letter-spacing: 0;
}

/* ===== FIELDS ===== */
.io-field      { display: flex; flex-direction: column; gap: 6px; }
.io-label      { font-size: 13px; font-weight: 600; color: #334155; }
.io-field-hint { font-size: 12px; color: #64748b; line-height: 1.5; }

/* ===== INPUTS ===== */
.io-prefix-wrap, .io-suffix-wrap {
  display: flex; align-items: center;
  border: 1.5px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #f8fafc; min-width: 0;
}
.io-prefix-wrap:focus-within, .io-suffix-wrap:focus-within { border-color: #78350f; background: #fff; }
.io-prefix, .io-suffix {
  padding: 0 10px; height: 42px;
  display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: #64748b;
  background: #f1f5f9; white-space: nowrap; flex-shrink: 0;
}
.io-prefix { border-right: 1px solid #e2e8f0; }
.io-suffix { border-left: 1px solid #e2e8f0; }
.io-input {
  flex: 1; border: none; background: transparent;
  padding: 0 12px; height: 42px;
  font-size: 14px; color: #1e293b; outline: none; min-width: 0;
  -moz-appearance: textfield;
}
.io-input::-webkit-outer-spin-button,
.io-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ===== ROW 2 ===== */
.io-row-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* ===== BUTTONS ===== */
.io-btn-group   { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.io-rate-group  { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.io-term-btn, .io-period-btn, .io-rate-btn {
  padding: 10px 6px; border: 1.5px solid #cbd5e1;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: #f8fafc; color: #475569; transition: all .15s;
  text-align: center; white-space: nowrap;
}
.io-term-btn.active, .io-period-btn.active, .io-rate-btn.active {
  background: #78350f; border-color: #78350f; color: #fff;
}
.io-term-btn:hover:not(.active),
.io-period-btn:hover:not(.active),
.io-rate-btn:hover:not(.active) { border-color: #78350f; color: #ffffff; }

/* ===== USE CASES ===== */
.io-use-cases { display: flex; flex-direction: column; gap: 8px; }
.io-use-item  {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
}
.io-use-yes   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.io-use-no    { background: #fff5f5; border: 1px solid #fecaca; color: #991b1b; }
.io-use-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ===== DISCLAIMER ===== */
.io-disclaimer {
  background: #fefce8; border: 1px solid #fde68a;
  border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: #78350f; line-height: 1.5;
}

/* ===== HERO — TWO PHASE ===== */
.io-hero-card {
  display: flex; align-items: stretch;
  border-radius: 14px; overflow: hidden; border: 1px solid #e2e8f0;
}
.io-phase        { flex: 1; padding: clamp(14px, 2vw, 18px) clamp(10px, 2vw, 16px); text-align: center; }
.io-phase-1      { background: #78350f; color: #fff; }
.io-phase-2      { background: #dc2626; color: #fff; }
.io-phase-divider {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #3b0f0f; padding: 0 10px; flex-shrink: 0;
  gap: 4px;
}
.io-divider-arrow { font-size: 20px; color: rgba(255,255,255,0.5); }
.io-divider-label { font-size: 10px; color: rgba(255,255,255,0.5); white-space: nowrap; writing-mode: vertical-rl; }
.io-phase-label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; margin-bottom: 5px; }
.io-phase-amount { font-size: clamp(22px, 3.5vw, 30px); font-weight: 800; line-height: 1.1; }
.io-phase-2 .io-phase-amount { color: #fcd34d; }
.io-phase-sub    { font-size: 11px; opacity: .7; margin-top: 4px; }

/* ===== PAYMENT SHOCK CARD ===== */
.io-shock-card {
  background: #fff; border: 2px solid #fca5a5;
  border-radius: 12px; overflow: hidden;
}
.io-shock-header {
  display: flex; align-items: center; gap: 8px;
  background: #fee2e2; padding: 10px 16px;
  border-bottom: 1px solid #fca5a5;
}
.io-shock-icon  { font-size: 18px; }
.io-shock-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #991b1b; }
.io-shock-body  { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.io-shock-row   { display: flex; justify-content: space-between; font-size: 13px; color: #475569; padding: 4px 0; border-bottom: 1px solid #fff5f5; }
.io-shock-row:last-child { border-bottom: none; }
.io-shock-val   { font-weight: 700; }
.io-shock-warning { padding: 10px 16px; background: #fff5f5; font-size: 12px; color: #991b1b; line-height: 1.5; }
.io-red   { color: #dc2626; }
.io-green { color: #16a34a; }

/* ===== EQUITY CARD ===== */
.io-equity-card {
  background: #fff; border: 1.5px solid #fed7aa;
  border-radius: 12px; overflow: hidden;
}
.io-equity-header {
  display: flex; align-items: center; gap: 8px;
  background: #fff7ed; padding: 10px 16px;
  border-bottom: 1px solid #fed7aa;
}
.io-equity-icon  { font-size: 18px; }
.io-equity-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #92400e; }
.io-equity-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.io-equity-item  {
  padding: 12px 16px; border-bottom: 1px solid #fff7ed;
  border-right: 1px solid #fff7ed;
}
.io-equity-item:nth-child(even) { border-right: none; }
.io-equity-item:nth-last-child(-n+2) { border-bottom: none; }
.io-equity-label { font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 3px; }
.io-equity-val   { font-size: 15px; font-weight: 700; color: #1e293b; }
.io-equity-warn  { padding: 10px 16px; background: #fff7ed; font-size: 12px; color: #92400e; line-height: 1.5; border-top: 1px solid #fed7aa; }

/* ===== COMPARE CARD ===== */
.io-compare-card {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 16px;
}
.io-compare-title { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.io-compare-hint  { font-size: 12px; color: #64748b; margin-bottom: 12px; }
.io-compare-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.io-col           { border-radius: 10px; padding: 14px 12px; text-align: center; }
.io-col-io        { background: #fff7ed; border: 1.5px solid #fed7aa; }
.io-col-std       { background: #f0fdf4; border: 1.5px solid #bbf7d0; }
.io-col-header    { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #64748b; margin-bottom: 5px; }
.io-col-amount    { font-size: clamp(18px, 2.5vw, 22px); font-weight: 800; color: #1e293b; }
.io-col-sub       { font-size: 11px; color: #64748b; margin-top: 4px; }
.io-compare-rows  { border-top: 1px solid #f1f5f9; padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.io-compare-row   { display: flex; justify-content: space-between; font-size: 13px; color: #475569; }
.io-compare-verdict { font-size: 14px; padding-top: 8px; border-top: 1px solid #e2e8f0; }

/* ===== STATS ===== */
.io-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.io-stat       { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; }
.io-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 4px; }
.io-stat-val   { font-size: clamp(13px, 1.5vw, 16px); font-weight: 700; color: #1e293b; }

/* ==============================================
   SCREEN 1 — MOBILE: max 480px
   ============================================== */
@media (max-width: 480px) {
  .io-wrap   { font-size: 13px; border-radius: 12px; }
  .io-header { padding: 14px; gap: 10px; }
  .io-header-icon { width: 38px; height: 38px; }
  .io-title  { font-size: 15px; }
  .io-subtitle { font-size: 11px; }
  .io-form, .io-results { padding: 14px; gap: 12px; }
  .io-body   { flex-direction: column; }
  .io-row-2  { grid-template-columns: 1fr; }
  .io-rate-group { grid-template-columns: 1fr; }
  .io-stats-grid { grid-template-columns: 1fr; }
  .io-compare-grid { grid-template-columns: 1fr; }
  .io-equity-grid  { grid-template-columns: 1fr; }
  .io-equity-item { border-right: none !important; }
  .io-hero-card { flex-direction: column; }
  .io-phase-divider { flex-direction: row; padding: 8px 16px; writing-mode: unset; }
  .io-divider-label { writing-mode: unset; }
  .io-phase-amount { font-size: 24px; }
}

/* ==============================================
   SCREEN 2 — TABLET: 481px – 899px
   ============================================== */
@media (min-width: 481px) and (max-width: 899px) {
  .io-wrap   { font-size: 14px; }
  .io-header { padding: 18px 20px; }
  .io-form, .io-results { padding: 18px; gap: 14px; }
  .io-body   { flex-direction: column; }
  .io-results { border-top: 1px solid #e2e8f0; }
  .io-row-2  { grid-template-columns: 1fr 1fr; }
  .io-rate-group { grid-template-columns: repeat(3,1fr); }
  .io-stats-grid { grid-template-columns: repeat(4,1fr); }
  .io-compare-grid { grid-template-columns: 1fr 1fr; }
  .io-equity-grid  { grid-template-columns: 1fr 1fr; }
  .io-phase-amount { font-size: 26px; }
}

/* ==============================================
   SCREEN 3 — DESKTOP: 900px+
   ============================================== */
@media (min-width: 900px) {
  .io-wrap   { font-size: 15px; }
  .io-header { padding: 22px 24px; }
  .io-form, .io-results { padding: 20px; gap: 14px; }
  .io-body   { flex-direction: row; align-items: flex-start; }
  .io-form   { width: 50%; border-right: 1px solid #e2e8f0; border-top: none; }
  .io-results { width: 50%; border-top: none; }
  .io-row-2  { grid-template-columns: 1fr 1fr; }
  .io-rate-group { grid-template-columns: repeat(3,1fr); }
  .io-stats-grid { grid-template-columns: 1fr 1fr; }
  .io-compare-grid { grid-template-columns: 1fr 1fr; }
  .io-equity-grid  { grid-template-columns: 1fr 1fr; }
  .io-phase-amount { font-size: 28px; }
}
