/* =============================================
 * Calculator — Multi-step form styles
 *
 * Covers: autocomplete dropdown, price step,
 * contacts step, success step, field errors,
 * loading states, step transitions.
 * ============================================= */

/* ===================== */
/* // HIDDEN UTILITY
/* ===================== */

[data-calc-form] .hidden {
  display: none !important;
}

/* ===================== */
/* // AUTOCOMPLETE DROPDOWN
/* ===================== */

.calc__autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #dee3e6;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 220px;
  overflow-y: auto;
}

.calc__autocomplete.open {
  display: block;
}

.calc__autocomplete-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  color: #202426;
  cursor: pointer;
  transition: background 0.15s;
}

.calc__autocomplete-item:hover {
  background: #f5f7f8;
}

.calc__autocomplete-item:first-child {
  border-radius: 10px 10px 0 0;
}

.calc__autocomplete-item:last-child {
  border-radius: 0 0 10px 10px;
}

.calc__autocomplete-item:only-child {
  border-radius: 10px;
}

.calc__autocomplete-msg {
  padding: 10px 16px;
  font-size: 13px;
  color: #adb6bd;
}

/* ===================== */
/* // FIELD ERRORS
/* ===================== */

.form__group.has-error .input input {
  border-color: #ef4444;
}

.form__group.has-error .input input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ===================== */
/* // PRICE STEP
/* ===================== */

.calc__price-card {
  text-align: center;
  padding: 0.75rem 0 0.5rem;
}

.calc__price-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  color: #202426;
  line-height: 1.2;
}

@media (max-width: 575px) {
  .calc__price-value {
    font-size: 36px;
    min-height: 44px;
  }
}

.calc__price-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14px;
  color: #6c767d;
}

.calc__price-label iconify-icon {
  font-size: 14px;
  color: #adb6bd;
}

/* ===================== */
/* // ROUTE SUMMARY
/* ===================== */

.calc__summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f5f7f8;
  border-radius: 10px;
  border: 1px solid #e9edf0;
  overflow: hidden;
}

.calc__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 14px;
}

.calc__summary-row + .calc__summary-row {
  border-top: 1px solid #e9edf0;
}

.calc__summary-row > span:first-child {
  color: #6c767d;
  font-weight: 500;
}

.calc__summary-row > span:last-child {
  color: #202426;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================== */
/* // STEP BUTTONS
/* ===================== */

.calc__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.calc__btn-half {
  width: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* ===================== */
/* // SUCCESS STEP
/* ===================== */

.calc__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.calc__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  margin-bottom: 1rem;
}

.calc__success-icon iconify-icon {
  font-size: 28px;
}

.calc__success h4 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #202426;
  margin: 0 0 0.5rem;
}

.calc__success p {
  font-size: 14px;
  color: #6c767d;
  line-height: 1.5;
  max-width: 280px;
  margin: 0;
}

/* ===================== */
/* // LOADING SPINNER
/* ===================== */

.calc__spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e5e5e5;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: calc-spin 0.7s linear infinite;
}

@keyframes calc-spin {
  to { transform: rotate(360deg); }
}

/* Button loading state */

.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: calc-spin 0.7s linear infinite;
}

.btn.loading iconify-icon {
  visibility: hidden;
}

/* ===================== */
/* // CONTACTS STEP HINT
/* ===================== */

.calc__contact-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #adb6bd;
  font-size: 12px;
  font-weight: 500;
}

.calc__contact-hint::before,
.calc__contact-hint::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e9edf0;
}
