/* CG Onboarding Forms — embedded app styling. Scoped to #cgo-app.
   Single (light) theme to match catalystgroup.gg. */

#cgo-app {
  --bg: #eceeed;
  --panel: #ffffff;
  --panel-2: #f4f6f5;
  --ink: #101a2b;
  --ink-2: #46556a;
  --ink-3: #78869a;
  --line: #dce1e0;
  --line-2: #c9d0cf;
  --accent: #c4622b;
  --accent-ink: #a94f21;
  --accent-wash: rgba(196,98,43,0.10);
  --good: #3f8f6d;
  --side: #101a2b;
  --side-panel: #16233a;
  --side-ink: #d3dbe6;
  --side-ink-2: #8593a6;
  --side-line: #243450;
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
#cgo-app[data-loading] { padding: 40px; text-align: center; color: var(--ink-3); }
#cgo-app *, #cgo-app *::before, #cgo-app *::after { box-sizing: border-box; }
#cgo-app h1, #cgo-app h2, #cgo-app h3, #cgo-app h4 { font-family: "Space Grotesk", "Public Sans", sans-serif; margin: 0; line-height: 1.15; }

.cgo-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

/* solo mode — one form on its own page (e.g. the /profile/ page), no sidebar */
.cgo-shell--solo { display: block; }
.cgo-shell--solo .cgo-main { max-width: 860px; margin: 0 auto; }
.cgo-shell--solo .cgo-top {
  position: sticky; top: 12px; z-index: 4;
  border: 0; background: transparent; box-shadow: none;
  padding: 0; margin: 0; min-height: 0; justify-content: flex-end;
}
.cgo-shell--solo .formhead h2 { font-size: clamp(23px, 3.5vw, 30px); }

/* sidebar — sticks while the page scrolls */
.cgo-side {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column;
  border-radius: 12px;
}
.cgo-brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--side-line); font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cgo-brand .mark { width: 25px; height: 25px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #8f3f18); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.cgo-brand .sub { flex-basis: 100%; margin-top: 8px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--side-ink-2); font-weight: 400; }
.cgo-navlists { padding: 10px 10px 4px; }
.navgroup { padding: 10px 0 2px; }
.navgroup > .lbl { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--side-ink-2); padding: 0 8px 6px; }
.navitem { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; color: var(--side-ink); font: inherit; font-size: 13px; padding: 8px; border-radius: 7px; line-height: 1.3; }
.navitem:hover { background: var(--side-panel); }
.navitem[aria-current="true"] { background: rgba(196,98,43,0.22); color: #fff; font-weight: 600; }
.navitem .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--side-ink-2); }
.navitem .dot.progress { background: var(--accent); }
.navitem .dot.done { background: var(--good); }
.navitem .txt { flex: 1; }
.cgo-sidefoot { margin-top: auto; padding: 14px 18px 16px; border-top: 1px solid var(--side-line); font-size: 12px; color: var(--side-ink-2); line-height: 1.5; }
.cgo-sidefoot strong { color: var(--side-ink); }

/* main — flows with the page */
.cgo-main { min-width: 0; scroll-margin-top: 30px; }
.cgo-top {
  position: sticky; top: 24px; z-index: 4;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel);
}
.cgo-top h1 { font-size: 15px; font-weight: 700; }
.cgo-top .sp { flex: 1; }
.cgo-top .savechip { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-3); opacity: 0; transition: opacity .2s; }
.cgo-top .savechip.show { opacity: 1; }
.cgo-mobnav { display: none; font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel-2); }

.cgo-scroll { background: transparent; }
.cgo-formwrap { max-width: 100%; padding: 0 0 60px; }

.formhead { margin-bottom: 22px; }
.formhead .kick { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--accent); }
.formhead h2 { font-size: clamp(21px, 3vw, 26px); letter-spacing: -0.02em; margin: 9px 0 7px; }
.formhead p { color: var(--ink-2); margin: 0; max-width: 60ch; }
.formhead .meta { margin-top: 10px; font-size: 12px; color: var(--ink-3); font-family: "IBM Plex Mono", monospace; }

