/* Founding Customer price calculator on /pricing (see price-calculator.js). */

/* Shown only when JavaScript runs; the examples list is the fallback.
   Same card family as the offer card, one step quieter. */
.price-calculator {
  display: flex;
  flex-direction: column;
  gap: var(--snow-space-md);
  margin-top: var(--snow-space-md);
  padding: var(--snow-space-lg);
  border: 1px solid var(--snow-color-border-default);
  border-radius: var(--snow-radius-lg);
  background: var(--snow-color-surface-elevated);
  box-shadow: var(--snow-shadow-sm);
}

.price-calculator[hidden],
.price-examples dl[hidden] {
  display: none;
}

/* One row: the label on the left, the number in a box sized to its digits. */
.calc-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--snow-space-xs) var(--snow-space-md);
}

/* A form label, quieter than the eyebrow above and the price below. */
.calc-label {
  color: var(--snow-color-text-muted);
  font-size: var(--snow-type-size-label);
  font-weight: var(--snow-type-weight-semibold);
}

/* A styled number box instead of the bare browser control. */
.calc-number {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: var(--snow-space-xs) var(--snow-space-md);
  border: 1px solid var(--snow-color-border-strong);
  border-radius: var(--snow-radius-md);
  background: var(--snow-color-surface-overlay);
}

.calc-number:focus-within {
  border-color: var(--snow-color-border-focus);
  box-shadow: 0 0 0 3px var(--snow-color-assistant-surface);
}

/* Width follows the digits (--digits, set by the script); tabular figures
   make 1ch a reliable digit width. */
.calc-number input {
  --digits: 3;
  width: calc(var(--digits) * 1ch + 0.05em);
  max-width: 100%;
  min-width: 2ch;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--snow-color-text-default);
  font: inherit;
  font-size: 1.75rem;
  font-weight: var(--snow-type-weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.calc-number input:focus {
  outline: none;
}


/* Slider: filled track up to the thumb, set through --fill by the script. */
.calc-slider input {
  --fill: 24.9%;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.calc-slider input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--snow-radius-full);
  background: linear-gradient(to right, var(--snow-color-assistant-primary) var(--fill), var(--snow-color-border-default) var(--fill));
}

.calc-slider input::-moz-range-track {
  height: 6px;
  border-radius: var(--snow-radius-full);
  background: var(--snow-color-border-default);
}

.calc-slider input::-moz-range-progress {
  height: 6px;
  border-radius: var(--snow-radius-full);
  background: var(--snow-color-assistant-primary);
}

.calc-slider input::-webkit-slider-thumb {
  width: 1.375rem;
  height: 1.375rem;
  margin-top: calc((6px - 1.375rem) / 2);
  border: 3px solid var(--snow-color-assistant-primary);
  border-radius: var(--snow-radius-full);
  background: var(--snow-color-surface-overlay);
  box-shadow: var(--snow-shadow-sm);
  -webkit-appearance: none;
}

.calc-slider input::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--snow-color-assistant-primary);
  border-radius: var(--snow-radius-full);
  background: var(--snow-color-surface-overlay);
  box-shadow: var(--snow-shadow-sm);
}

/* Focus shows on the handle, not as a frame around the whole slider. */
.calc-slider input:focus {
  outline: none;
}

.calc-slider input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--snow-color-assistant-surface), 0 0 0 6px var(--snow-color-border-focus);
}

.calc-slider input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--snow-color-assistant-surface), 0 0 0 6px var(--snow-color-border-focus);
}

.calc-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--snow-space-2xs);
  color: var(--snow-color-text-subtle);
  font-size: var(--snow-type-size-compact-label);
  font-variant-numeric: tabular-nums;
}

/* One price in front, the yearly figure and the calculation behind it. */
.calc-result {
  display: grid;
  gap: var(--snow-space-2xs);
}

.calc-month {
  color: var(--snow-color-text-muted);
  font-size: var(--snow-type-size-label);
}

.calc-month strong {
  margin-right: var(--snow-space-2xs);
  color: var(--snow-color-text-default);
  font-size: 2.25rem;
  font-weight: var(--snow-type-weight-medium);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.calc-year {
  color: var(--snow-color-text-default);
  font-size: var(--snow-type-size-label);
  font-weight: var(--snow-type-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.calc-basis {
  color: var(--snow-color-text-subtle);
  font-size: var(--snow-type-size-compact-label);
  font-variant-numeric: tabular-nums;
}

.price-calculator[data-minimum-applies] .calc-basis {
  color: var(--snow-color-status-warning-text);
}

/* The original three examples, same columns as before, now clickable.
   No boxes: the selected one is marked by a blue rule and blue price. */
.calc-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--snow-space-lg);
  border-top: 1px solid var(--snow-color-border-default);
}

/* Shared rows keep every price on one line even when a label wraps. */
.calc-presets button {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  align-items: end;
  gap: var(--snow-space-2xs);
  margin-top: -1px;
  padding: var(--snow-space-sm) 0 0;
  border: 0;
  border-top: 2px solid transparent;
  background: transparent;
  color: var(--snow-color-text-muted);
  font: inherit;
  font-size: var(--snow-type-size-compact-label);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease-out, color 150ms ease-out;
}

.calc-presets button small {
  color: var(--snow-color-text-subtle);
  font-size: inherit;
}

.calc-presets button strong {
  color: var(--snow-color-text-default);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  transition: color 150ms ease-out;
}

.calc-presets button:hover strong {
  color: var(--snow-color-action-secondary-text);
}

.calc-presets button[aria-pressed="true"] {
  border-top-color: var(--snow-color-assistant-primary);
}

.calc-presets button[aria-pressed="true"] strong {
  color: var(--snow-color-action-secondary-text);
}

.calc-presets button:focus-visible {
  outline: 2px solid var(--snow-color-border-focus);
  outline-offset: 2px;
}

/* Pinned to the bottom of the card when the card is taller than its content. */
.price-calculator .calc-note {
  margin-top: auto;
  color: var(--snow-color-text-muted);
  font-size: var(--snow-type-size-compact-label);
  line-height: 1.55;
}

@media (max-width: 600px) {
  .calc-month strong {
    font-size: 1.875rem;
  }

  /* The minimum is explained in the line above; keep the labels to two lines. */
  .calc-presets button small {
    display: none;
  }

  .calc-presets {
    gap: 0 var(--snow-space-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-presets button,
  .calc-presets button strong {
    transition: none;
  }
}
