/* ── Modal overlay ───────────────────────────────────────────────────── */
.cfx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.modal-open {
  overflow: hidden;
}

/* ── Modal card ──────────────────────────────────────────────────────── */
.cfx-modal {
  width: 100%;
  max-width: 480px;
  border-radius: 14px;
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

/* ── Light theme ─────────────────────────────────────────────────────── */
.cfx-modal--light {
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

.cfx-modal--light .cfx-modal-header {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
}

.cfx-modal--light .cfx-modal-eyebrow {
  color: #16a34a;
}

.cfx-modal--light .cfx-modal-title {
  color: #111111;
}

.cfx-modal--light label {
  color: #555555;
}

.cfx-modal--light .cfx-modal-prepop {
  color: #16a34a;
}

.cfx-modal--light .cfx-modal-dot {
  background: #16a34a;
}

.cfx-modal--light .cfx-modal-tag {
  background: #ffffff;
  border: 0.5px solid #bbbbbb;
  color: #222222;
}

.cfx-modal--light .cfx-modal-tag.active {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.07);
}

.cfx-modal--light input,
.cfx-modal--light select,
.cfx-modal--light textarea {
  background-color: #ffffff !important;
  border: 1px solid #cccccc;
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
}

.cfx-modal--light input:focus,
.cfx-modal--light select:focus,
.cfx-modal--light textarea:focus {
  border-color: #16a34a;
}

.cfx-modal--light input::placeholder,
.cfx-modal--light textarea::placeholder {
  color: #aaaaaa !important;
  -webkit-text-fill-color: #aaaaaa !important;
}

.cfx-modal--light .cfx-modal-submit {
  background: #16a34a;
  color: #ffffff;
}

.cfx-modal--light .cfx-modal-submit:hover {
  background: #15803d;
}

.cfx-modal--light .cfx-modal-divider {
  background: rgba(0, 0, 0, 0.07);
}

.cfx-modal--light .cfx-modal-footer-note {
  color: #aaaaaa;
}

.cfx-modal--light .cfx-modal-close {
  border-color: rgba(0, 0, 0, 0.12);
  color: #444444;
}

.cfx-modal--light .cfx-modal-select-wrap::after {
  border-top-color: #444444;
}

/* ── Dark theme ──────────────────────────────────────────────────────── */
.cfx-modal--dark {
  background: #0f0f14;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  color-scheme: dark;
}

.cfx-modal--dark .cfx-modal-header {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
}

.cfx-modal--dark .cfx-modal-eyebrow {
  color: #6ee7b7;
}

.cfx-modal--dark .cfx-modal-title {
  color: #f0ede8;
}

.cfx-modal--dark label {
  color: rgba(240, 237, 232, 0.5);
}

.cfx-modal--dark .cfx-modal-prepop {
  color: rgba(110, 231, 183, 0.65);
}

.cfx-modal--dark .cfx-modal-dot {
  background: #6ee7b7;
}

.cfx-modal--dark .cfx-modal-tag {
  background: transparent;
  border: 0.5px solid rgba(255, 255, 255, 0.13);
  color: rgba(240, 237, 232, 0.5);
}

.cfx-modal--dark .cfx-modal-tag.active {
  border-color: #6ee7b7;
  color: #6ee7b7;
  background: rgba(110, 231, 183, 0.08);
}

.cfx-modal--dark input,
.cfx-modal--dark select,
.cfx-modal--dark textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  color: #f0ede8;
}

.cfx-modal--dark input:focus,
.cfx-modal--dark select:focus,
.cfx-modal--dark textarea:focus {
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.cfx-modal--dark input::placeholder,
.cfx-modal--dark textarea::placeholder {
  color: rgba(240, 237, 232, 0.3);
}

.cfx-modal--dark .cfx-modal-submit {
  background: #6ee7b7;
  color: #060a08;
}

.cfx-modal--dark .cfx-modal-submit:hover {
  background: #86efac;
}

.cfx-modal--dark .cfx-modal-divider {
  background: rgba(255, 255, 255, 0.07);
}

.cfx-modal--dark .cfx-modal-footer-note {
  color: rgba(240, 237, 232, 0.25);
}

.cfx-modal--dark .cfx-modal-close {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(240, 237, 232, 0.45);
}

.cfx-modal--dark .cfx-modal-select-wrap::after {
  border-top-color: rgba(240, 237, 232, 0.45);
}

/* ── Shared styles ───────────────────────────────────────────────────── */
.cfx-modal-header {
  padding: 1.1rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cfx-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.cfx-modal-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.cfx-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.cfx-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  border: 0.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cfx-modal-prepop {
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.cfx-modal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cfx-modal label {
  font-size: 11px;
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}

.cfx-modal-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cfx-modal-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  white-space: nowrap;
  transition: all 0.13s;
}

.cfx-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cfx-modal-field {
  margin-bottom: 10px;
}

.cfx-modal input,
.cfx-modal select,
.cfx-modal textarea {
  width: 100%;
  border-radius: 7px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.cfx-modal textarea {
  resize: none;
  height: 64px;
  line-height: 1.5;
}

.cfx-modal-select-wrap {
  position: relative;
}

.cfx-modal-select-wrap select {
  padding-right: 28px;
  cursor: pointer;
}

.cfx-modal-select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid;
  pointer-events: none;
}

.cfx-modal-submit {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 7px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.cfx-modal-footer-note {
  text-align: center;
  font-size: 10px;
  margin-top: 8px;
  margin-bottom: 0;
}

.cfx-modal-divider {
  height: 0.5px;
  margin: 10px 0;
}

.cfx-modal-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 8px;
  text-align: center;
  display: none;
}

/* ── Success state ───────────────────────────────────────────────────── */
.cfx-modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  gap: 8px;
}

.cfx-modal--light .cfx-modal-success h3 {
  color: #111111;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.cfx-modal--light .cfx-modal-success p {
  color: #555555;
  font-size: 13px;
  margin: 0;
}

.cfx-modal--dark .cfx-modal-success h3 {
  color: #f0ede8;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.cfx-modal--dark .cfx-modal-success p {
  color: rgba(240, 237, 232, 0.5);
  font-size: 13px;
  margin: 0;
}