.doneband { display: flex; align-items: center; gap: 10px; background: rgba(63,143,109,0.12); border: 1px solid rgba(63,143,109,0.3); border-radius: 10px; padding: 12px 15px; font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
.doneband .ico { width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }

.section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 20px 6px; margin-bottom: 15px; }
.section > .shead { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section > .shead::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { margin-bottom: 16px; }
.field > label, .field > .flabel { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.field .req { color: var(--accent); margin-left: 2px; }
.field .help { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }

#cgo-app input[type="text"], #cgo-app input[type="email"], #cgo-app input[type="tel"],
#cgo-app input[type="url"], #cgo-app input[type="number"], #cgo-app input[type="date"],
#cgo-app textarea, #cgo-app select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; line-height: 1.5; margin: 0;
}
#cgo-app textarea { min-height: 84px; resize: vertical; }
#cgo-app select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2378869a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
#cgo-app input:focus, #cgo-app textarea:focus, #cgo-app select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

#cgo-app fieldset { border: 0; margin: 0; padding: 0; }
#cgo-app fieldset legend { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 8px; padding: 0; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.choice { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); line-height: 1.4; cursor: pointer; }
.choice input { flex: none; margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); }

.note { background: var(--accent-wash); border: 1px solid rgba(196,98,43,0.22); border-radius: 9px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 16px; }
.note b { color: var(--ink); }

.rtable { margin-bottom: 16px; }
.rcols { display: grid; gap: 8px; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.rrow { display: grid; gap: 8px; margin-bottom: 8px; }
.rrow input { font-size: 13px !important; padding: 8px 10px !important; }
.rrow .rm { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-3); border-radius: 7px; cursor: pointer; font-size: 15px; height: 36px; padding: 0; }
.rrow .rm:hover { color: var(--accent); border-color: var(--accent); }
.rtable .addrow { font-family: "Space Grotesk", sans-serif; font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 1px dashed var(--line-2); border-radius: 7px; padding: 7px 13px; cursor: pointer; }
.rtable .addrow:hover { border-color: var(--accent); background: var(--accent-wash); }

.inert { border: 1px dashed var(--line-2); border-radius: 8px; padding: 12px; font-size: 12px; color: var(--ink-3); text-align: center; background: var(--panel-2); }

