/* Project Builder */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pb-page {
  background: var(--bg-primary);
}

.pb {
  padding: calc(var(--nav-height) + 2.5rem) 0 var(--section-padding);
  min-height: calc(100vh - var(--nav-height));
}

.pb__container {
  max-width: 52rem;
}

.pb__header {
  margin-bottom: 2.5rem;
}

.pb__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: var(--letter-tight);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.pb__intro {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.75;
  max-width: 38rem;
}

/* Progress */
.pb__progress {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pb__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.pb__progress-percent {
  color: var(--gold);
}

.pb__progress-track {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.pb__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.5s var(--ease-premium);
}

.pb__step-list {
  display: none;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.pb__step-list li {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.625rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2rem;
  transition: all var(--transition-fast);
}

.pb__step-list li.pb__step-list-item--active {
  color: var(--gold);
  border-color: var(--border-gold);
  background: var(--gold-muted);
}

.pb__step-list li.pb__step-list-item--done {
  color: var(--text-secondary);
  border-color: rgba(201, 168, 76, 0.2);
}

@media (min-width: 48rem) {
  .pb__step-list { display: flex; }
}

/* Form panels */
.pb__form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pb__panels {
  position: relative;
  min-height: 20rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.pb__step {
  display: none;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.45s var(--ease-premium), transform 0.45s var(--ease-premium);
}

.pb__step--active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.pb__step--entering {
  display: block;
}

.pb__step-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.pb__step-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.pb__step-note {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.pb__field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pb__welcome-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.pb__welcome-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.pb__welcome-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.pb__optional {
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Fieldset & options */
.pb__fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.pb__options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pb__options--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.pb__option {
  display: block;
  cursor: pointer;
}

.pb__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pb__option-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.pb__option:hover .pb__option-card {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.pb__option input:focus-visible + .pb__option-card {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.pb__option input:checked + .pb__option-card {
  border-color: var(--gold);
  background: var(--gold-muted);
  box-shadow: 0 0 0 1px var(--border-gold);
}

.pb__option-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.pb__option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pb__field-error {
  display: none;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #e8a0a0;
}

.pb__field-error:not(:empty) {
  display: block;
}

/* Measurement toggle */
.pb__toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pb__toggle-btn {
  flex: 1;
  cursor: pointer;
}

.pb__toggle-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pb__toggle-btn span {
  display: block;
  padding: 0.625rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-radius: calc(var(--radius) - 2px);
  transition: all var(--transition-fast);
}

.pb__toggle-btn input:checked + span {
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.pb__toggle-btn input:focus-visible + span {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.pb__computed {
  font-size: 0.875rem;
  color: var(--gold);
  font-weight: 500;
  margin-top: -0.5rem;
  min-height: 1.25rem;
}

/* Live estimate */
.pb__estimate[hidden] {
  display: none !important;
}

.pb__estimate {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  transition: opacity var(--transition-fast);
}

.pb__estimate-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

.pb__estimate-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.pb__estimate-amount {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.pb__estimate-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Pricing breakdown */
.pb__pricing {
  margin-bottom: 1.75rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
}

.pb__pricing-header {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.pb__pricing-rows {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.pb__pricing-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.pb__pricing-row:last-child {
  border-bottom: none;
}

.pb__pricing-row--detail {
  padding-left: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.pb__pricing-row--discount .pb__pricing-value {
  color: #8fd68f;
}

.pb__pricing-label {
  color: var(--text-secondary);
}

.pb__pricing-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.pb__pricing-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-gold);
  font-size: 1rem;
  font-weight: 600;
}

.pb__pricing-total .pb__pricing-value {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--gold-light);
}

.pb__pricing-deposit {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.pb__pricing-deposit .pb__pricing-value {
  color: var(--gold);
}

.pb__pricing-disclaimer {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

.pb__pricing-placeholder {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pb__pricing-placeholder-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pb__pricing-unavailable {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Review summary */
.pb__review {
  display: grid;
  gap: 1rem;
}

.pb__review-section {
  padding: 1.125rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pb__review-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.625rem;
}

.pb__review-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pb__review-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

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

.pb__review-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.pb__review-value {
  color: var(--text-primary);
  text-align: right;
  font-weight: 500;
}

.pb__pdf-actions {
  margin: 1.25rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.pb__pdf-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.62);
  max-width: 40rem;
  line-height: 1.45;
}

/* Navigation */
.pb__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1.25rem clamp(1.75rem, 4vw, 2.5rem) 1.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.pb__nav .btn {
  min-width: 8rem;
}

#submitBtn {
  margin-left: auto;
}

/* Footer */
.pb__footer .footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pb__back-link {
  font-size: 0.8125rem;
  color: var(--gold);
  transition: color var(--transition-fast);
}

.pb__back-link:hover {
  color: var(--gold-light);
}

/* Reveal on project builder page */
.pb .reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}

.pb .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 40rem) {
  .pb__options--grid {
    grid-template-columns: 1fr;
  }

  .pb__nav {
    flex-direction: column-reverse;
  }

  .pb__nav .btn {
    width: 100%;
  }

  #submitBtn {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb__step,
  .pb__progress-fill,
  .pb .reveal {
    transition: none !important;
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

.pb-success-page {
  background: var(--color-bg, #f7f5f2);
}

.pb-success {
  padding: 4rem 0 5rem;
}

.pb-success__inner {
  max-width: 760px;
}

.pb-success__card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.pb-success__title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0.5rem 0 1rem;
}

.pb-success__lead {
  color: #4a4a4a;
  margin-bottom: 1.5rem;
}

.pb-success__quote {
  background: #f3efe8;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.pb-success__label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

.pb-success__quote-id {
  font-size: 1.5rem;
  color: #1f2937;
}

.pb-success__pdf {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(212, 188, 106, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.pb-success__pdf p {
  margin: 0 0 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pb-success__steps ol {
  margin: 0;
  padding-left: 1.25rem;
}

.pb-success__steps li + li {
  margin-top: 0.5rem;
}

.pb-success__placeholders {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .pb-success__placeholders {
    grid-template-columns: 1fr 1fr;
  }
}

.pb-success__placeholder {
  border: 1px dashed #c9c2b8;
  border-radius: 12px;
  padding: 1rem;
}

.pb-success__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
