/* Waitlist modal — NorthGarden contact-style centered form */

.waitlist-modal {
  --waitlist-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --waitlist-bg: #080d18;
  --waitlist-text: #e8edf5;
  --waitlist-muted: rgba(180, 205, 230, 0.72);
  --waitlist-accent: rgba(150, 195, 240, 0.28);
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  pointer-events: none;
}

.waitlist-modal.is-open {
  pointer-events: auto;
}

.waitlist-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.45s var(--waitlist-ease);
}

.waitlist-modal.is-open .waitlist-modal__backdrop {
  opacity: 1;
}

.waitlist-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 860px);
  max-height: min(90dvh, 860px);
  display: flex;
  flex-direction: column;
  background: var(--waitlist-bg);
  color: var(--waitlist-text);
  border: 1px solid rgba(150, 195, 240, 0.14);
  border-radius: 16px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.97);
  transition:
    opacity 0.45s var(--waitlist-ease),
    transform 0.55s var(--waitlist-ease),
    min-height 0.4s var(--waitlist-ease);
  overflow: hidden;
}

.waitlist-modal.is-open .waitlist-modal__panel {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.waitlist-modal.is-submitted .waitlist-modal__panel {
  min-height: min(52vh, 420px);
  max-height: min(70vh, 520px);
}

.waitlist-modal__step {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.waitlist-modal__step[hidden] {
  display: none !important;
}

.waitlist-modal__step--success {
  position: relative;
  align-items: stretch;
  justify-content: center;
  padding: clamp(24px, 5vw, 40px);
  animation: waitlistStepIn 0.45s var(--waitlist-ease) both;
}

@keyframes waitlistStepIn {
  from {
    opacity: 0;
    transform: translate3d(12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.waitlist-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(24px, 4vw, 36px) clamp(24px, 4vw, 36px) 0;
}

.waitlist-modal__intro {
  flex: 1 1 auto;
  min-width: 0;
}

.waitlist-modal__title {
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: #f5f8fc;
}

.waitlist-modal__subtitle {
  margin: 0.65em 0 0;
  font-family: var(--font-hero);
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.45;
  color: var(--waitlist-muted);
}

.waitlist-modal__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-family: var(--font-hero);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.waitlist-modal__close--success {
  position: absolute;
  top: clamp(16px, 3vw, 24px);
  right: clamp(16px, 3vw, 24px);
  z-index: 2;
}

.waitlist-modal__close:hover {
  opacity: 0.92;
}

.waitlist-modal__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.waitlist-modal__kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1em;
  padding: 0.2em 0.45em;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.62);
}

.waitlist-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: clamp(20px, 3vw, 28px) clamp(24px, 4vw, 36px) clamp(24px, 4vw, 36px);
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.waitlist-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.waitlist-form__field.is-hidden {
  display: none;
}

.waitlist-form__label {
  font-family: var(--font-hero);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(200, 220, 240, 0.72);
}

.waitlist-form__label .waitlist-form__required {
  color: rgba(150, 195, 240, 0.95);
}

.waitlist-form__hint {
  margin: 0;
  font-family: var(--font-hero);
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(160, 185, 210, 0.55);
}

.waitlist-form__input,
.waitlist-form__select {
  width: 100%;
  padding: 12px 0 10px;
  border: none;
  border-bottom: 1px solid var(--waitlist-accent);
  border-radius: 0;
  background: transparent;
  color: var(--waitlist-text);
  font-family: var(--font-hero);
  font-size: 1rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waitlist-form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(180,205,230,0.72)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 20px;
}

.waitlist-form__select option {
  background: #0d1628;
  color: #e8edf5;
}

.waitlist-form__input::placeholder {
  color: rgba(160, 185, 210, 0.42);
}

.waitlist-form__input:focus,
.waitlist-form__select:focus {
  border-bottom-color: rgba(150, 195, 240, 0.72);
  box-shadow: 0 1px 0 0 rgba(150, 195, 240, 0.35);
}

.waitlist-form__input.is-invalid,
.waitlist-form__select.is-invalid {
  border-bottom-color: rgba(255, 120, 120, 0.72);
}

.waitlist-form__error {
  margin: 0;
  font-family: var(--font-hero);
  font-size: 0.78rem;
  color: rgba(255, 140, 140, 0.92);
}

.waitlist-form__actions {
  padding-top: 8px;
}

.waitlist-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-family: var(--font-hero);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.waitlist-form__submit:hover {
  opacity: 0.92;
}

.waitlist-form__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.waitlist-modal__success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  flex: 1;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: clamp(32px, 8vw, 56px) clamp(8px, 2vw, 16px);
  text-align: left;
}

.waitlist-modal__success-title {
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: #f5f8fc;
}

.waitlist-modal__success-text {
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--waitlist-muted);
}

