.engagement-modal-open {
  overflow: hidden;
}

.engagement-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  color: #f5f3f0;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.engagement-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 4, 0.84);
  backdrop-filter: none;
}

.engagement-form-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 58rem);
  max-height: none;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  border: 1px solid rgba(192, 160, 128, 0.28);
  border-radius: 0.9rem;
  background: rgba(15, 14, 13, 0.98);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.48);
  scrollbar-color: rgba(192, 160, 128, 0.48) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.engagement-form-panel::-webkit-scrollbar {
  width: 0.55rem;
}

.engagement-form-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.engagement-form-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(14, 13, 12, 0.92);
  border-radius: 999px;
  background: rgba(192, 160, 128, 0.5);
}

.engagement-form-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.35rem 1.2rem;
  border-bottom: 1px solid rgba(192, 160, 128, 0.18);
}

.engagement-form-head p,
.engagement-field > span:not(.engagement-select),
.engagement-question summary {
  color: #c0a080;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.engagement-form-head h2 {
  margin-top: 0.35rem;
  color: #f5f3f0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.engagement-form-head span {
  display: block;
  max-width: 44rem;
  margin-top: 0.75rem;
  color: rgba(245, 243, 240, 0.68);
  font-size: 0.95rem;
  line-height: 1.55;
}

.engagement-form-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  color: #f5f3f0;
  font-size: 1.4rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.03);
}

.engagement-form {
  display: grid;
  gap: 0.95rem;
  padding: 1.25rem 1.35rem 1.35rem;
}

.engagement-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.engagement-field {
  display: grid;
  gap: 0.45rem;
}

.engagement-field-full {
  grid-column: 1 / -1;
}

.engagement-field input,
.engagement-field select,
.engagement-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.055);
  color: #f5f3f0;
  padding: 0.85rem 0.95rem;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.engagement-field input:focus,
.engagement-field select:focus,
.engagement-field textarea:focus {
  border-color: rgba(192, 160, 128, 0.58);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 2px rgba(192, 160, 128, 0.16);
}

.engagement-select {
  position: relative;
  display: block;
  width: 100%;
}

.engagement-select select {
  min-height: 3.05rem;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.7rem;
  cursor: pointer;
}

.engagement-select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.56rem;
  height: 0.56rem;
  pointer-events: none;
  border-right: 1px solid #c0a080;
  border-bottom: 1px solid #c0a080;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.9;
}

.engagement-field select option {
  color: #171412;
  background: #f5f3f0;
}

.engagement-field textarea {
  resize: vertical;
}

.engagement-question {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.7rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.025);
}

.engagement-question summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.engagement-question summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.engagement-question[open] summary::after {
  transform: translateY(0.15rem) rotate(225deg);
}

.engagement-question summary::-webkit-details-marker {
  display: none;
}

.engagement-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.engagement-chip-grid button {
  position: relative;
  z-index: 1;
  min-height: 2.4rem;
  border: 1px solid rgba(192, 160, 128, 0.2);
  border-radius: 0.55rem;
  color: rgba(245, 243, 240, 0.76);
  background: transparent;
  padding: 0.55rem 0.8rem;
  font-size: 0.86rem;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.engagement-chip-grid button:hover {
  border-color: rgba(192, 160, 128, 0.48);
  color: #f5f3f0;
  background: rgba(192, 160, 128, 0.09);
}

.engagement-chip-grid button:active {
  transform: translateY(1px);
}

.engagement-chip-grid button.is-selected {
  color: #0a0a0a;
  border-color: transparent;
  background: #c0a080;
}

.engagement-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.engagement-form-actions button {
  min-height: 2.9rem;
  border-radius: 0.62rem;
  padding: 0 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.engagement-form-actions button:first-child {
  color: #c0a080;
  background: transparent;
  border: 1px solid rgba(192, 160, 128, 0.22);
}

.engagement-form-actions button:last-child {
  color: #0a0a0a;
  background: #c0a080;
}

@media (max-width: 720px) {
  .engagement-modal {
    display: grid;
    align-items: end;
    padding: 0;
    min-height: 100dvh;
    place-items: end stretch;
  }

  .engagement-form-panel {
    width: 100%;
    max-height: 92dvh;
    min-height: min(92dvh, 38rem);
    margin: 0;
    border-radius: 0.9rem 0.9rem 0 0;
  }

  .engagement-form-head,
  .engagement-form {
    padding: 1rem;
  }

  .engagement-form-grid {
    grid-template-columns: 1fr;
  }

  .engagement-form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
