/* =============================================================
   CalcRight — Custom CSS
   Works alongside Tailwind CSS (loaded via CDN in base.html)
   ============================================================= */

/* ---- Form inputs ------------------------------------------- */
.calc-input {
  display: block;
  width: 100%;
  border-radius: 0.75rem;     /* rounded-xl */
  border: 1px solid #e2e8f0;  /* slate-200 */
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #0f172a;             /* slate-900 */
  background-color: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -moz-appearance: textfield;
}

.calc-input::placeholder {
  color: #94a3b8;             /* slate-400 */
}

.calc-input:hover {
  border-color: #cbd5e1;      /* slate-300 */
}

.calc-input:focus {
  border-color: #3b82f6;      /* blue-500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Remove number input spinners */
.calc-input::-webkit-inner-spin-button,
.calc-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* select arrow */
select.calc-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* ---- Input with prefix/suffix icon ------------------------- */
.input-with-prefix,
.input-with-suffix {
  position: relative;
}

.input-prefix {
  position: absolute;
  inset-y: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.875rem;
  font-size: 0.875rem;
  color: #94a3b8;             /* slate-400 */
  pointer-events: none;
  user-select: none;
}

.input-suffix {
  position: absolute;
  inset-y: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding-right: 0.875rem;
  font-size: 0.875rem;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

/* ---- Toggle switch ----------------------------------------- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #e2e8f0;
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2563eb;  /* blue-600 */
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ---- Results breakdown rows -------------------------------- */
.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f1f5f9; /* slate-100 */
}

.breakdown-row:last-child {
  border-bottom: none;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Stat cards -------------------------------------------- */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
  tabular-nums: normal;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ---- Feature cards (home page) ----------------------------- */
.feature-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow 0.15s, transform 0.15s;
}

.feature-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
}

/* ---- Tags -------------------------------------------------- */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border-radius: 9999px;
  padding: 0.2rem 0.625rem;
}

/* ---- Ad slot placeholder ----------------------------------- */
.ad-slot-wrapper {
  width: 100%;
}

.ad-slot {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
}

.ad-slot-label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ---- Smooth result transitions ----------------------------- */
#results-panel {
  transition: opacity 0.2s;
}

/* ---- Number formatting ------------------------------------ */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ---- Toast notification ----------------------------------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Amortization table rows ------------------------------ */
#amortization-body tr {
  transition: background-color 0.1s;
}

#amortization-body tr:hover {
  background-color: #f8fafc;
}

/* ---- Mobile responsive tweaks ----------------------------- */
@media (max-width: 640px) {
  .stat-value {
    font-size: 1.2rem;
  }
}
