/* ----------------------------- */
/* Main Container & Sections */
/* ----------------------------- */
.deck-estimator-form {
  max-width: 900px;
  margin: 0 auto;
}

.deck-estimator-form fieldset.section {
  border: none;
  padding: 25px 30px;
  margin-bottom: 30px;
  border-radius: 10px;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.deck-estimator-form fieldset.section:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.deck-estimator-form legend {
  font-weight: 700;
  font-size: 1.4em;
  color: #2e3092;
  margin-bottom: 20px;
  padding: 0;
  border-bottom: 2px solid #2e3092;
  width: fit-content;
}

/* ----------------------------- */
/* Step Navigation & Layout */
/* ----------------------------- */
.form-step {
  display: none;
  margin-bottom: 30px;
}
.form-step.active {
  display: block;
}
.form-step::after {
  content: "";
  display: table;
  clear: both;
}

.form-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: center; /* center form + image vertically */
  gap: 10px;
}

.form-left,
.form-right {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
}

.step-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
}

/* ----------------------------- */
/* Form Inputs & Labels */
/* ----------------------------- */
.deck-estimator-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.deck-estimator-form .form-group {
  flex: 1 1 0px;
  min-width: 250px;
}

.deck-estimator-form label {
  font-weight: 600;
  font-size: 0.95em;
  color: #333;
  margin-bottom: 8px;
  display: block;
}

.deck-estimator-form select,
.deck-estimator-form input[type="text"],
.deck-estimator-form input[type="number"],
.deck-estimator-form input[type="email"],
.deck-estimator-form input[type="tel"],
.deck-estimator-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95em;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.deck-estimator-form select:focus,
.deck-estimator-form input:focus,
.deck-estimator-form textarea:focus {
  border-color: #2e3092;
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 48, 146, 0.1);
}

.deck-estimator-form small {
  font-size: 12px;
  color: #666;
  display: block;
  margin-top: 4px;
}

.deck-estimator-form input[type="checkbox"],
.deck-estimator-form input[type="radio"] {
  margin-right: 8px;
}

#custom-railing-wrapper,
#custom-fascia-wrapper {
  margin-top: 8px;
}

.deck-disclaimer {
  font-size: 13px;
  color: #000;
  line-height: 1.5;
  margin-top: 20px;
  background: #f9f9f9;
  padding: 15px 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* ----------------------------- */
/* Estimate Table */
/* ----------------------------- */
.estimate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
  border: 2px solid #007cba;
  border-radius: 6px;
  overflow: hidden;
}

.estimate-table th {
  background: #f1f8ff;
  text-align: left;
  font-size: 1.1em;
  padding: 10px;
  border-bottom: 1px solid #007cba;
}

.estimate-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.estimate-table tbody:last-child td {
  border-bottom: none;
}

.estimate-table tr:nth-child(even) td {
  background: #f9f9f9;
}

/* ----------------------------- */
/* ✅ Alerts / Errors / Spinners */
/* ----------------------------- */
.dm-alert {
  border-radius: 5px;
  padding: 15px 20px;
  margin: 15px 0;
  font-family: system-ui, sans-serif;
  border-left: 5px solid;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dm-alert-title {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 15px;
}

.dm-alert-info {
  background-color: #e7f3ff;
  border-color: #2196f3;
  color: #0b75c9;
}

.dm-alert-success {
  background-color: #e6f9ee;
  border-color: #2ecc71;
  color: #27ae60;
}

.dm-alert-warning {
  background-color: #fff9e6;
  border-color: #f1c40f;
  color: #b38600;
}

.dm-alert-error {
  background-color: #fdecea;
  border-color: #e74c3c;
  color: #c0392b;
}

input.dm-error-field,
select.dm-error-field,
textarea.dm-error-field {
  border: 2px solid #e74c3c !important;
  background-color: #fff5f5;
}

.dm-error-message {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 5px;
  display: block;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ----------------------------- */
/* Navigation Buttons */
/* ----------------------------- */
.form-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #eee;
}

.prev-btn {
  order: 1;
}

.next-btn,
.submit-btn {
  margin-left: auto;
  order: 2;
}

.next-btn,
.prev-btn,
.submit-btn {
  background: #2e3092;
  color: white;
  border: none;
  padding: 12px 24px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
}

.next-btn:hover,
.prev-btn:hover,
.submit-btn:hover {
  background: #1f207a;
}

/* ------------------------------ */
/* Results */
/* ------------------------------ */
.dm-results-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  padding: 30px 20px;
  text-align: center;
}

/* Summary Section */
.dm-summary {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.summary-item {
  text-align: center;
}

.summary-icon {
  font-size: 30px;
}

.summary-label {
  font-weight: 600;
  color: #000;
  margin-top: 5px;
}

.summary-value {
  font-size: 16px;
  color: #2e3092;
  font-weight: bold;
}

/* Tier Tabs */
.dm-tier-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.tier-tab {
  background: #f5f5f5;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.tier-tab.active {
  background: #2e3092;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tier-tab span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}

/* Image */
.dm-results-image {
  margin: 0 auto 30px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.dm-results-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Pricing Summary */
.dm-pricing-summary h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #2e3092;
}

.dm-pricing-summary p {
  font-size: 15px;
  color: #000;
  margin-bottom: 8px;
}

.dm-pricing-summary a {
  color: #2e3092;
  text-decoration: underline;
}

.dm-price-range {
  font-size: 32px;
  font-weight: bold;
  color: #2e3092;
  margin-top: 20px;
}

.dm-banner {
  width: 100%;
  height: 300px;
  background-color: #f5f5f5; /* light grayish-white */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 5px; /* optional */
}


/* ----------------------------- */
/* Responsive */
/* ----------------------------- */
@media screen and (max-width: 768px) {
  .deck-estimator-form .form-row {
    flex-direction: column;
  }

  .form-columns {
    flex-direction: column-reverse;
  }

  .form-right {
    display: none;
  }
  .form-navigation {
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .form-navigation button {
    width: auto;
  }

  .dm-summary {
    flex-direction: column;
    gap: 20px;
  }

  .dm-tier-tabs {
    flex-direction: column;
    gap: 10px;
  }

  .tier-tab {
    width: 100%;
  }
}
