/* Phase 2: neutral six-step Estimate shell and internal review. */

.shared-estimate-page .estimate-workflow {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 68px;
}

.shared-estimate-page .estimate-workflow button {
  min-width: 0;
  gap: 7px;
  padding: 7px 9px;
  font-size: 14px;
}

.shared-estimate-page .estimate-workflow button > strong {
  min-width: 0;
  line-height: 1.2;
  text-align: left;
}

.shared-estimate-page .estimate-page-brand h2 {
  font-size: 24px;
}

.estimate-project-step,
.estimate-review-step {
  padding: 18px;
  background: #07121b;
  border: 1px solid #294052;
  border-radius: 12px;
}

.estimate-project-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  color: #f58216;
  background: rgba(245, 130, 22, .08);
  border: 1px solid #f58216;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(245, 130, 22, .1);
}

.estimate-project-icon svg { width: 26px; height: 26px; }

.estimate-project-step form { margin-top: 14px; }

.estimate-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 17px;
  background: #08131d;
  border: 1px solid #2b4050;
  border-radius: 10px;
}

.estimate-project-grid label {
  display: grid;
  gap: 7px;
  color: #dce6ed;
  font-size: 14px;
  font-weight: 750;
}

.estimate-project-grid label.wide { grid-column: 1 / -1; }

.estimate-project-grid input,
.estimate-project-grid select,
.estimate-project-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: #f3f7fb;
  background: #07111a;
  border: 1px solid #385064;
  border-radius: 8px;
  font: 500 14px/1.4 "Segoe UI", Inter, system-ui, sans-serif;
}

.estimate-project-grid textarea { min-height: 88px; resize: vertical; }
.estimate-project-grid input:focus,
.estimate-project-grid select:focus,
.estimate-project-grid textarea:focus { outline: 2px solid rgba(245, 130, 22, .28); border-color: #f58216; }

.estimate-review-services {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.estimate-review-service {
  overflow: hidden;
  background: #08131d;
  border: 1px solid #2b4050;
  border-radius: 10px;
}

.estimate-review-service summary {
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #fff;
  cursor: pointer;
  list-style: none;
}

.estimate-review-service summary::-webkit-details-marker { display: none; }
.estimate-review-service summary > span:nth-child(2) { display: grid; gap: 2px; }
.estimate-review-service summary small { color: #43dc91; font-size: 12px; }
.estimate-review-service summary strong { font-size: 17px; }
.estimate-review-service summary > b { color: #ff8a00; font-size: 19px; }
.estimate-review-service summary > i { color: #8fa3b4; }

.estimate-review-service-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #f58216;
  background: rgba(245, 130, 22, .08);
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(245, 130, 22, .08);
}

.estimate-review-service-icon.exterior { color: #22d3ee; background: rgba(34, 211, 238, .08); }
.estimate-review-service-icon.cabinets { color: #a970ff; background: rgba(169, 112, 255, .08); }
.estimate-review-service-icon svg { width: 22px; height: 22px; }

.estimate-review-service ul {
  margin: 0;
  padding: 0 16px;
  list-style: none;
  border-top: 1px solid #273b4a;
}

.estimate-review-service li {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #c8d4dd;
  font-size: 14px;
  border-bottom: 1px solid #1e303d;
}

.estimate-review-service li small { color: #8499aa; margin-left: 6px; }
.estimate-review-service li strong { color: #f4f7fa; }
.estimate-review-service footer { display: flex; justify-content: flex-end; padding: 10px 14px; }
.estimate-review-service footer .btn { min-height: 40px; font-size: 14px; }

.estimate-review-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
  background: #08151e;
  border: 1px solid #294052;
  border-radius: 10px;
}

.estimate-review-totals > div,
.estimate-summary-costs > div {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #07111a;
  border: 1px solid #263c4c;
  border-radius: 8px;
}

.estimate-review-totals span,
.estimate-summary-costs span { color: #a6b6c3; font-size: 13px; }
.estimate-review-totals strong,
.estimate-summary-costs strong { color: #fff; font-size: 16px; }
.estimate-review-totals .profit strong,
.estimate-review-totals .margin strong,
.estimate-summary-costs .profit strong,
.estimate-summary-costs .margin strong { color: #43dc91; }

.estimate-summary-costs {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border-top: 1px solid #2a4050;
}

.estimate-summary-costs > div { min-height: 44px; padding: 8px 10px; }
.estimate-summary-costs span { font-size: 12px; }
.estimate-summary-costs strong { font-size: 13px; }

.estimate-shared-layout,
.estimate-shared-summary {
  transition: grid-template-columns .2s ease, width .2s ease;
}

.estimate-shared-summary > header {
  position: relative;
  padding-right: 46px;
}

.estimate-summary-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #ff8a00;
  background: #0a1822;
  border: 1px solid #425768;
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
}

.estimate-summary-toggle:hover,
.estimate-summary-toggle:focus-visible {
  color: #fff;
  border-color: #ff8a00;
  box-shadow: 0 0 0 2px rgba(255, 138, 0, .14);
  outline: none;
}

.estimate-summary-toggle svg { width: 19px; height: 19px; }

.estimate-shared-layout.summary-collapsed {
  grid-template-columns: minmax(0, 1fr) 58px;
}

.estimate-shared-summary.is-collapsed {
  width: 58px;
  min-height: 68px;
  overflow: hidden;
}

.estimate-shared-summary.is-collapsed > header {
  min-height: 66px;
  justify-content: center;
  padding: 8px;
  border-bottom: 0;
}

.estimate-shared-summary.is-collapsed > header .estimate-summary-icon,
.estimate-shared-summary.is-collapsed > header > div,
.estimate-shared-summary.is-collapsed > section,
.estimate-shared-summary.is-collapsed > footer {
  display: none;
}

.estimate-shared-summary.is-collapsed .estimate-summary-toggle {
  position: static;
  transform: none;
}

@media (max-width: 1280px) {
  .shared-estimate-page .estimate-workflow button > i { display: none; }
  .shared-estimate-page .estimate-workflow button { font-size: 13px; }
}

@media (max-width: 900px) {
  .shared-estimate-page .estimate-workflow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .estimate-review-totals { grid-template-columns: 1fr 1fr; }
  .estimate-shared-layout.summary-collapsed { grid-template-columns: minmax(0, 1fr); }
  .estimate-shared-summary.is-collapsed { width: 100%; }
}

@media (max-width: 640px) {
  .shared-estimate-page .estimate-workflow { grid-template-columns: 1fr 1fr; }
  .estimate-project-grid,
  .estimate-review-totals { grid-template-columns: 1fr; }
  .estimate-project-grid label.wide { grid-column: auto; }
}
