:root {
  --cta-backdrop: rgba(25, 25, 25, 0.737);
  --cta-bg: #191919;
  --cta-fg: #fff;
  --cta-accent: #FF84B4;
  --cta-radius: 44px;
  --cta-shadow: 0 20px 60px rgba(0,0,0,.45);
  --field-height: 44px;
}

@media (prefers-color-scheme: dark) {
  :root { --cta-bg:#fff; --cta-fg:#000; }
}

.modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: var(--cta-backdrop);
  overflow: auto;
}
.modal.open { display: flex; }

.modal-content {
  position: relative;
  width: min(720px, 92vw);
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-radius: var(--cta-radius);
  box-shadow: var(--cta-shadow);
  padding: 32px clamp(8px, 5vw, 20px) 16px;
  padding-left: 44px;
  padding-right: 44px;
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, sans-serif;
  box-sizing: border-box;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.close {
  float: right;
  background: transparent;
  border: 0;
  line-height: 1;
  font-size: 44px;
  color: var(--cta-accent);
  cursor: pointer;
  transition: transform .2s ease;
  z-index: 10;
}
.close:hover { transform: scale(1.15); }

.modal-content h2 {
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 10px;
}
.modal-content p:not(.privacy):not(.status):not(.legal-note) {
  margin: 0 0 16px;
  font-size: 16px;
  opacity: .9;
  line-height: 1.5;
}

#ctaForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 64px;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}
@media (max-width: 860px) {
  #ctaForm { grid-template-columns: 1fr; }
}

.field {
  display: grid;
  gap: 8px;
  justify-items: start;
  width: 100%;
}
.field > span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--cta-fg);
}
.field small {
  font-size: 12px;
  font-weight: 400;
  opacity: .7;
  margin-left: 4px;
}

#ctaForm input,
#ctaForm select,
#ctaForm textarea {
  width: 100%;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #f9f9f9;
  font-size: 15px;
  color: #000;
  outline: none;
  padding: 12px 12px;
  transition: border-color .2s, background .2s, box-shadow .2s;
  box-sizing: border-box;
}

#ctaForm input,
#ctaForm select {
  min-height: var(--field-height);
  line-height: 1.2;
}

#ctaForm select {
  -webkit-appearance: none;
  appearance: none;
  background-clip: padding-box;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%23FF84B4' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 28px 28px;
  min-height: var(--field-height);
  line-height: 1.2;
}

#ctaForm input:focus,
#ctaForm select:focus,
#ctaForm textarea:focus {
  border-color: var(--cta-accent);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cta-accent) 25%, transparent);
}

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

#ctaForm textarea {
  width: 100%;
  max-width: none;
  min-height: 120px;
  resize: vertical;
}

.security {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 48px;
  align-items: start;
  width: 100%;
}
.security-left { display: grid; gap: 14px; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--cta-fg);
  margin-bottom: 6px;
}

.check {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #f9f9f9;
  position: relative;
  box-sizing: border-box;
  min-height: var(--field-height);
}
.check input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.check span {
  color: #000;
  font-size: 15px;
  font-weight: 400;
}
.check .tick {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #9ad39a;
  background: #fff;
  position: relative;
  flex: 0 0 auto;
}
.check .tick::after {
  content: "✓";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #58b458;
  font-size: 16px; font-weight: 800;
  opacity: 0; transition: opacity .15s ease;
}
.check:hover { border-color: var(--cta-accent); background: #fff; }
.check input:checked + span + .tick::after { opacity: 1; }

.security-right {
  display: grid;
  gap: 18px;
  align-content: start;
  width: 100%;
}

.privacy {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--cta-fg);
  opacity: .7;
  margin: 0;
}

/* --- Submit button --- */
.submit {
  width: 100%;
  padding: clamp(14px, 2vw, 20px);
  border: 0;
  border-radius: 12px;
  background: var(--cta-accent);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease, background .2s ease;
  box-sizing: border-box;
  min-height: var(--field-height);
}

.submit:not(:disabled) {
  background: var(--cta-accent);
  color: #fff;
  cursor: pointer;
}

.submit:hover:not(:disabled) { filter: brightness(.95); }
.submit:active:not(:disabled) { transform: translateY(1px) scale(.99); }

/* Focus-visible accessibility */
.submit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cta-accent) 35%, transparent);
  outline-offset: 3px;
}

.status {
  margin: 0;
  font-size: 14px;
  color: var(--cta-fg);
  text-align: left;
}

.actions { display: contents; }

@media (max-width: 680px) {
  .modal-content {
    width: 88vw;
    padding: 28px 24px;
    border-radius: 24px;
    max-height: calc(100dvh - 24px);
  }
  .security { grid-template-columns: 1fr; gap: 8px; }
  #ctaForm input,
  #ctaForm select,
  #ctaForm textarea,
  .check,
  .submit {
    width: 100%;
    max-width: 100%;
  }
}

/* Accent asterisk for required fields */
.field > span { color: var(--cta-fg); }
.req {
  color: var(--cta-accent);
  font-weight: 800;
}

/* Disabled submit state */
.submit:disabled {
  background: #cfcfcf !important;
  color: #666 !important;
  cursor: not-allowed;
  filter: none;
  transform: none;
  opacity: 0.9;
}
.submit:disabled:hover,
.submit:disabled:active {
  filter: none;
  transform: none;
}

.legal-note {
  font-size: 12px;
  color: var(--cta-fg);
  opacity: 0.6;
  text-align: left;
  margin-top: 0px;
  line-height: 1.4;
}

.legal-note a {
  color: var(--cta-accent);
  font-weight: 500;
  text-decoration: none;
}

.legal-note a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.security-right {
  display: flex;
  flex-direction: column;
  gap: 4px; /* tighten internal gap */
  align-items: flex-start;
}
/* Move modal slightly down on mobile and tablet */
@media (max-width: 860px) {
  .modal.open { align-items: flex-start; }
  .modal-content { margin-top: 60px; margin-bottom: 32px; }
}

@media (max-width: 680px) {
  .modal.open {
    align-items: flex-start;     /* anchor to top instead of center */
  }

  .modal-content {
    margin-top: 60px;           /* push it down below top banner */
    margin-bottom: 24px;        /* keep breathing room at bottom */
  }
}

/* === Scroll Lock (for when modal is open) === */
body.no-scroll,
html.no-scroll {
  overflow: hidden;
  height: 100%;
  touch-action: none; /* prevents background touch scroll on iOS */
}