/* estimate-calculator.css — Styles for Instant Estimate Calculator */

.estimate-calculator-wrapper :is(button, input, select, textarea, a):focus-visible {
  outline: 3px solid #075f90;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}

/* ===== CALCULATOR CONTAINER ===== */
.estimate-calculator-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  animation: slideUp 500ms var(--transition-fast);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== PROGRESS BAR ===== */
:where(.estimate-calculator-wrapper) .estimate-progress {
  width: 100%;
  height: 6px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

:where(.estimate-calculator-wrapper) .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cta), var(--color-primary));
  transition: width 400ms var(--transition-medium);
  border-radius: var(--radius-full);
}

:where(.estimate-calculator-wrapper) .progress-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-weight: 500;
}

/* ===== FORM CONTAINER ===== */
:where(.estimate-calculator-wrapper) .estimate-form-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-height: 300px;
  animation: fadeIn 300ms var(--transition-fast);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

:where(.estimate-calculator-wrapper) .estimate-form-container h2 {
  font-size: var(--text-xl);
  color: var(--color-text);
  margin: 0;
}

:where(.estimate-calculator-wrapper) .estimate-form-container > p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== STEP 1: SERVICE GRID ===== */
:where(.estimate-calculator-wrapper) .service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

@media (min-width: 768px) {
  :where(.estimate-calculator-wrapper) .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

:where(.estimate-calculator-wrapper) .service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface-2);
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-medium);
  min-height: 140px;
}

:where(.estimate-calculator-wrapper) .service-card:hover {
  border-color: var(--color-cta);
  background: var(--color-bg);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

:where(.estimate-calculator-wrapper) .service-card:active {
  transform: translateY(-2px);
}

:where(.estimate-calculator-wrapper) .service-icon {
  font-size: 2.5rem;
}

:where(.estimate-calculator-wrapper) .service-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

/* ===== FORM GROUPS ===== */
:where(.estimate-calculator-wrapper) .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

:where(.estimate-calculator-wrapper) .form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

:where(.estimate-calculator-wrapper) .form-group input[type="text"],
:where(.estimate-calculator-wrapper) .form-group input[type="email"],
:where(.estimate-calculator-wrapper) .form-group input[type="tel"],
:where(.estimate-calculator-wrapper) .form-group input[type="number"],
:where(.estimate-calculator-wrapper) .form-group select,
:where(.estimate-calculator-wrapper) .form-group textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .form-group input[type="text"]:focus,
:where(.estimate-calculator-wrapper) .form-group input[type="email"]:focus,
:where(.estimate-calculator-wrapper) .form-group input[type="tel"]:focus,
:where(.estimate-calculator-wrapper) .form-group input[type="number"]:focus,
:where(.estimate-calculator-wrapper) .form-group select:focus,
:where(.estimate-calculator-wrapper) .form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.1);
}

:where(.estimate-calculator-wrapper) .form-group textarea {
  font-family: var(--font-body);
  resize: vertical;
  min-height: 100px;
}

/* ===== SLIDER ===== */
:where(.estimate-calculator-wrapper) .slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

:where(.estimate-calculator-wrapper) .slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-cta);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .slider::-webkit-slider-thumb:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

:where(.estimate-calculator-wrapper) .slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-cta);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .slider::-moz-range-thumb:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

:where(.estimate-calculator-wrapper) .slider::-moz-range-track {
  background: none;
  border: none;
}

:where(.estimate-calculator-wrapper) .slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

/* ===== RADIO & CHECKBOX GROUPS ===== */
:where(.estimate-calculator-wrapper) .radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

:where(.estimate-calculator-wrapper) .radio-option,
:where(.estimate-calculator-wrapper) .checkbox-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--color-surface-2);
  transition: all var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .radio-option:hover,
:where(.estimate-calculator-wrapper) .checkbox-option:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

