/**
 * Start-a-project brief modal.
 *
 * Ported from the v3 prototype, adapted for site tokens and Plus Jakarta
 * Sans. Coral (--site-color-coral) replaces the prototype's --accent.
 *
 * High-specificity selectors (button.sp-*, input[type='text'].sp-input-f)
 * defeat base.css form-element defaults (teal button background, teal
 * input focus ring).
 */

/* ─── ROOT / SCRIM / PANEL ──────────────────────────────────────────── */

.sp-root {
  align-items: flex-start;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 6vh 24px 24px;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.2s ease;
  z-index: 600;
}

.sp-root[hidden] {
  display: none;
}

.sp-root.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sp-scrim {
  background: rgba(6, 7, 14, 0.68);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  inset: 0;
  position: absolute;
}

.sp-panel {
  background: linear-gradient(180deg, #14172e 0%, #0f1226 100%);
  border: 1px solid var(--site-color-border-bright);
  border-radius: 20px;
  box-shadow:
    0 50px 120px -20px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-width: 920px;
  overflow: hidden;
  position: relative;
  transform: translateY(-10px) scale(0.985);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  width: 100%;
}

.sp-root.is-open .sp-panel {
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .sp-root,
  .sp-panel {
    transition: none;
  }
  .sp-root.is-open .sp-panel {
    transform: none;
  }
}

/* ─── HEAD ──────────────────────────────────────────────────────────── */

.sp-head {
  align-items: center;
  border-bottom: 1px solid var(--site-color-border);
  display: flex;
  justify-content: space-between;
  padding: 24px 28px 20px;
}

.sp-eyebrow {
  align-items: center;
  color: var(--site-color-coral);
  display: inline-flex;
  font-family: var(--site-font-sans);
  font-size: 13px;
  font-weight: 600;
  gap: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sp-eyebrow-dot {
  animation: sp-dot 1.8s ease-in-out infinite;
  background: var(--site-color-coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(254, 74, 73, 0.18);
  height: 8px;
  width: 8px;
}

@keyframes sp-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* Override base.css `button {}` (teal background, 1rem 2rem padding). */
button.sp-close {
  align-items: center;
  background: transparent;
  border: 1px solid var(--site-color-border);
  border-radius: 50%;
  color: var(--site-color-text-lead);
  cursor: pointer;
  display: grid;
  flex: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  height: 36px;
  justify-content: center;
  min-width: 0;
  padding: 0;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  width: 36px;
}

button.sp-close:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--site-color-border-bright);
  color: var(--site-color-text-white);
}

button.sp-close:focus-visible {
  outline: 2px solid var(--site-color-coral);
  outline-offset: 2px;
}

button.sp-close svg {
  height: 18px;
  width: 18px;
}

/* ─── STEP INDICATOR ────────────────────────────────────────────────── */

.sp-steps {
  align-items: center;
  background: rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid var(--site-color-border);
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 20px 28px;
}

.sp-step {
  align-items: center;
  color: var(--site-color-text-body);
  display: flex;
  flex: 1;
  font-family: var(--site-font-sans);
  font-weight: 500;
  gap: 12px;
  justify-content: center;
  margin-bottom: 0;
  min-width: 0;
  position: relative;
}

.sp-step + .sp-step::before {
  background: var(--site-color-border);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  top: calc(50% - 0.5px);
  transform: translateX(-50%);
  width: 28px;
}

.sp-step-n {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--site-color-border);
  border-radius: 50%;
  color: var(--site-color-text-lead);
  display: grid;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  place-items: center;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  width: 28px;
}

.sp-step-l {
  font-size: 14px;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-step.is-current .sp-step-n {
  background: var(--site-color-coral);
  border-color: var(--site-color-coral);
  box-shadow: 0 0 0 4px rgba(254, 74, 73, 0.15);
  color: #fff;
}

.sp-step.is-current {
  color: var(--site-color-text-white);
}

.sp-step.is-done .sp-step-n {
  background: rgba(254, 74, 73, 0.16);
  border-color: rgba(254, 74, 73, 0.4);
  color: var(--site-color-coral);
}

.sp-step.is-done {
  color: var(--site-color-text-lead);
}

/* ─── BODY ──────────────────────────────────────────────────────────── */

.sp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  scrollbar-width: thin;
}

.sp-body::-webkit-scrollbar {
  width: 8px;
}

