/* ==========================================================
   Installments Calculator Widget
   catalog/view/theme/default/stylesheet/installments.css
   ========================================================== */

/* ---------- Container ---------- */
.installments-calculator {
  background: #ffffff;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  padding: 24px 24px 20px;
  margin: 24px 0;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0, 60, 160, 0.07);
  max-width: 520px;
}

/* ---------- Header ---------- */
.inst-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.inst-icon {
  width: 32px;
  height: 32px;
  background: #1a56db;
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.inst-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
  letter-spacing: -0.2px;
}

.inst-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ---------- Body / Fields ---------- */
.inst-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inst-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Input ---------- */
.inst-input-wrap {
  position: relative;
}

.inst-input {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #1a202c;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.inst-input::-webkit-inner-spin-button,
.inst-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.inst-input:focus {
  outline: none;
  border-color: #1a56db;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.inst-currency {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- Slider ---------- */
.inst-slider-value {
  font-size: 13px;
  font-weight: 700;
  color: #1a56db;
  background: #eff6ff;
  padding: 1px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

.inst-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inst-slider-min,
.inst-slider-max {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
}

.inst-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, #1a56db 0%, #e5e7eb 0%);
  outline: none;
  cursor: pointer;
}

.inst-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a56db;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(26, 86, 219, 0.35);
  cursor: pointer;
  transition: transform 0.15s;
}
.inst-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.inst-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a56db;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(26, 86, 219, 0.35);
  cursor: pointer;
}

/* ---------- Button ---------- */
.inst-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}
.inst-btn:hover {
  background: #1648c0;
  box-shadow: 0 4px 16px rgba(26, 86, 219, 0.4);
}
.inst-btn:active { transform: scale(0.98); }

.inst-btn-icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s;
}
.inst-btn:hover .inst-btn-icon { transform: translateX(4px); }

/* ---------- Results grid ---------- */
.inst-results {
  border-top: 1.5px solid #e9ecf3;
  padding-top: 18px;
}

@keyframes instFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.inst-results-animate {
  animation: instFadeUp 0.3s ease both;
}

.inst-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inst-result-item {
  background: #f8faff;
  border: 1px solid #e4eaf7;
  border-radius: 10px;
  padding: 12px 14px;
}

/* Monthly payment — full width highlight */
.inst-result-main {
  grid-column: 1 / -1;
  background: #1a56db;
  border-color: #1a56db;
  padding: 14px 18px;
}
.inst-result-main .inst-result-label { color: rgba(255,255,255,0.8); }
.inst-result-main .inst-result-value { color: #fff; font-size: 26px; }

/* Annual rate card — neutral teal tint */
.inst-result-rate {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.inst-result-rate .inst-result-label { color: #166534; }
.inst-result-rate .inst-result-value { color: #166534; }

.inst-result-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.inst-result-value {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #1a202c;
  letter-spacing: -0.3px;
}

/* ---------- Info boxes ---------- */
.inst-info-boxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1.5px solid #e9ecf3;
  padding-top: 18px;
}

.inst-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 9px;
  padding: 11px 14px;
}

.inst-info-box--blue {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.inst-info-box--amber {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.inst-info-box__icon {
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1.5;
}

.inst-info-box--blue  .inst-info-box__icon { color: #1d4ed8; }
.inst-info-box--amber .inst-info-box__icon { color: #b45309; }

.inst-info-box__text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #374151;
}

.inst-info-box--amber .inst-info-box__text { color: #78350f; }

/* ---------- Error ---------- */
.inst-error {
  background: #fff2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #b91c1c;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .installments-calculator { padding: 18px 16px; }
  .inst-result-grid { grid-template-columns: 1fr; }
}