@media (max-width: 640px) {
  .waitlist-modal__header {
    padding-top: max(24px, env(safe-area-inset-top));
  }

  .waitlist-modal__close .waitlist-modal__kbd {
    display: none;
  }

  .waitlist-modal.is-submitted .waitlist-modal__panel {
    min-height: min(58vh, 380px);
  }
}

/* ── Home mini callout (side panel, not a hard CTA button) ─── */
.waitlist-home-chip {
  --chip-top: calc(20px + clamp(28px, 4.2vw, 40px) + 16px);
  position: fixed;
  top: var(--chip-top);
  left: 20px;
  z-index: 99;
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: min(220px, calc(100vw - 40px));
  margin: 0;
  padding: 0;
  border: 1px solid rgba(150, 195, 240, 0.18);
  border-left: none;
  border-radius: 0 12px 12px 0;
  background:
    linear-gradient(115deg, rgba(14, 24, 44, 0.72) 0%, rgba(10, 18, 34, 0.48) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #eef4fb;
  cursor: pointer;
  text-align: left;
  box-shadow:
    6px 10px 28px rgba(4, 10, 24, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateX(-10px);
  animation: waitlistHomeChipIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.85s forwards;
  transition:
    opacity 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.35s ease;
  pointer-events: auto;
}

.waitlist-home-chip__rail {
  flex: 0 0 3px;
  width: 3px;
  margin: 8px 0;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(180, 220, 255, 0.95) 0%,
    rgba(120, 175, 235, 0.55) 100%
  );
  box-shadow: 0 0 12px rgba(130, 190, 255, 0.35);
}

.waitlist-home-chip__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px 11px 12px;
}

.waitlist-home-chip__title {
  font-family: var(--font-hero);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #f4f8fc;
}

.waitlist-home-chip__sub {
  font-family: var(--font-hero);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: rgba(180, 205, 230, 0.78);
}

.waitlist-home-chip:hover {
  transform: translateX(2px);
  border-color: rgba(160, 205, 245, 0.32);
  box-shadow:
    8px 14px 32px rgba(4, 10, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.waitlist-home-chip:focus-visible {
  outline: 2px solid rgba(150, 200, 255, 0.7);
  outline-offset: 3px;
}

body.is-waitlist-open .waitlist-home-chip {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateX(-8px);
}

@keyframes waitlistHomeChipIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  /* Same pill chrome + height as .site-volume (mobile toolbar only) */
  .waitlist-home-chip {
    position: static;
    top: auto;
    left: auto;
    max-width: none;
    height: 38px;
    box-sizing: border-box;
    align-items: center;
    padding: 0;
    border: 1px solid rgba(150, 205, 255, 0.2);
    border-radius: 999px;
    background: rgba(8, 16, 32, 0.52);
    box-shadow: 0 0 20px rgba(100, 175, 255, 0.15);
    transform: none;
    line-height: 1;
    animation: waitlistHomeChipInMobile 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
  }

  .waitlist-home-chip__rail {
    display: none;
  }

  .waitlist-home-chip__copy {
    height: 100%;
    padding: 0 12px;
    gap: 0;
    justify-content: center;
  }

  .waitlist-home-chip__title {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
  }

  .waitlist-home-chip__sub {
    display: none;
  }

  .waitlist-home-chip:hover {
    transform: none;
    border-color: rgba(150, 205, 255, 0.32);
  }

  body.is-waitlist-open .waitlist-home-chip {
    transform: none;
    width: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }
}

@keyframes waitlistHomeChipInMobile {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .waitlist-modal__backdrop,
  .waitlist-modal__panel,
  .waitlist-modal__step--success,
  .waitlist-home-chip {
    animation: none !important;
    transition-duration: 0.01ms;
  }

  .waitlist-home-chip {
    opacity: 1;
    transform: none;
  }
}
