/* Homepage bridge for the shared multi-step project planner in site.js. */
.pf-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: rgba(5, 9, 27, .68);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}

.pf-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s var(--ease), visibility 0s;
}

.pf-dialog,
.pf-dialog * { box-sizing: border-box; }

.pf-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(17, 25, 54, .14);
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 42px 100px -34px rgba(3, 7, 24, .72);
  font-family: var(--body);
  transform: translateY(16px) scale(.984);
  transition: transform .35s var(--ease);
}

.pf-overlay.open .pf-dialog { transform: none; }
.pf-dialog form { margin: 0; }
.pf-dialog h3,
.pf-dialog p { margin: 0; }
.pf-dialog a { color: inherit; }
.pf-dialog button {
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

.pf-dialog :focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.pf-dialog .btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .96rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}

.pf-dialog .btn .arrow { transition: transform .3s var(--ease); }
.pf-dialog .btn:hover .arrow { transform: translateX(4px); }
.pf-dialog .btn-dark { background: var(--navy); color: var(--on-dark); }
.pf-dialog .btn-dark:hover { transform: translateY(-1px); }
.pf-dialog .btn-accent { background: var(--accent); color: var(--accent-ink); }
.pf-dialog .btn-accent:hover { background: #a9b6ff; transform: translateY(-1px); }
.pf-dialog .btn-outline { border-color: var(--line); color: var(--ink); }
.pf-dialog .btn-outline:hover { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }

.pf-dialog .pf-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  transition: background .25s, color .25s;
}

.pf-dialog .pf-close:hover,
.pf-dialog .pf-close:focus-visible { background: var(--paper-2); color: var(--ink); }

.pf-top { padding: clamp(28px, 3.5vw, 40px) clamp(28px, 4vw, 44px) 0; }
.pf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}
.pf-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pf-progress { display: flex; gap: 7px; margin-top: 20px; }
.pf-progress .seg { flex: 1; height: 4px; overflow: hidden; border-radius: 999px; background: var(--paper-2); }
.pf-progress .seg::after { content: ""; display: block; width: 0; height: 100%; border-radius: 999px; background: var(--navy); transition: width .4s var(--ease); }
.pf-progress .seg.done::after { width: 100%; }
.pf-progress .seg.active::after { width: 100%; background: #6879e5; }

.pf-body {
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  padding: 24px clamp(28px, 4vw, 44px) clamp(28px, 4vw, 44px);
}
.pf-step { display: none; }
.pf-step.active { display: flex; flex: 1; flex-direction: column; animation: pfIn .4s var(--ease); }
@keyframes pfIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pf-step h3 { max-width: 18ch; margin: 0 0 8px; font-family: var(--sans); font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; }
.pf-step h3 em { font-family: var(--serif); font-weight: 400; }
.pf-step .sub { max-width: 42ch; margin: 0 0 26px; color: var(--muted); font-size: 1rem; line-height: 1.5; }

.pf-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line) !important;
  border-radius: 14px;
  background: var(--paper) !important;
  text-align: left;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.pf-choice:hover { border-color: var(--navy) !important; transform: translateY(-1px); }