.sp-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sp-section {
  animation: sp-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  padding: 34px 32px 32px;
}

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

@media (prefers-reduced-motion: reduce) {
  .sp-section {
    animation: none;
  }
}

.sp-h {
  color: var(--site-color-text-white);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.sp-sub {
  color: var(--site-color-text-lead);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 26px;
}

/* ─── CARD GRID (project type / budget / timeline) ──────────────────── */

.sp-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.sp-card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Override base.css `button {}`: full button reset for chip-cards. */
button.sp-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--site-color-border);
  border-radius: 12px;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 14px;
  letter-spacing: normal;
  min-height: 76px;
  min-width: 0;
  padding: 18px 16px;
  position: relative;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  width: 100%;
}

button.sp-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--site-color-border-bright);
}

button.sp-card:focus-visible {
  outline: 2px solid var(--site-color-coral);
  outline-offset: 2px;
}

button.sp-card.is-on {
  background: rgba(254, 74, 73, 0.08);
  border-color: var(--site-color-coral);
  box-shadow:
    0 0 0 1px var(--site-color-coral) inset,
    0 8px 24px -12px rgba(254, 74, 73, 0.5);
}

.sp-card-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9px;
  color: var(--site-color-text-lead);
  display: grid;
  flex: none;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  line-height: 1;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  width: 40px;
}

button.sp-card.is-on .sp-card-icon {
  background: var(--site-color-coral);
  color: #fff;
}

