/* ----------------------------------------------------------------
   Diamonds Above — CTA Modal
   Reusable popup modal for every page-specific CTA on the site.
   Uses tokens from design-system.css (--gold, --bg-card, z-index, etc).
   ---------------------------------------------------------------- */

.cta-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 22, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--z-modal-backdrop, 900);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out-expo, ease);
}

.cta-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cta-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.cta-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-card, #292d40);
  border: 1px solid rgba(var(--gold-rgb, 216, 192, 120), 0.25);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 32px;
  pointer-events: auto;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s var(--ease-out-expo, ease), opacity 0.3s var(--ease-out-expo, ease);
}

.cta-modal-backdrop.is-open + .cta-modal .cta-modal__dialog,
.cta-modal.is-open .cta-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cta-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-primary, #f0ede6);
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cta-modal__close:hover {
  background: rgba(var(--gold-rgb, 216, 192, 120), 0.15);
  color: var(--gold, #d8c078);
}

.cta-modal__header {
  margin-bottom: 20px;
  padding-right: 36px;
}

.cta-modal__title {
  font-family: var(--font-serif, serif);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  color: var(--gold, #d8c078);
  margin: 0 0 8px;
  line-height: 1.2;
}

.cta-modal__subtitle {
  color: var(--text-secondary, #c8c4ba);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

/* Form layout */
.cta-modal__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cta-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.cta-modal__label {
  font-size: 0.85rem;
  color: var(--text-secondary, #c8c4ba);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.cta-modal__label .req {
  color: var(--gold, #d8c078);
  margin-left: 2px;
}

.cta-modal__input,
.cta-modal__select,
.cta-modal__textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary, #f0ede6);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cta-modal__textarea {
  resize: vertical;
  min-height: 90px;
}

.cta-modal__input:focus,
.cta-modal__select:focus,
.cta-modal__textarea:focus {
  outline: none;
  border-color: var(--gold, #d8c078);
  background: rgba(var(--gold-rgb, 216, 192, 120), 0.06);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb, 216, 192, 120), 0.15);
}

.cta-modal__select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold, #d8c078) 50%),
                    linear-gradient(135deg, var(--gold, #d8c078) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.cta-modal__select option {
  background: var(--bg-card, #292d40);
  color: var(--text-primary, #f0ede6);
}

/* File input */
.cta-modal__file {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cta-modal__file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(var(--gold-rgb, 216, 192, 120), 0.08);
  border: 1px dashed rgba(var(--gold-rgb, 216, 192, 120), 0.4);
  border-radius: 8px;
  color: var(--gold-light, #e8d49e);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cta-modal__file-label:hover {
  background: rgba(var(--gold-rgb, 216, 192, 120), 0.15);
  border-color: var(--gold, #d8c078);
}

.cta-modal__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cta-modal__file-list {
  font-size: 0.85rem;
  color: var(--text-secondary, #c8c4ba);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cta-modal__file-list li {
  padding: 2px 0;
}

.cta-modal__help {
  font-size: 0.8rem;
  color: var(--text-secondary, #c8c4ba);
  opacity: 0.75;
  margin-top: 2px;
}

/* Honeypot — visually hidden but present for bots */
.cta-modal__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Submit row */
.cta-modal__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.cta-modal__submit {
  flex: 1;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold, #d8c078), var(--gold-dark, #b89d4f));
  color: var(--bg-primary, #1e2132);
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta-modal__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--gold-rgb, 216, 192, 120), 0.35);
}

.cta-modal__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.cta-modal__error {
  grid-column: 1 / -1;
  background: rgba(220, 80, 80, 0.12);
  border: 1px solid rgba(220, 80, 80, 0.4);
  color: #ffb4b4;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.cta-modal__error.is-shown { display: block; }

/* Success state */
.cta-modal__success {
  text-align: center;
  padding: 16px 8px;
}

.cta-modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(var(--gold-rgb, 216, 192, 120), 0.15);
  color: var(--gold, #d8c078);
  display: grid;
  place-items: center;
  font-size: 32px;
}

.cta-modal__success-title {
  font-family: var(--font-serif, serif);
  font-size: 1.4rem;
  color: var(--gold, #d8c078);
  margin: 0 0 10px;
}

.cta-modal__success-body {
  color: var(--text-secondary, #c8c4ba);
  margin: 0 0 18px;
  line-height: 1.55;
}

/* Mobile */
@media (max-width: 600px) {
  .cta-modal { padding: 0; align-items: flex-end; }
  .cta-modal__dialog {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 24px 20px 28px;
  }
  .cta-modal__form { grid-template-columns: 1fr; }
}

/* Body scroll lock */
body.cta-modal-open { overflow: hidden; }
