/* ============================================================
   CONTACT MODAL — shared across all pages
   Loaded as an external stylesheet (CSP: style-src 'self').
   Prefix: cm-  (Contact Modal)
   ============================================================ */

/* Overlay */
.cm-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.cm-overlay[hidden] { display: none; }

.cm-overlay.cm-open {
  opacity: 1;
  pointer-events: auto;
}

/* Backdrop */
.cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

/* Card */
.cm-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #161d2f;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 40px 36px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  transform: translateY(16px);
  transition: transform 0.28s ease;
  overflow: hidden;
}

.cm-overlay.cm-open .cm-card {
  transform: translateY(0);
}

/* Top accent stripe — swapped per accent class */
.cm-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.cm-card--green::before { background: var(--l-stripe, linear-gradient(90deg, #166534, #CA8A04)); }
.cm-card--gold::before  { background: linear-gradient(90deg, #b45309 0%, #eab308 50%, #b45309 100%); }

/* Close button */
.cm-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
  font-family: inherit;
}

.cm-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.cm-close:focus-visible {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

/* Eyebrow */
.cm-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #86efac;
  margin: 0 0 10px;
}

.cm-card--gold .cm-eyebrow { color: #f59e0b; }

/* Title */
.cm-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.2;
}

/* Sub */
.cm-sub {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 0 0 28px;
}

/* Form */
.cm-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-field[hidden] { display: none; }

.cm-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.02em;
}

.cm-optional { color: rgba(255,255,255,0.3); font-weight: 400; }
.cm-required { color: #f87171; }

.cm-field input,
.cm-field select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.cm-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.cm-field select option {
  background: #1e2a42;
  color: #fff;
}

.cm-field input::placeholder { color: rgba(255,255,255,0.22); }

.cm-field input:focus,
.cm-field select:focus {
  border-color: rgba(134,239,172,0.5);
  background: rgba(255,255,255,0.07);
}

.cm-card--gold .cm-field input:focus,
.cm-card--gold .cm-field select:focus {
  border-color: rgba(202,138,4,0.55);
}

/* Field error */
.cm-field-error {
  font-size: 0.775rem;
  color: #f87171;
  margin: 0;
}

.cm-field-error[hidden] { display: none; }

/* Submit */
.cm-submit {
  margin-top: 4px;
  padding: 13px 20px;
  border-radius: 9px;
  border: none;
  background: #166534;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.01em;
  font-family: 'Inter', system-ui, sans-serif;
  text-align: center;
}

.cm-submit:hover:not(:disabled) {
  background: #15803d;
  transform: translateY(-1px);
}

.cm-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cm-card--gold .cm-submit             { background: #92400e; }
.cm-card--gold .cm-submit:hover:not(:disabled) { background: #78350f; }

/* Form-level error */
.cm-error {
  font-size: 0.8rem;
  color: #f87171;
  margin: 4px 0 0;
  line-height: 1.5;
}

.cm-error a     { color: #f87171; }
.cm-error[hidden] { display: none; }

/* Success */
.cm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 8px 0 4px;
}

.cm-success[hidden] { display: none; }

.cm-success__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(22,101,52,0.25);
  border: 1.5px solid rgba(74,222,128,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #4ade80;
}

.cm-success__msg {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin: 0;
  max-width: 300px;
}

/* Responsive */
@media (max-width: 480px) {
  .cm-card { padding: 32px 24px 28px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cm-overlay,
  .cm-card,
  .cm-close,
  .cm-submit { transition: none; }
}

/* ─── Honeypot field — visually hidden, not display:none so bots see it ─── */
.cm-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