.sp-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sp-card-label {
  color: var(--site-color-text-white);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.sp-card-sub {
  color: var(--site-color-text-lead);
  font-size: 13px;
  line-height: 1.4;
}

/* Multi-select checkbox indicator */
.sp-card-check {
  align-items: center;
  background: transparent;
  border: 1.5px solid var(--site-color-border-bright);
  border-radius: 5px;
  color: transparent;
  display: grid;
  flex: none;
  height: 22px;
  justify-content: center;
  place-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 22px;
}

.sp-card-check svg {
  height: 13px;
  width: 13px;
}

button.sp-card.is-on .sp-card-check {
  background: var(--site-color-coral);
  border-color: var(--site-color-coral);
  color: #fff;
}

/* Radio indicator (budget / timeline) */
.sp-card-radio {
  padding-right: 20px;
}

.sp-card-dot {
  background: transparent;
  border: 1.5px solid var(--site-color-border-bright);
  border-radius: 50%;
  flex: none;
  height: 22px;
  position: relative;
  transition: border-color 0.15s ease;
  width: 22px;
}

.sp-card-dot::after {
  background: var(--site-color-coral);
  border-radius: 50%;
  content: "";
  inset: 4px;
  opacity: 0;
  position: absolute;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

button.sp-card-radio.is-on .sp-card-dot {
  border-color: var(--site-color-coral);
}

button.sp-card-radio.is-on .sp-card-dot::after {
  opacity: 1;
  transform: scale(1);
}

/* ─── CONTACT FORM ──────────────────────────────────────────────────── */

.sp-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-field-wide {
  grid-column: 1 / -1;
}

.sp-label {
  align-items: center;
  color: var(--site-color-text-lead);
  display: inline-flex;
  font-family: var(--site-font-sans);
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sp-label em {
  color: var(--site-color-text-label);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

/* High specificity defeats base.css input rules (teal focus ring etc.). */
input[type='text'].sp-input-f,
input[type='email'].sp-input-f,
.sp-input-f,
.sp-textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--site-color-border);
  border-radius: 10px;
  box-shadow: none;
  color: var(--site-color-text-white);
  font-family: var(--site-font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  outline: 0;
  padding: 14px 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.sp-textarea {
  font-family: inherit;
  min-height: 96px;
  resize: vertical;
}

input[type='text'].sp-input-f:focus,
input[type='email'].sp-input-f:focus,
.sp-input-f:focus,
.sp-textarea:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--site-color-coral);
  box-shadow: 0 0 0 4px rgba(254, 74, 73, 0.14);
  outline: 0;
}

.sp-input-f::placeholder,
.sp-textarea::placeholder {
  color: var(--site-color-text-label);
}

/* ─── SUMMARY CHIPS ─────────────────────────────────────────────────── */

.sp-summary {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--site-color-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding: 18px 20px;
}

.sp-summary-row {
  align-items: flex-start;
  display: flex;
  gap: 16px;
}

.sp-summary-lbl {
  color: var(--site-color-text-body);
  flex: none;
  font-family: var(--site-font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  padding-top: 6px;
  text-transform: uppercase;
  width: 84px;
}

.sp-summary-chips {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 7px;
}

.sp-summary-chip {
  background: rgba(254, 74, 73, 0.12);
  border: 1px solid rgba(254, 74, 73, 0.25);
  border-radius: 999px;
  color: var(--site-color-text-white);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
}

/* ─── FOOTER / NAV ──────────────────────────────────────────────────── */

.sp-foot {
  align-items: center;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid var(--site-color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 28px;
}

.sp-foot-l,
.sp-foot-r {
  align-items: center;
  display: inline-flex;
  gap: 16px;
}

.sp-foot-note {
  color: var(--site-color-text-body);
  font-family: var(--site-font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sp-foot-count {
  color: var(--site-color-text-lead);
  font-family: var(--site-font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sp-foot-error {
  color: var(--site-color-coral);
  font-family: var(--site-font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Defeat base.css `button {}`. */
button.sp-btn-ghost {
  background: transparent;
  border: 1px solid var(--site-color-border);
  border-radius: 9px;
  color: var(--site-color-text-lead);
  cursor: pointer;
  font: 600 14px/1 var(--site-font-sans);
  letter-spacing: 0.04em;
  min-width: 0;
  padding: 12px 18px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button.sp-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--site-color-border-bright);
  color: var(--site-color-text-white);
}

button.sp-btn-ghost:focus-visible {
  outline: 2px solid var(--site-color-coral);
  outline-offset: 2px;
}

button.sp-btn-primary,
a.sp-btn-primary {
  align-items: center;
  background: var(--site-color-coral);
  border: 0;
  border-radius: 9px;
  box-shadow: 0 10px 24px -10px rgba(254, 74, 73, 0.45);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: 700 14px/1 var(--site-font-sans);
  gap: 10px;
  letter-spacing: 0.04em;
  min-width: 0;
  padding: 14px 22px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

button.sp-btn-primary:hover:not(:disabled),
a.sp-btn-primary:hover {
  background: #ff5c61;
  box-shadow: 0 14px 28px -10px rgba(254, 74, 73, 0.55);
  transform: translateY(-1px);
}

button.sp-btn-primary:focus-visible,
a.sp-btn-primary:focus-visible {
  outline: 2px solid var(--site-color-text-white);
  outline-offset: 2px;
}

button.sp-btn-primary:disabled {
  background: var(--site-color-coral);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.35;
}

/* ─── SUCCESS SCREEN ────────────────────────────────────────────────── */

.sp-done {
  animation: sp-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  padding: 70px 36px 56px;
  text-align: center;
}

.sp-done-mark {
  align-items: center;
  background: rgba(254, 74, 73, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(254, 74, 73, 0.06);
  color: var(--site-color-coral);
  display: grid;
  height: 72px;
  justify-content: center;
  margin: 0 auto 24px;
  place-items: center;
  width: 72px;
}

.sp-done-mark svg {
  height: 32px;
  width: 32px;
}

.sp-done-h {
  color: var(--site-color-text-white);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 12px;
}

.sp-done-sub {
  color: var(--site-color-text-lead);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 48ch;
}

.sp-done-sub b {
  color: var(--site-color-text-white);
  font-weight: 600;
}

.sp-done-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

/* ─── MOBILE (≤720px) ───────────────────────────────────────────────── */

@media (max-width: 720px) {
  .sp-root {
    padding: 0;
  }
  .sp-panel {
    border-radius: 0;
    max-height: 100vh;
    max-height: 100dvh;
  }
  .sp-card-grid,
  .sp-card-grid-3 {
    grid-template-columns: 1fr;
  }
  .sp-fields {
    grid-template-columns: 1fr;
  }
  .sp-step-l {
    display: none;
  }
  .sp-steps {
    padding: 14px 18px;
  }
  .sp-section {
    padding: 24px 20px;
  }
  .sp-head {
    padding: 18px 20px;
  }
  .sp-foot {
    padding: 14px 20px;
  }
  .sp-foot-l,
  .sp-foot-r {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .sp-h {
    font-size: 22px;
  }
}

/* Body scroll lock while modal is open */
body.doghouse-start-project-open {
  overflow: hidden;
}
