/* ============================================================
   The Creators — Service Estimate Configurator
   Scoped stylesheet for the interactive estimate builder on
   services/index.html. Reuses shared tokens/utilities from
   css/style.css (--brand-*, .glass-card, .section-mesh, .btn,
   .form-control) so it stays visually consistent with the rest
   of the site rather than introducing a parallel design system.
   ============================================================ */

/* ---------- Toolbar (search + industry filter) ---------- */
.estimate-toolbar {
  padding: 22px 24px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.estimate-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
}
.estimate-search svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted-text); pointer-events: none;
}
.estimate-search input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--body-text);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}
.estimate-search input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(36,107,255,0.12); }
.estimate-industries { display: flex; flex-wrap: wrap; gap: 8px; }
.industry-pill {
  padding: 9px 18px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--body-text);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition);
}
.industry-pill:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.industry-pill.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(36,107,255,0.3);
}

/* ---------- Layout: list + sticky summary ---------- */
.estimate-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
  align-items: start;
}
.estimate-list { display: flex; flex-direction: column; gap: 28px; }
.estimate-group-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 12px;
}
.estimate-group { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Service row ---------- */
.estimate-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}
.estimate-row::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}
.estimate-row:hover { border-color: rgba(36,107,255,0.35); transform: translateY(-2px); box-shadow: var(--shadow); }
.estimate-row.checked { border-color: transparent; box-shadow: 0 10px 26px rgba(36,107,255,0.18); }
.estimate-row.checked::before { opacity: 0.06; }
.estimate-row > * { position: relative; z-index: 1; }
.estimate-row-check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  background: var(--surface);
}
.estimate-row-check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(0.5); transition: var(--transition); }
.estimate-row.checked .estimate-row-check { background: var(--gradient-primary); border-color: transparent; }
.estimate-row.checked .estimate-row-check svg { opacity: 1; transform: scale(1); }
.estimate-row-body { flex: 1; min-width: 0; }
.estimate-row-body h4 { font-size: 1rem; margin-bottom: 3px; color: var(--heading); }
.estimate-row-body p { font-size: 0.85rem; color: var(--muted-text); margin: 0; }
.estimate-row-price { flex-shrink: 0; font-weight: 800; color: var(--brand-blue); font-size: 1rem; white-space: nowrap; }
.estimate-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.estimate-empty { text-align: center; padding: 48px 20px; color: var(--muted-text); }
.link-btn { color: var(--brand-blue); font-weight: 700; text-decoration: underline; }

/* ---------- Summary sidebar ---------- */
.estimate-summary {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  padding: 28px 26px;
  text-align: center;
}
.estimate-summary-label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-text); }
.estimate-summary-total {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 2.7rem);
  background: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 6px 0 2px;
  transition: transform 0.15s ease;
}
.estimate-summary-total.bump { transform: scale(1.06); }
.estimate-summary-count { font-size: 0.88rem; color: var(--muted-text); margin-bottom: 20px; }
.estimate-summary-note {
  text-align: left;
  background: rgba(36,107,255,0.06);
  border: 1px solid rgba(36,107,255,0.15);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.estimate-summary-note strong { display: block; font-size: 0.85rem; color: var(--heading); margin-bottom: 4px; }
.estimate-summary-note p { font-size: 0.8rem; color: var(--muted-text); margin: 0; line-height: 1.5; }
.estimate-summary-actions { display: flex; flex-direction: column; gap: 10px; }
.estimate-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--body-text);
  border-radius: 50px;
  padding: 15px 34px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
}
.estimate-btn-ghost:hover:not(:disabled) { border-color: var(--brand-blue); color: var(--brand-blue); }
.estimate-summary-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.estimate-summary-actions .btn svg { width: 16px; height: 16px; }

/* ---------- Inline email lead form ---------- */
.estimate-email-form { margin-top: 16px; text-align: left; }
.estimate-email-form .form-group { margin-bottom: 12px; }
.estimate-email-form .form-control { padding: 12px 14px; font-size: 0.88rem; }

/* ---------- Live Preview modal ---------- */
.estimate-modal {
  position: fixed; inset: 0; z-index: 3500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}
.estimate-modal.open { display: flex; }
.estimate-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(9,27,64,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.estimate-modal-box {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}
.estimate-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--body-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; line-height: 1; border: 1px solid var(--border-color);
  transition: var(--transition);
}
.estimate-modal-close:hover { background: var(--brand-blue); color: #fff; border-color: transparent; }
.estimate-modal-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 18px 24px; border-top: 1px solid var(--border-color);
}

/* ---------- Proposal document (used inside the preview modal) ---------- */
.estimate-doc { padding: 36px 32px 8px; max-height: 68vh; overflow-y: auto; }
.estimate-doc-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 20px; margin-bottom: 20px;
  border-bottom: 3px solid transparent;
  border-image: var(--gradient-primary) 1;
}
.estimate-doc-header img { width: 46px; height: 46px; flex-shrink: 0; }
.estimate-doc-header .company-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--heading); }
.estimate-doc-header .company-meta { font-size: 0.8rem; color: var(--muted-text); }
.estimate-doc-title { font-size: 1.4rem; font-weight: 800; color: var(--heading); margin-bottom: 4px; }
.estimate-doc-subtitle { font-size: 0.85rem; color: var(--muted-text); margin-bottom: 24px; }
.estimate-doc-prepared {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  background: var(--surface-2); border-radius: var(--radius); padding: 16px;
  margin-bottom: 24px;
}
.estimate-doc-prepared label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-text); margin-bottom: 6px; }
.estimate-doc-prepared input {
  width: 100%; border: 1px solid var(--border-color); background: var(--surface);
  border-radius: 8px; padding: 8px 10px; font-size: 0.88rem; color: var(--body-text); outline: none;
}
.estimate-doc-prepared input:focus { border-color: var(--brand-blue); }
.estimate-doc-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.estimate-doc-table thead th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted-text); padding: 0 0 10px; border-bottom: 2px solid var(--border-color);
}
.estimate-doc-table thead th:last-child { text-align: right; }
.estimate-doc-table tbody td { padding: 12px 0; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.estimate-doc-table tbody td:last-child { text-align: right; font-weight: 700; color: var(--brand-blue); white-space: nowrap; }
.estimate-doc-table .item-name { font-weight: 700; color: var(--heading); font-size: 0.92rem; }
.estimate-doc-table .item-desc { font-size: 0.8rem; color: var(--muted-text); margin-top: 2px; }
.estimate-doc-total-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; font-size: 1.05rem; font-weight: 800; color: var(--heading); }
.estimate-doc-total-row .amount { font-size: 1.5rem; background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.estimate-doc-terms { font-size: 0.78rem; color: var(--muted-text); background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; line-height: 1.6; }
.estimate-doc-empty { text-align: center; color: var(--muted-text); padding: 40px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .estimate-layout { grid-template-columns: 1fr; }
  .estimate-summary { position: static; }
}
@media (max-width: 640px) {
  .estimate-toolbar { flex-direction: column; align-items: stretch; }
  .estimate-row { flex-wrap: wrap; }
  .estimate-row-price { margin-left: 40px; }
  .estimate-doc-prepared { grid-template-columns: 1fr; }
  .estimate-doc { padding: 28px 18px 8px; }
}