.pf-choice.sel { border-color: var(--navy) !important; background: var(--navy) !important; color: var(--on-dark); }
.pf-choice .ic { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--navy); transition: background .2s, color .2s, border-color .2s; }
.pf-choice.sel .ic { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.pf-choice .ic svg { width: 20px; height: 20px; }
.pf-choice .ct { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }

.pf-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pf-field > span,
.pf-field > label { color: var(--muted); font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; line-height: 1.2; text-transform: uppercase; }
.pf-field > span em,
.pf-field > label em { opacity: .7; font-style: normal; letter-spacing: 0; text-transform: none; }
.pf-field input,
.pf-field textarea,
.pf-field select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.35;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.pf-field input:focus,
.pf-field textarea:focus,
.pf-field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(17, 25, 54, .09); }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pf-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.pf-pill { padding: 10px 16px !important; border: 1px solid var(--line) !important; border-radius: 999px; background: var(--paper) !important; font-family: var(--sans) !important; font-size: .92rem !important; font-weight: 500 !important; transition: background .2s, border-color .2s, color .2s; }
.pf-pill:hover { border-color: var(--navy) !important; }
.pf-pill.sel { border-color: var(--navy) !important; background: var(--navy) !important; color: var(--on-dark); }
.pf-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pf-privacy { margin: 2px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.pf-privacy a,
.pf-error a { text-decoration: underline; text-underline-offset: 2px; }
.pf-error { min-height: 1.3em; margin: 10px 0 0; color: #9f2f26; font-size: .9rem; line-height: 1.4; }
.pf-submit[disabled],
.pf-foot .btn[disabled] { cursor: wait; opacity: .7; }

.pf-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 28px; }
.pf-foot .pf-spacer { flex: 1; }
.pf-back { display: inline-flex; align-items: center; gap: 8px; padding: 12px 4px !important; color: var(--muted) !important; font-family: var(--sans) !important; font-size: .95rem !important; font-weight: 600 !important; transition: color .2s; }
.pf-back:hover { color: var(--navy) !important; }
.pf-hint { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }

.pf-success { display: none; padding: clamp(36px, 5vw, 56px) clamp(28px, 4vw, 44px) clamp(40px, 5vw, 56px); text-align: center; }
.pf-success.show { display: block; animation: pfIn .4s var(--ease); }
.pf-success .pf-check { display: grid; width: 60px; height: 60px; margin: 0 auto 22px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 28px; }
.pf-success h3 { margin: 0 0 12px; font-family: var(--sans); font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.pf-success p { max-width: 36ch; margin: 0 auto 26px; color: var(--muted); line-height: 1.5; }
body.pf-lock { overflow: hidden; }

@media (max-width: 760px) {
  .pf-overlay { padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .pf-dialog { max-height: calc(100dvh - 20px); border-radius: 18px; }
  .pf-top { padding: 20px 18px 0; }
  .pf-progress { margin-top: 12px; }
  .pf-body { min-height: 0 !important; overflow: hidden; padding: 14px 18px 18px; }
  .pf-step h3 { margin-bottom: 4px; font-size: clamp(1.3rem, 6vw, 1.6rem); }
  .pf-step .sub { margin-bottom: 14px; font-size: .9rem; }
  .pf-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pf-choice { min-height: 58px; gap: 8px; padding: 10px 8px; border-radius: 12px; }
  .pf-choice .ic { width: 32px; height: 32px; border-radius: 8px; }
  .pf-choice .ic svg { width: 17px; height: 17px; }
  .pf-choice .ct { font-size: .86rem; }
  .pf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pf-field { gap: 5px; margin-bottom: 10px; }
  .pf-field > span,
  .pf-field > label { font-size: 10px; letter-spacing: .07em; }
  .pf-field input,
  .pf-field textarea,
  .pf-field select { padding: 10px 11px; border-radius: 10px; font-size: .92rem; }
  .pf-pills { gap: 6px; }
  .pf-pill { padding: 7px 11px !important; font-size: .8rem !important; }
  .pf-privacy { font-size: .72rem; line-height: 1.3; }
  .pf-error { min-height: 1.1em; margin-top: 4px; font-size: .78rem; }
  .pf-foot { gap: 8px; padding-top: 14px; }
  .pf-foot .btn { min-height: 44px; padding: 10px 16px; font-size: .86rem; }
  .pf-back { padding: 8px 2px !important; font-size: .86rem !important; }
  .pf-success { padding: 34px 24px; }
}

@media (max-width: 760px) and (max-height: 700px) {
  .pf-overlay { padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
  .pf-dialog { max-height: calc(100dvh - 12px); border-radius: 14px; }
  .pf-dialog .pf-close { top: 4px; right: 6px; width: 40px; height: 40px; font-size: 26.25px; }
  .pf-top { padding: 12px 14px 0; }
  .pf-eyebrow { gap: 6px; font-size: 9.5px; }
  .pf-eyebrow .dot { width: 5px; height: 5px; }
  .pf-progress { gap: 5px; margin-top: 6px; }
  .pf-progress .seg { height: 3px; }
  .pf-body { padding: 8px 14px 12px; }
  .pf-step h3 { margin-bottom: 4px; font-size: 1.08rem; line-height: 1.05; }
  .pf-step .sub { display: none; }
  .pf-choices { gap: 5px; }
  .pf-choice { min-height: 44px; gap: 6px; padding: 6px; border-radius: 10px; }
  .pf-choice .ic { width: 28px; height: 28px; border-radius: 7px; }
  .pf-choice .ic svg { width: 15px; height: 15px; }
  .pf-choice .ct { font-size: .72rem; line-height: 1.08; }
  .pf-field { gap: 3px; margin-bottom: 6px; }
  .pf-field > span,
  .pf-field > label { font-size: 8.5px; letter-spacing: .05em; }
  .pf-field input,
  .pf-field textarea,
  .pf-field select { padding: 7px 9px; border-radius: 9px; font-size: .84rem; line-height: 1.2; }
  .pf-field textarea { min-height: 52px; height: 52px; }
  .pf-pills { gap: 4px; }
  .pf-pill { padding: 5px 8px !important; font-size: .7rem !important; }
  .pf-privacy { margin-top: 0; font-size: .62rem; line-height: 1.2; }
  .pf-error { min-height: .9em; margin-top: 2px; font-size: .68rem; line-height: 1.2; }
  .pf-foot { padding-top: 8px; }
  .pf-foot .btn { min-height: 38px; padding: 7px 12px; font-size: .76rem; }
  .pf-back { padding: 6px 2px !important; font-size: .76rem !important; }
  .pf-hint { display: none; }
  .pf-success { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-overlay,
  .pf-dialog,
  .pf-step.active,
  .pf-progress .seg::after { transition: none; animation: none; }
}
