/* Calculator & Cost Estimator Styles — Refreshing Modern Theme */

.calculator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.8rem;
  align-items: start;
}

.calc-grid > div {
  min-width: 0;
  width: 100%;
}

.floor-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.floor-btn-grid .floor-btn {
  padding: 0.75rem 0.8rem;
  font-size: 0.86rem;
  text-align: center;
  line-height: 1.25;
}

.calc-section-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.calc-section-title i {
  color: var(--resa-blue);
}

.service-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.type-pill {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.type-pill input {
  display: none;
}

.type-pill:hover {
  border-color: var(--resa-blue);
  transform: translateY(-2px);
}

.type-pill.active {
  background: var(--bg-soft-tint);
  border-color: var(--resa-blue);
  box-shadow: var(--shadow-gold);
}

.type-pill i {
  font-size: 1.5rem;
  color: var(--resa-blue);
  margin-bottom: 0.5rem;
  display: block;
}

.type-pill strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.type-pill span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Slider & Input */
.calc-control-group {
  margin-bottom: 2rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.area-input-wrap {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--resa-blue);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.9rem 0.25rem 0.75rem;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.12);
  transition: var(--transition);
}

.area-input-wrap:focus-within {
  border-color: var(--resa-green);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.16);
}

.area-number-input {
  width: 78px;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--resa-blue);
  text-align: right;
  outline: none;
  padding-right: 0.35rem;
  -moz-appearance: textfield;
}

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

.area-unit {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
  user-select: none;
}

.area-presets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.area-preset-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
}

.area-preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.area-preset-btn {
  padding: 0.24rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.area-preset-btn:hover {
  border-color: var(--resa-blue);
  color: var(--resa-blue);
  background: var(--bg-soft-tint);
}

.area-preset-btn.active {
  background: var(--resa-blue);
  color: #ffffff;
  border-color: var(--resa-blue);
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-gradient);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  border: 3px solid #ffffff;
}

/* Grade Selection Cards */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.grade-card {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.grade-card input {
  display: none;
}

.grade-card:hover {
  border-color: var(--resa-blue);
}

.grade-card.active {
  background: var(--bg-soft-tint);
  border-color: var(--resa-blue);
  box-shadow: var(--shadow-gold);
}

.grade-card h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.grade-rate {
  font-size: 0.85rem;
  color: var(--resa-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.grade-specs {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Calculation Result Box */
.calc-result-panel {
  background: var(--bg-soft-tint);
  border: 1.5px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-md);
}

.calc-total-box {
  text-align: center;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.6rem;
}

.calc-total-box span {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.grand-total-amount {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--resa-blue);
  font-family: var(--font-heading);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
}

.cost-row span {
  color: var(--text-muted);
  line-height: 1.35;
}

.cost-row strong {
  color: var(--text-main);
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.breakdown-section {
  margin: 1.6rem 0;
}

.breakdown-item {
  margin-bottom: 1rem;
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.breakdown-header strong {
  color: var(--text-main);
}

.progress-bar-bg {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.timeline-info {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timeline-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-subtle);
  color: var(--resa-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.timeline-text strong {
  font-size: 0.92rem;
  color: var(--text-main);
  display: block;
}

.timeline-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 992px) {
  .calc-grid { grid-template-columns: 1fr; gap: 2rem; }
  .calc-result-panel { position: static; }
}

@media (max-width: 768px) {
  .calculator-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
  .calc-section-title {
    font-size: 0.96rem;
  }
  .service-type-selector {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
  }
  .type-pill {
    padding: 0.95rem 0.85rem;
  }
  .slider-header {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .area-input-wrap {
    padding: 0.2rem 0.75rem 0.2rem 0.6rem;
  }
  .area-number-input {
    width: 64px;
    font-size: 1.02rem;
  }
  .floor-btn-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .floor-btn-grid .floor-btn {
    width: 100%;
    padding: 0.72rem 1rem;
  }
  .grade-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .grade-card {
    padding: 1rem;
  }
  .calc-result-panel {
    padding: 1.35rem 1.05rem;
    border-radius: var(--radius-md);
  }
  .grand-total-amount {
    font-size: 1.65rem;
    word-break: break-word;
  }
  .cost-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .breakdown-header {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
}
