/* ==========================================================================
   10. PROJECT COST ESTIMATOR
   ========================================================================== */

.nx-estimator {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-xl);
  box-shadow: var(--nx-shadow-lg);
  overflow: hidden;
}

.nx-estimator__grid {
  display: grid;
  grid-template-columns: 1fr 360px;
}

@media (max-width: 991.98px) {
  .nx-estimator__grid {
    grid-template-columns: 1fr;
  }
}

.nx-estimator__main {
  padding: clamp(1.5rem, 1.2rem + 1.5vw, 3rem);
}

/* ---------------- Stepper ---------------- */
.nx-estimator__stepper {
  display: flex;
  align-items: center;
  margin-bottom: var(--nx-space-8);
}

.nx-estimator__stepper-item {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  color: var(--nx-text-muted);
  font-size: var(--nx-fs-xs);
  font-weight: var(--nx-fw-medium);
}

.nx-estimator__stepper-dot {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--nx-border-color-strong);
  background: var(--nx-surface);
  color: var(--nx-text-secondary);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  transition: var(--nx-transition-base);
}

.nx-estimator__stepper-item.is-active .nx-estimator__stepper-dot {
  background: var(--nx-primary);
  border-color: var(--nx-primary);
  color: var(--nx-primary-contrast);
}

.nx-estimator__stepper-item.is-active {
  color: var(--nx-text-primary);
}

.nx-estimator__stepper-item.is-complete .nx-estimator__stepper-dot {
  background: var(--nx-success);
  border-color: var(--nx-success);
  color: var(--nx-white);
}

.nx-estimator__stepper-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--nx-border-color);
  margin-inline: var(--nx-space-3);
}

@media (max-width: 575.98px) {
  .nx-estimator__stepper-item span:last-child {
    display: none;
  }
}

/* ---------------- Steps ---------------- */
.nx-estimator__step {
  display: none;
}

.nx-estimator__step.is-active {
  display: block;
  animation: nx-fade-up var(--nx-duration-base) var(--nx-ease-emphasized) both;
}

.nx-estimator__step-title {
  margin-bottom: var(--nx-space-2);
}

.nx-estimator__step-hint {
  color: var(--nx-text-secondary);
  margin-bottom: var(--nx-space-6);
}

.nx-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--nx-space-3);
}

@media (max-width: 575.98px) {
  .nx-option-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nx-option-card {
  position: relative;
}

.nx-option-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.nx-option-card label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nx-space-2);
  text-align: center;
  padding: var(--nx-space-4) var(--nx-space-3);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-md);
  background: var(--nx-surface);
  font-size: var(--nx-fs-sm);
  font-weight: var(--nx-fw-medium);
  color: var(--nx-text-primary);
  cursor: pointer;
  transition: var(--nx-transition-base);
  height: 100%;
}

.nx-option-card label .bi {
  font-size: 1.35rem;
  color: var(--nx-text-secondary);
  transition: var(--nx-transition-colors);
}

.nx-option-card input:checked + label {
  border-color: var(--nx-primary);
  background: var(--nx-primary-soft);
  color: var(--nx-primary);
}

.nx-option-card input:checked + label .bi {
  color: var(--nx-primary);
}

.nx-option-card input:focus-visible + label {
  outline: 2px solid var(--nx-primary);
  outline-offset: 2px;
}

.nx-option-card__price {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  color: var(--nx-text-muted);
}

.nx-option-card input:checked + label .nx-option-card__price {
  color: var(--nx-primary);
}

/* Checkbox variant (features step) shows a check badge instead of relying
   solely on background color, so state doesn't depend on color alone. */
.nx-option-card--check label {
  position: relative;
}

.nx-option-card--check label::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--nx-border-color-strong);
  background: var(--nx-surface);
}

.nx-option-card--check input:checked + label::after {
  background: var(--nx-primary);
  border-color: var(--nx-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.7 4.3a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4 0l-3-3a1 1 0 1 1 1.4-1.4L7 9.6l5.3-5.3a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

.nx-estimator__nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--nx-space-8);
}

/* ---------------- Summary panel ---------------- */
.nx-estimator__summary {
  background: var(--nx-ink-900);
  color: var(--nx-white);
  padding: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
}

[data-bs-theme="dark"] .nx-estimator__summary {
  background: var(--nx-ink-950);
}

.nx-estimator__summary-label {
  color: var(--nx-slate-300);
  margin-bottom: var(--nx-space-2);
}

.nx-estimator__summary-value {
  font-family: var(--nx-font-display);
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  font-weight: var(--nx-fw-bold);
  line-height: 1.1;
  margin-bottom: var(--nx-space-6);
  word-break: break-word;
}

.nx-estimator__summary-value small {
  display: block;
  font-family: var(--nx-font-body);
  font-size: var(--nx-fs-xs);
  font-weight: var(--nx-fw-regular);
  color: var(--nx-slate-400);
  margin-top: var(--nx-space-2);
}

.nx-estimator__summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-3);
  margin-bottom: var(--nx-space-6);
  padding-bottom: var(--nx-space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-grow: 1;
}

.nx-estimator__summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--nx-space-3);
  font-size: var(--nx-fs-sm);
}

.nx-estimator__summary-row dt {
  color: var(--nx-slate-400);
}

.nx-estimator__summary-row dd {
  margin: 0;
  color: var(--nx-white);
  font-weight: var(--nx-fw-medium);
  text-align: right;
}

.nx-estimator__summary-actions {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-3);
}