.formactions { display: flex; gap: 12px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.btn { font-family: "Space Grotesk", sans-serif; font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 7px; cursor: pointer; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); line-height: 1.2; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.formactions .note-inline { font-size: 12px; color: var(--ink-3); }

.cgo-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(16,26,43,0.55); display: none; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow-y: auto; }
.cgo-overlay.show { display: flex; }
.cgo-sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: 600px; width: 100%; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5); }
.cgo-sheet h3 { font-size: 18px; margin-bottom: 5px; }
.cgo-sheet .sub { color: var(--ink-2); font-size: 13px; margin-bottom: 16px; }
.cgo-sheet .grp { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 5px; }
.cgo-sheet dl { margin: 0; }
.cgo-sheet dt { font-size: 12px; color: var(--ink-3); }
.cgo-sheet dd { margin: 0 0 8px; font-size: 13px; color: var(--ink); white-space: pre-wrap; }
.cgo-sheet .empty { color: var(--ink-3); font-style: italic; }
.cgo-sheet .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.cgo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; font-family: "Space Grotesk", sans-serif; font-size: 13px; font-weight: 600; padding: 11px 20px; border-radius: 999px; z-index: 100001; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.4); opacity: 0; transition: opacity .2s, transform .2s; }
.cgo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* logged-out sign-in form (rendered by the shortcode when there's no session) —
 * same centered two-column card treatment as the Client Portal's login screen
 * (modules/client-portal/assets/css/portal.css .ccp-login-shell), ported here
 * so this second, independently-rendered login screen doesn't stay stuck with
 * the bare-unstyled-form look that was just fixed on the other one. */
.cgo-login-shell { max-width: 940px; margin: 0 auto; min-height: 60vh; display: flex; align-items: center; font-family: "Public Sans", system-ui, -apple-system, sans-serif; }
.cgo-login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; border: 1px solid #dce1e0; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 12px 32px rgba(16,26,43,.06); }
@media (max-width: 780px) { .cgo-login-grid { grid-template-columns: 1fr; } }
.cgo-login-pitch { background: #101a2b; color: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.cgo-login-pitch .cgo-mark { width: 44px; height: 44px; border-radius: 10px; background: #c4622b; color: #fff !important; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; margin-bottom: 22px; }
.cgo-login-pitch h2 { color: #fff !important; margin: 0 0 12px; font-size: 24px; line-height: 1.25; font-family: "Space Grotesk", "Public Sans", sans-serif !important; }
.cgo-login-pitch p { color: #b7c0cf !important; font-size: 14.5px; line-height: 1.6; margin: 0; }
@media (max-width: 780px) { .cgo-login-pitch { padding: 34px 28px; } }
.cgo-login-form-side { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 780px) { .cgo-login-form-side { padding: 36px 28px; } }

.cgo-login {
  max-width: 400px; margin: 8px 0;
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  color: #101a2b;
}
.cgo-login__lead { font-weight: 600; font-size: 15px; margin: 0 0 16px; }
.cgo-loginform label { display: block; font-weight: 600; font-size: 13px; color: #46556a; margin: 0 0 14px; }
.cgo-loginform input[type="text"], .cgo-loginform input[type="password"] {
  display: block; width: 100%; margin-top: 5px; font-size: 16px; padding: 12px 14px;
  border: 1px solid #c9d0cf; border-radius: 8px; background: #f4f6f5; color: #101a2b;
}
.cgo-loginform input:focus { outline: 2px solid #c4622b; outline-offset: 1px; border-color: #c4622b; }
.cgo-login__remember { display: flex; align-items: center; gap: 8px; font-weight: 500; color: #46556a; }
.cgo-login__remember input { width: 16px; height: 16px; accent-color: #c4622b; flex: none; margin-top: 0; }
.cgo-login__btn {
  font-family: "Space Grotesk", "Public Sans", sans-serif; font-weight: 600; font-size: 16px;
  padding: 15px 44px; border-radius: 999px; width: 100%; text-align: center;
  background: #c4622b; color: #fff; border: 0; cursor: pointer; margin-top: 2px;
}
.cgo-login__btn:hover { background: #a94f21; }
.cgo-login__err {
  background: rgba(179,45,46,.10); color: #a12b2c; border: 1px solid rgba(179,45,46,.28);
  border-radius: 8px; padding: 11px 14px; font-size: 14px; margin: 0 0 16px;
}
.cgo-login__lost { margin: 14px 0 0; font-size: 13px; }
.cgo-login__lost a { color: #c4622b; }
.cgo-loginform.is-failed .cgo-login__btn { animation: cgo-shake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes cgo-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); }
  40%, 60% { transform: translateX(9px); }
}
@media (prefers-reduced-motion: reduce) { .cgo-loginform.is-failed .cgo-login__btn { animation: none; } }

/* fields pre-filled from "Your Profile" */
.field.is-prefilled input, .field.is-prefilled textarea, .field.is-prefilled select {
  background: rgba(63,143,109,0.09);
  border-color: rgba(63,143,109,0.45);
}
.pfhint {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 11.5px; color: var(--good); margin-top: 5px; line-height: 1.45;
}
.pfhint::before { content: "\21A9"; font-weight: 700; }

@media (max-width: 900px) {
  .cgo-shell { grid-template-columns: 1fr; gap: 0; }
  .cgo-side { display: none; }
  .cgo-top { position: sticky; top: 0; flex-wrap: wrap; }
  .cgo-mobnav { display: block; width: 100%; order: 5; }
  .cgo-formwrap { padding: 0 0 60px; }
  .section { padding: 16px 14px 4px; }
  .choices.cols { grid-template-columns: 1fr; }
}
