/* ==========================================================================
   Instant Ballpark Estimator & Lead Capture — Residential Painting
   Clean, accessible, zero-dependency CSS
   ========================================================================== */

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;
  --accent-green: #059669;
  --accent-green-bg: #ecfdf5;
  --accent-amber: #b45309;
  --accent-amber-bg: #fffbeb;
  --error: #dc2626;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Demo Header Banner */
.demo-banner {
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

.banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  background-color: #3b82f6;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Main Layout */
.main-container {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  flex: 1;
}

.hero-section {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.hero-section h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* Grid: Left Column (Form) vs Right Column (Summary) */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

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

.step-num {
  background-color: var(--primary);
  color: #ffffff;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

/* Form Controls & Pill Groups */
.control-group {
  border: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.control-label, .form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.required {
  color: var(--error);
}

.pill-group {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.pill-option {
  position: relative;
  cursor: pointer;
  user-select: none;
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 140px;
}

.condition-group .pill-option {
  flex: 1 1 calc(33.333% - 0.5rem);
  min-width: 130px;
}

.pill-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pill-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px; /* Touch target requirement */
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s ease-in-out;
}

.pill-option input[type="radio"]:checked + span {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}

.pill-option input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Select, Inputs, Textarea */
.form-select, .form-input, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6875rem 0.875rem;
  min-height: 44px; /* Touch target requirement */
  color: var(--text-main);
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 600px) {
  .input-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.field-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.25rem;
  min-height: 1.1rem;
}

.input-error {
  border-color: var(--error) !important;
  background-color: #fef2f2;
}

/* Buttons */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px; /* High touch target */
  background-color: var(--primary);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, transform 0.05s ease;
  padding: 0.75rem 1.5rem;
  margin-top: 0.5rem;
}

.primary-btn:hover {
  background-color: var(--primary-hover);
}

.primary-btn:active {
  transform: translateY(1px);
}

.primary-btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background-color: #f1f5f9;
  color: var(--text-main);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.secondary-btn:hover {
  background-color: #e2e8f0;
}

.secondary-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.cta-microcopy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.625rem;
}

/* Summary Card */
.sticky-card {
  position: static;
}

@media (min-width: 900px) {
  .sticky-card {
    position: sticky;
    top: 1.5rem;
  }
}

.summary-card {
  border-top: 4px solid var(--primary);
}

.summary-header {
  background-color: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.summary-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.price-display {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0.25rem 0;
  transition: color 0.15s ease;
}

.price-turnaround {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-green);
}

.breakdown-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.breakdown-list {
  list-style: none;
  margin-bottom: 1.25rem;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px dashed #e2e8f0;
}

.breakdown-list li:last-child {
  border-bottom: none;
}

.item-label {
  color: var(--text-muted);
  font-weight: 500;
}

.item-value {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

.item-value.highlight {
  color: var(--primary);
}

.disclaimer-box {
  background-color: var(--accent-amber-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.875rem;
  font-size: 0.8125rem;
  color: var(--accent-amber);
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.disclaimer-box strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #92400e;
}

.quick-guarantee {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.guarantee-icon {
  color: var(--accent-green);
  font-weight: 700;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-green);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--border-focus);
}

.modal-body {
  padding: 1.5rem;
}

.demo-callout {
  background-color: var(--accent-green-bg);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: #065f46;
}

.demo-callout strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #047857;
}

.captured-details h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.details-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  row-gap: 0.5rem;
  column-gap: 0.75rem;
  font-size: 0.875rem;
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.details-list dt {
  font-weight: 600;
  color: var(--text-muted);
}

.details-list dd {
  font-weight: 600;
  color: var(--text-main);
}

.modal-price {
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
}

/* Mobile Responsiveness Fine-Tuning (375px) */
@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.625rem;
  }
  .card {
    padding: 1.25rem;
  }
  .pill-option {
    flex: 1 1 100%;
  }
  .price-display {
    font-size: 1.875rem;
  }
  .details-list {
    grid-template-columns: 100px 1fr;
  }
}
