:root {
  --majhub-green: #39A751;
  --majhub-green-dark: #2f9946;
  --majhub-green-glow: #52ff7d;
  --majhub-bg: #0c0c0c;
  --majhub-surface: #161d15;
  --majhub-text: #ffffff;
  --majhub-muted: #d2d7dc;
  --majhub-border: #ffffff1f;
}

.package-intake-modal[hidden] {
  display: none !important;
}

.package-intake-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.package-intake-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

/* Outer shell: room for floating close + border glow */
.package-intake-modal__shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 40px));
  max-width: 100%;
}

.package-intake-modal__panel {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-height: min(88vh, 820px);
  box-sizing: border-box;
  background: var(--majhub-surface);
  color: var(--majhub-text);
  border-radius: 16px;
  box-shadow: 0 -1px 0 0 #52ff7d29, 0 0 0 1px var(--majhub-border);
  overflow: visible;
}

/* Dedicated modal border animation (not clipped by scroll) */
.package-intake-modal__panel.border-animation {
  --border-animation-color: #52ff7d99;
  --border-animation-speed: 6s;
  --border-animation-width: 1.5px;
}

.package-intake-modal__panel.border-animation::after {
  pointer-events: none;
  content: "";
  position: absolute;
  inset: -1.5px;
  z-index: 2;
  border-radius: inherit;
  border: solid transparent;
  border-width: var(--border-animation-width);
  animation: borderRotate var(--border-animation-speed) linear infinite;
  background: conic-gradient(
      from var(--border-animation-angle),
      transparent 75%,
      var(--border-animation-color),
      var(--border-animation-color) 100%,
      transparent
    )
    border-box;
  background-clip: border-box;
  background-origin: border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* Scroll lives inside — keeps animated border clean */
.package-intake-modal__body {
  position: relative;
  z-index: 1;
  max-height: min(88vh, 820px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 28px 24px;
  box-sizing: border-box;
  border-radius: inherit;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.package-intake-modal__body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Close floats outside panel, top-right */
.package-intake-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--majhub-border);
  border-radius: 999px;
  background: #0e0e0e;
  color: var(--majhub-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px #52ff7d33, 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.package-intake-modal__close:hover {
  background: #161d15;
  border-color: var(--majhub-green-glow);
  transform: scale(1.05);
}

.package-intake-modal__title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.package-intake-modal__subtitle {
  margin: 0 0 16px;
  color: var(--majhub-muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.package-intake-modal__summary {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--majhub-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow-wrap: break-word;
  word-break: break-word;
}

.package-intake-modal__summary ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--majhub-muted);
}

.package-intake-form {
  max-width: 100%;
  overflow: hidden;
}

.package-intake-form label {
  display: block;
  margin-bottom: 12px;
}

.package-intake-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--majhub-muted);
  font-size: 0.92rem;
}

.package-intake-form input,
.package-intake-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--majhub-border);
  border-radius: 10px;
  background: #0c0c0c;
  color: var(--majhub-text);
  padding: 10px 12px;
}

.package-intake-modal__submit {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: var(--majhub-green);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
}

.package-intake-modal__submit:hover {
  background: var(--majhub-green-dark);
}

.package-intake-modal__status {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--majhub-muted);
}

.package-intake-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.package-intake-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: 24px 8px 8px;
  gap: 8px;
}

.package-intake-modal__success[hidden] {
  display: none !important;
}

.package-intake-modal__success h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--majhub-text);
}

.package-intake-modal__success p {
  margin: 0 0 20px;
  max-width: 34ch;
  color: var(--majhub-muted);
  line-height: 1.5;
}

.package-intake-modal__success .package-intake-modal__submit {
  max-width: 220px;
}

.package-intake-modal__form-view[hidden] {
  display: none !important;
}

body.package-intake-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .package-intake-modal {
    padding: 24px 14px;
  }

  .package-intake-modal__shell {
    width: min(100%, calc(100vw - 28px));
  }

  .package-intake-modal__close {
    top: -12px;
    right: -8px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .package-intake-modal__body {
    padding: 22px 18px 20px;
  }
}