:where(.estimate-calculator-wrapper) .radio-option input[type="radio"],
:where(.estimate-calculator-wrapper) .radio-option input[type="checkbox"],
:where(.estimate-calculator-wrapper) .checkbox-option input[type="radio"],
:where(.estimate-calculator-wrapper) .checkbox-option input[type="checkbox"] {
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin: 0;
}

:where(.estimate-calculator-wrapper) .radio-option span,
:where(.estimate-calculator-wrapper) .checkbox-option span {
  font-size: var(--text-base);
  color: var(--color-text);
}

:where(.estimate-calculator-wrapper) .radio-option input:checked + span,
:where(.estimate-calculator-wrapper) .checkbox-option input:checked + span {
  font-weight: 600;
  color: var(--color-primary);
}

/* ===== NOTE ===== */
:where(.estimate-calculator-wrapper) .note {
  background: var(--color-surface-2);
  border-left: 4px solid var(--color-warning);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ===== STEP 3: ESTIMATE DISPLAY ===== */
:where(.estimate-calculator-wrapper) .estimate-display {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: var(--color-text-inverse);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  text-align: center;
  animation: slideUp 500ms var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .estimate-amount {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

:where(.estimate-calculator-wrapper) .dollar {
  font-size: 0.7em;
}

:where(.estimate-calculator-wrapper) .number {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  line-height: 1;
}

:where(.estimate-calculator-wrapper) .separator {
  font-weight: 300;
}

:where(.estimate-calculator-wrapper) .estimate-disclaimer {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-top: var(--space-6);
  line-height: 1.6;
}

:where(.estimate-calculator-wrapper) .estimate-details {
  margin-top: var(--space-6);
}

:where(.estimate-calculator-wrapper) .estimate-details h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

:where(.estimate-calculator-wrapper) .estimate-details ul {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

:where(.estimate-calculator-wrapper) .estimate-details li {
  padding-left: var(--space-6);
  position: relative;
  font-size: var(--text-base);
  line-height: 1.5;
}

:where(.estimate-calculator-wrapper) .estimate-details li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
  font-size: 1.2em;
}

/* ===== ACTIONS ===== */
:where(.estimate-calculator-wrapper) .estimate-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

:where(.estimate-calculator-wrapper) .btn-back,
:where(.estimate-calculator-wrapper) .btn-next,
:where(.estimate-calculator-wrapper) .btn-submit {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 640px) {
  :where(.estimate-calculator-wrapper) .estimate-actions {
    flex-direction: column;
  }

  :where(.estimate-calculator-wrapper) .btn-back {
    order: 2;
  }

  :where(.estimate-calculator-wrapper) .btn-next,
  :where(.estimate-calculator-wrapper) .btn-submit {
    order: 1;
  }
}

/* ===== SUCCESS STATE ===== */
:where(.estimate-calculator-wrapper) .estimate-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12);
  min-height: 400px;
  animation: slideUp 500ms var(--transition-fast);
}

:where(.estimate-calculator-wrapper) .success-icon {
  font-size: 4rem;
  color: var(--color-success);
  margin-bottom: var(--space-4);
  animation: scaleIn 500ms var(--transition-fast);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

:where(.estimate-calculator-wrapper) .estimate-success h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

:where(.estimate-calculator-wrapper) .estimate-success p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .estimate-calculator-wrapper {
    padding: var(--space-6);
    gap: var(--space-6);
  }

  :where(.estimate-calculator-wrapper) .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  :where(.estimate-calculator-wrapper) .estimate-amount {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  :where(.estimate-calculator-wrapper) .estimate-actions {
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .estimate-calculator-wrapper {
    padding: var(--space-4);
  }

  :where(.estimate-calculator-wrapper) .service-grid {
    grid-template-columns: 1fr;
  }

  :where(.estimate-calculator-wrapper) .estimate-form-container h2 {
    font-size: var(--text-lg);
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  .estimate-calculator-wrapper,
  :where(.estimate-calculator-wrapper) .estimate-form-container,
  :where(.estimate-calculator-wrapper) .estimate-display,
  :where(.estimate-calculator-wrapper) .estimate-success,
  :where(.estimate-calculator-wrapper) .success-icon,
  :where(.estimate-calculator-wrapper) .service-card,
  :where(.estimate-calculator-wrapper) .slider::-webkit-slider-thumb,
  :where(.estimate-calculator-wrapper) .slider::-moz-range-thumb,
  :where(.estimate-calculator-wrapper) .radio-option,
  :where(.estimate-calculator-wrapper) .checkbox-option {
    animation: none;
    transition: none;
  }
}

.estimate-calculator-wrapper .estimate-bound { display: inline-flex; align-items: baseline; white-space: nowrap; gap: .1em; }


/* A client can keep the same planning assumptions before and after an inquiry. */
:where(.estimate-calculator-wrapper) .estimate-saved-summary {margin:12px 0;padding:20px;border:1px solid #d8e1e6;border-radius:8px;background:#f7f9fa;color:#163445}
:where(.estimate-calculator-wrapper) .estimate-saved-summary h3 {margin:0 0 14px;font-size:1.05rem}
:where(.estimate-calculator-wrapper) .estimate-saved-summary dl {display:grid;gap:10px;margin:0}
:where(.estimate-calculator-wrapper) .estimate-saved-summary dl>div {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:16px}
:where(.estimate-calculator-wrapper) .estimate-saved-summary dt {color:#465b67}
:where(.estimate-calculator-wrapper) .estimate-saved-summary dd {margin:0;font-weight:600;overflow-wrap:anywhere}
:where(.estimate-calculator-wrapper) .estimate-summary-note {font-size:.85rem;line-height:1.6;color:#465b67}
:where(.estimate-calculator-wrapper) .estimate-save-actions {display:flex;flex-wrap:wrap;gap:12px}
:where(.estimate-calculator-wrapper) .estimate-save-actions button {min-height:44px}
:where(.estimate-calculator-wrapper) .estimate-export-status:empty {display:none}
:where(.estimate-calculator-wrapper) .estimate-export-status {font-size:.85rem;line-height:1.6}
:where(.estimate-calculator-wrapper) button:disabled {opacity:.6;cursor:wait}
@media(max-width:650px) {
 :where(.estimate-calculator-wrapper) .estimate-saved-summary {padding:16px}
 :where(.estimate-calculator-wrapper) .estimate-saved-summary dl>div {grid-template-columns:1fr;gap:2px}
 :where(.estimate-calculator-wrapper) .estimate-save-actions {flex-direction:column}
 :where(.estimate-calculator-wrapper) .estimate-actions .btn {white-space:normal;text-align:center;min-height:44px}
 :where(.estimate-calculator-wrapper) .estimate-amount {font-size:1.3rem!important;overflow-wrap:anywhere}
}
.estimate-print-sheet {display:none}
@media print {
 body.sx-estimate-printing {margin:0!important;padding:0!important;background:#fff!important;color:#111!important}
 body.sx-estimate-printing>:not(.estimate-print-sheet) {display:none!important}
 body.sx-estimate-printing>.estimate-print-sheet {display:block!important;margin:0;padding:15mm;font:11pt/1.5 Arial,sans-serif;color:#111;background:#fff}
 .estimate-print-sheet header {border-bottom:2px solid #183748;margin-bottom:18pt}
 .estimate-print-sheet header>p:first-child {font-size:18pt;font-weight:700;margin:0}
 .estimate-print-sheet h1 {font-size:22pt;line-height:1.2;margin:9pt 0}
 .estimate-print-sheet h2 {font-size:20pt;line-height:1.3}
 .estimate-print-sheet h3 {font-size:12pt}
 .estimate-print-sheet dl>div {display:grid;grid-template-columns:1fr 1.3fr;gap:16pt;padding:7pt 0;border-bottom:1px solid #ddd;break-inside:avoid}
 .estimate-print-sheet dd {margin:0;font-weight:700}
 .estimate-print-sheet p,.estimate-print-sheet dd {overflow-wrap:anywhere}
 .estimate-print-sheet footer {margin-top:22pt;padding-top:12pt;border-top:2px solid #183748}
}
