/* ============================================================
   Co-Founder Application Modal  (cofm-*)
   On-site pop-up form that replaces the external Typeform on the
   "Co-Build with Us" CTAs. Recruits fractional co-founders
   (CMO / CPO / CFO / CRO). Namespaced under .cofm- so it cannot
   collide with the Webflow-exported site styles.
   Matches the site tokens: brand-orange #f56e38, dark panels,
   Geist headings, green rgb(86,211,145) for the success state.
   ============================================================ */

.cofm-root {
  --cofm-orange: #f56e38;
  --cofm-green: rgb(86, 211, 145);
  --cofm-panel: #131313;
  --cofm-panel-2: #191919;
  --cofm-field: #1f1f1f;
  --cofm-border: #ffffff1f;
  --cofm-border-strong: #545454;
  --cofm-white: #ffffff;
  --cofm-muted: #eeeeee80;
  --cofm-muted-2: #eeeeeebf;
  --cofm-radius: 14px;
  --cofm-radius-sm: 10px;

  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;            /* always laid out; visibility/opacity gate it (rAF-independent) */
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Geist', 'Neuemontreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
.cofm-root.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .28s ease, visibility 0s;
}

/* Backdrop */
.cofm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Panel */
.cofm-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--cofm-panel-2) 0%, var(--cofm-panel) 100%);
  border: 1px solid var(--cofm-border);
  border-radius: var(--cofm-radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(14px);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1);
}
.cofm-root.is-open .cofm-panel { transform: translateY(0); }

/* Close button */
.cofm-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cofm-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cofm-muted-2);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  z-index: 2;
}
.cofm-close:hover { border-color: var(--cofm-orange); color: #fff; background: rgba(245,110,56,.12); }
.cofm-close svg { width: 16px; height: 16px; }

/* Scroll body */
.cofm-body {
  padding: 34px 34px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Header */
.cofm-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cofm-orange);
  font-weight: 600;
  margin-bottom: 10px;
}
.cofm-title {
  font-size: 26px;
  line-height: 1.15;
  color: var(--cofm-white);
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.cofm-sub {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--cofm-muted-2);
  margin: 0 0 24px;
}

/* Field blocks */
.cofm-field-block { margin-bottom: 15px; }
.cofm-label {
  display: block;
  font-size: 13px;
  color: var(--cofm-muted-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.cofm-label .cofm-req { color: var(--cofm-orange); margin-left: 2px; }

.cofm-input,
.cofm-textarea,
.cofm-select {
  width: 100%;
  background: var(--cofm-field);
  border: 1px solid var(--cofm-border);
  border-radius: var(--cofm-radius-sm);
  color: var(--cofm-white);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 14px;
  transition: border-color .18s, background .18s;
  -webkit-appearance: none;
  appearance: none;
}
.cofm-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.cofm-input::placeholder,
.cofm-textarea::placeholder { color: #ffffff40; }
.cofm-input:focus,
.cofm-textarea:focus,
.cofm-select:focus {
  outline: none;
  border-color: var(--cofm-orange);
  background: #232323;
}
.cofm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23eeeeeebf' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.cofm-select option { background: #191919; color: #fff; }

/* Company chips: 5 equal columns. minmax(0,1fr) forces truly equal widths
   (plain 1fr lets each chip grow to its text's min-content = uneven). */
.cofm-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.cofm-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  background: var(--cofm-field);
  border: 1px solid var(--cofm-border);
  border-radius: var(--cofm-radius-sm);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
  text-align: center;
}
.cofm-chip:hover { border-color: var(--cofm-border-strong); transform: translateY(-1px); }
.cofm-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cofm-chip-role { font-size: 15px; font-weight: 600; color: var(--cofm-white); letter-spacing: .01em; }
.cofm-chip.is-selected {
  border-color: var(--cofm-orange);
  background: rgba(245, 110, 56, 0.12);
}
.cofm-chip.is-selected .cofm-chip-role { color: var(--cofm-orange); }

/* Preselected-company confirmation: shown instead of the picker when the
   modal is opened from a specific company's "?" seat. */
.cofm-selected-note { display: none; }
.cofm-root.is-prefilled [data-block="fraction"] { display: none; }
.cofm-root.is-prefilled .cofm-selected-note {
  display: block;
  margin-bottom: 15px;
}
/* Header row: label on the left, quiet "Change" on the right,
   mirroring the form's own label rhythm (not a coloured callout). */
.cofm-selected-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cofm-selected-label {
  font-size: 13px;
  color: var(--cofm-muted-2);
  font-weight: 500;
}
/* The chosen company sits in a plain field, like a locked-in answer. */
.cofm-selected-value {
  background: var(--cofm-field);
  border: 1px solid var(--cofm-border);
  border-radius: var(--cofm-radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--cofm-muted-2);
}
.cofm-selected-code {
  color: var(--cofm-orange);
  font-weight: 600;
  letter-spacing: .01em;
}
.cofm-change-link {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--cofm-muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.cofm-change-link:hover { color: var(--cofm-orange); }

/* Error */
.cofm-error {
  display: none;
  font-size: 12.5px;
  color: #ff6b5e;
  margin-top: 6px;
}
.cofm-field-block.has-error .cofm-error { display: block; }
.cofm-field-block.has-error .cofm-input,
.cofm-field-block.has-error .cofm-textarea,
.cofm-field-block.has-error .cofm-select { border-color: #ff6b5e; }
.cofm-field-block.has-error .cofm-chips { outline: 1px solid #ff6b5e; outline-offset: 3px; border-radius: var(--cofm-radius-sm); }

/* Submit */
.cofm-submit {
  width: 100%;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  background: #eeeeee;
  color: #0d0d0d;
  border: 1px solid #eeeeee;
  border-radius: var(--cofm-radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.cofm-submit:hover { background: var(--cofm-orange); border-color: var(--cofm-orange); color: #fff; }
.cofm-submit:disabled { opacity: .6; cursor: not-allowed; }
.cofm-submit svg { width: 18px; height: 18px; }
.cofm-foot-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--cofm-muted);
  text-align: center;
}

/* Success state */
.cofm-success { display: none; text-align: center; padding: 20px 6px 8px; }
.cofm-root.is-success .cofm-form { display: none; }
.cofm-root.is-success .cofm-success { display: block; }
.cofm-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(86, 211, 145, 0.12);
  border: 1px solid rgba(86, 211, 145, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cofm-success-icon svg { width: 30px; height: 30px; color: var(--cofm-green); }
.cofm-success-title { font-size: 23px; color: #fff; font-weight: 600; margin: 0 0 8px; }
.cofm-success-text { font-size: 14.5px; color: var(--cofm-muted-2); line-height: 1.5; margin: 0 0 22px; }

/* Scrollbar */
.cofm-body::-webkit-scrollbar { width: 8px; }
.cofm-body::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 8px; }

/* Responsive */
@media (max-width: 520px) {
  .cofm-root { padding: 0; align-items: flex-end; }
  .cofm-panel { max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .cofm-body { padding: 30px 20px 24px; }
  .cofm-title { font-size: 22px; }
  .cofm-chips { gap: 6px; }
  .cofm-chip { padding: 13px 4px; }
  .cofm-chip-role { font-size: 13.5px; }
}

/* Trigger buttons keep their site styling; nothing needed here. */

/* Clickable "?" open co-founder seats on the fractional CXO cards.
   The modal JS adds .cofm-seat to each real CXO open seat so it reads
   as interactive; portfolio-company placeholders are never bound. */
.cofm-seat { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cofm-seat:hover,
.cofm-seat:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(245, 110, 56, 0.75);
  outline: none;
}
