/* CAPIPOINT payback calculator
   colors: bg #fff · text #333 · accent #58ADF3
   green (discount) #428C08 · light blue info #EAF4FD · cta bg #FEF5EC
   font: Wix Madefor Text */
:root {
  --accent: #58adf3;
  --accent-dark: #3d97e0;
  --ink: #333333;
  --ink-soft: #7a7a7a;
  --line: #e6e6e6;
  --field-border: #e6e6e6;
  --bg: #ffffff;
  --card: #ffffff;
  --good: #428c08;
  --info-blue: #eaf4fd;
  --cta-bg: #fef5ec;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(51, 51, 51, 0.06);
  --font:
    "Wix Madefor Text", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica,
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

.cp-calculator {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  background-image: url(../../img/bg2.jpg);
  background-size: contain;
  background-position: 0 0;
}

/* header */
.cp-header {
  text-align: left;
  margin-bottom: 32px;
  max-width: 600px;
}
.cp-title {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.3px;
  text-transform: uppercase;
  line-height: 1.2;
}
.cp-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

/* layout */
.cp-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .cp-grid {
    grid-template-columns: 1fr;
  }
}

.cp-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(8px);
  height: 100%;
}
.cp-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 20px;
  color: var(--accent-dark);
  font-weight: 700;
}
.cp-card__title--first {
  margin-left: 13px;
}

@media(max-width: 560px) {
  .cp-card__title--first {
  margin-left: 11px;
}
}

.cp-card__icon {
  width: clamp(2.25rem, 1.9167rem + 1.4815vw, 3.25rem);
  height: clamp(2.25rem, 1.9167rem + 1.4815vw, 3.25rem);
}
.cp-title__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--accent);
}

/* form fields */
.cp-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.cp-field__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.cp-field__icon {
  width: clamp(2rem, 1.6667rem + 1.4815vw, 3rem);
  height: clamp(2rem, 1.6667rem + 1.4815vw, 3rem);
  flex: 0 0 auto;
  color: var(--accent);
  display: inline-flex;
}
.cp-field__icon svg {
  width: 22px;
  height: 22px;
}
.cp-field__headtext {
  min-width: 0;
}
.cp-field__control {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
}
.cp-field__control--full {
  max-width: 100%;
}

.cp-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
  color: var(--ink);
}
.cp-hint {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.cp-hint--discount {
  margin-top: 6px;
  color: var(--good);
  font-weight: 600;
}

/* slider + location stack vertically instead of side by side */
.cp-field--range {
  display: block;
}
.cp-field--range .cp-field__head {
  max-width: none;
  margin-bottom: 10px;
}

@media (max-width: 560px) {
  .cp-field {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .cp-field__head {
    flex: 1 1 auto;
    max-width: none;
  }
}

/* inputs */
.cp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.cp-input-prefix {
  position: absolute;
  left: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  pointer-events: none;
}
.cp-input-suffix {
  position: absolute;
  right: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  pointer-events: none;
}
.cp-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cp-input--currency {
  padding-left: 38px;
}
.cp-input-wrap--small .cp-input {
  padding-right: 56px;
}
.cp-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 173, 243, 0.18);
}
.cp-input--error {
  border-color: #c0392b;
}
.cp-input--error:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}
.cp-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #c0392b;
  font-weight: 600;
}

/* location dropdown */
.cp-select {
  width: 100%;
  padding: 11px 38px 11px 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237A7A7A' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cp-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 173, 243, 0.18);
}

/* cups: slider + number */
.cp-cups {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cp-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}
.cp-input-wrap--small {
  width: 120px;
  flex: 0 0 auto;
}

.cp-tooltip {
  margin-top: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.4;
}
.cp-tooltip--warn {
  background: #fff4e5;
  color: #8a5a00;
  border: 1px solid #f3d9a8;
}

/* units stepper */
.cp-units {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cp-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  overflow: hidden;
}
.cp-stepper__btn {
  width: 40px;
  height: 42px;
  border: none;
  background: #f5f7fa;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}
.cp-stepper__btn:hover {
  background: #eaf4fd;
  color: var(--accent);
}
.cp-stepper__input {
  width: 60px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--field-border);
  border-right: 1px solid var(--field-border);
  height: 42px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
}
.cp-stepper__input:focus {
  outline: none;
}

/* discount badge (green) */
.cp-badge[hidden] {
  display: none;
}
.cp-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(66, 140, 8, 0.12);
  color: var(--good);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(66, 140, 8, 0.3);
  cursor: default;
  outline: none;
}
.cp-badge__tip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--good);
  color: #fff;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 8px 20px rgba(66, 140, 8, 0.25);
}
.cp-badge__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--good);
}
.cp-badge:hover .cp-badge__tip,
.cp-badge:focus .cp-badge__tip,
.cp-badge:focus-visible .cp-badge__tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* fixed read-only value */
.cp-fixed-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

/* info note (light blue) */
.cp-infobox {
  background: var(--info-blue);
  padding: 20px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #2c5a82;
  margin: 4px 0 0;
}

/* payback — no background, bigger months number */
.cp-payback {
  text-align: center;
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.cp-payback__label {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.cp-payback__value {
  margin: 4px 0 0;
  font-size: clamp(2rem, 0.7917rem + 5.3704vw, 5.625rem);
  line-height: 1;
  font-weight: 800;
  color: var(--accent-dark);
}
.cp-payback__unit {
  margin: 2px 0 0;
  font-size: 16px;
  color: var(--accent);
  text-transform: uppercase;
}
.cp-payback__message {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--good);
}

/* result rows, icon on the left */
.cp-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}

.cp-row--no-border {
  border: none;
}
.cp-row__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.cp-row__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--accent-dark);
  padding: 10px;
  background: radial-gradient(at center, #ddf1ff 39.92%, #bad7ff 76.05%);
  border-radius: 100%;
}
.cp-row__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.cp-row--highlight {
  border-bottom: none;
  border-top: 1px solid var(--info-blue);
  margin-top: 0px;
  padding-top: 14px;
}
.cp-row--highlight .cp-row__label,
.cp-row--highlight .cp-row__value {
  color: var(--good);
  font-size: 17px;
  font-weight: bold;
}
.cp-row--discount .cp-row__value {
  color: var(--good);
}

/* room for an image after the net profit row */
.cp-result__media {
  min-height: 120px;
}
.cp-result__media img {
  max-width: 100%;
}


/* call-to-action bar */
.cp-cta {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--cta-bg);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.cp-cta__icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #E68F55;
  color: var(--accent);
}
.cp-cta__icon svg {
  width: 26px;
  height: 26px;
}
.cp-cta__text {
  flex: 1 1 auto;
  min-width: 0;
}
.cp-cta__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
}
.cp-cta__desc {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.cp-btn {
  display: inline-block;
  text-align: center;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 0.1s,
    background 0.15s;
  white-space: nowrap;

  text-transform: uppercase;
}
.cp-btn:active {
  transform: translateY(1px);
}
.cp-btn--cta {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}
.cp-btn--cta:hover {
  background: var(--accent-dark);
}

@media (max-width: 640px) {
  .cp-cta {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .cp-btn--cta {
    width: 100%;
  }
}
