/* Invoice Max Pro — interactive tool (calculator) widget styles.
 * Loaded only on `tool` content pages. Scoped under .ipm-tool so it never
 * touches the rest of the marketing site. Inherits the page fonts. */

.ipm-tool-wrap {
  margin: 24px 0 8px;
}

.ipm-tool-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  max-width: 520px;
}

.ipm-tool-modes {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #F1F5F9;
  border-radius: 10px;
  margin-bottom: 16px;
}

.ipm-tool-toggle {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.ipm-tool-toggle.is-active {
  background: #ffffff;
  color: #1F3F77;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.ipm-tool-field {
  display: block;
  margin-bottom: 14px;
}

.ipm-tool-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.ipm-tool-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: #0F172A;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
}

.ipm-tool-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.ipm-tool-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.ipm-tool-preset {
  border: 1px solid #CBD5E1;
  background: #ffffff;
  color: #334155;
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ipm-tool-preset:hover,
.ipm-tool-preset:focus {
  border-color: #2563EB;
  color: #1D4ED8;
}

.ipm-tool-results {
  margin-top: 8px;
  border-top: 1px dashed #E2E8F0;
  padding-top: 12px;
}

.ipm-tool-result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0;
}

.ipm-tool-result-label {
  color: #475569;
  font-size: 15px;
}

.ipm-tool-result-value {
  font-size: 18px;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
}

.ipm-tool-result-row.is-total {
  border-top: 1px solid #E2E8F0;
  margin-top: 6px;
  padding-top: 14px;
}

.ipm-tool-result-row.is-total .ipm-tool-result-label {
  font-weight: 700;
  color: #0F172A;
}

.ipm-tool-result-row.is-total .ipm-tool-result-value {
  font-size: 22px;
  color: #1F3F77;
}

/* RTL: the flex rows already mirror; nudge number alignment. */
.ipm-rtl .ipm-tool-result-value {
  direction: ltr;
  unicode-bidi: embed;
}

/* Dark mode — follow the viewer's preference. */
@media (prefers-color-scheme: dark) {
  .ipm-tool-card {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
  }
  .ipm-tool-modes { background: #1e293b; }
  .ipm-tool-toggle { color: #94a3b8; }
  .ipm-tool-toggle.is-active { background: #0b1220; color: #93c5fd; }
  .ipm-tool-label { color: #94a3b8; }
  .ipm-tool-input {
    background: #0b1220;
    border-color: #334155;
    color: #e2e8f0;
  }
  .ipm-tool-preset {
    background: #0b1220;
    border-color: #334155;
    color: #cbd5e1;
  }
  .ipm-tool-results,
  .ipm-tool-result-row.is-total { border-color: #1e293b; }
  .ipm-tool-result-label { color: #94a3b8; }
  .ipm-tool-result-value { color: #e2e8f0; }
  .ipm-tool-result-row.is-total .ipm-tool-result-label { color: #f1f5f9; }
  .ipm-tool-result-row.is-total .ipm-tool-result-value { color: #93c5fd; }
}
