/* ============================================================================
   vNext — Group creation wizard (GC1 Type → GC2 Infos → GC3 Réglages → GC4 Inviter)
   Self-contained (mounts on <body>, outside the [data-qz-skin] tree) so colours
   are explicit hex teal tokens. Entry: groups.js this.create.openWizard().
   ========================================================================== */

body.gcw-open { overflow: hidden; }

.gcw {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6, 52, 42, .46);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity var(--qz-dur-ui) ease;
}
.gcw.is-visible { opacity: 1; }

.gcw__sheet {
  width: min(440px, 100%);
  height: min(92vh, 780px);
  display: flex; flex-direction: column;
  background: #F1FAF6;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(6, 52, 42, .28);
  transform: translateY(22px) scale(.985);
  transition: transform .22s cubic-bezier(.22,.61,.36,1);
}
.gcw.is-visible .gcw__sheet { transform: none; }

/* ── Header: back · progress · close ───────────────────────────────────── */
.gcw__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  background: #FFFFFF;
  border-bottom: 1px solid #E6F2EC;
  flex: 0 0 auto;
}
.gcw__back, .gcw__close {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: #F1FAF6; color: #0F6E56;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: background var(--qz-dur-ui) ease;
}
.gcw__back:hover, .gcw__close:hover { background: #E6F5EF; }
.gcw__progress { flex: 1 1 auto; display: flex; gap: 6px; padding: 0 4px; }
.gcw__progress span { flex: 1 1 0; height: 5px; border-radius: var(--qz-r-pill); background: #DCEFE8; transition: background var(--qz-dur-ui) ease; }
.gcw__progress span.is-on { background: #16A87A; }

/* ── Toast (in-sheet feedback) ─────────────────────────────────────────── */
.gcw__toast {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%) translateY(-6px);
  max-width: 86%;
  background: #06342A; color: #fff;
  padding: 9px 16px; border-radius: var(--qz-r-pill);
  font-size: 13px; font-weight: 500; text-align: center;
  opacity: 0; pointer-events: none; z-index: 6;
  transition: opacity var(--qz-dur-ui) ease, transform var(--qz-dur-ui) ease;
}
.gcw__toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.gcw__toast[data-kind="err"] { background: #E24B4A; }

/* ── Body (scroll area) ────────────────────────────────────────────────── */
.gcw__body { flex: 1 1 auto; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }

.gcw__title { margin: 0; font-size: 22px; font-weight: 800; color: #06342A; line-height: 1.2; }
.gcw__sub { margin: 8px 0 18px; font-size: 13.5px; color: #5E8A7C; line-height: 1.45; }
.gcw__titlerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gcw__pill {
  flex: 0 0 auto; font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: var(--qz-r-pill);
  background: #E6F5EF; color: #0F6E56;
}

.gcw-label { display: block; margin: 16px 0 7px; font-size: 13px; font-weight: 700; color: #06342A; }
.gcw-label .gcw-opt { color: #93B4A8; font-weight: 500; }

/* ── GC1 — type cards ──────────────────────────────────────────────────── */
.gcw-types { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.gcw-type {
  display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 15px; border-radius: 16px;
  background: #FFFFFF; border: 2px solid #E6F2EC; cursor: pointer;
  transition: border-color var(--qz-dur-ui) ease, background var(--qz-dur-ui) ease, box-shadow var(--qz-dur-ui) ease;
}
.gcw-type:hover { border-color: #CDE7DC; }
.gcw-type.is-on { border-color: #16A87A; background: #ECF9F3; box-shadow: 0 6px 18px rgba(22,168,122,.14); }
.gcw-type__icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: #F1FAF6; color: #0F6E56;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.gcw-type.is-on .gcw-type__icon { background: #FFFFFF; color: #16A87A; }
.gcw-type__text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gcw-type__title { font-size: 15px; font-weight: 700; color: #06342A; }
.gcw-type__desc { font-size: 12.5px; color: #5E8A7C; line-height: 1.4; }
.gcw-type__radio {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #DCEFE8; background: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 11px; transition: all var(--qz-dur-ui) ease;
}
.gcw-type.is-on .gcw-type__radio { border-color: #16A87A; background: #16A87A; color: #FFFFFF; }

/* ── GC2 — inputs / cover / interests ──────────────────────────────────── */
.gcw-input, .gcw-textarea {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border: 1.5px solid #DCEFE8; border-radius: 13px;
  background: #FFFFFF; color: #06342A; font-size: 15px; font-family: inherit;
  transition: border-color var(--qz-dur-ui) ease, box-shadow var(--qz-dur-ui) ease;
}
.gcw-textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.gcw-input::placeholder, .gcw-textarea::placeholder { color: #A7C6BB; }
.gcw-input:focus, .gcw-textarea:focus { outline: none; border-color: #16A87A; box-shadow: 0 0 0 3px rgba(22,168,122,.13); }
.gcw-input.is-err { border-color: #E24B4A; box-shadow: 0 0 0 3px rgba(226,75,74,.12); }
.gcw-err { display: none; color: #E24B4A; font-size: 12.5px; margin-top: 6px; }

.gcw-cover {
  width: 100%; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border: 1.5px dashed #CDE7DC; border-radius: 13px;
  background: #FFFFFF; color: #5E8A7C; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color var(--qz-dur-ui) ease, color var(--qz-dur-ui) ease;
}
.gcw-cover:hover { border-color: #16A87A; color: #0F6E56; }
.gcw-cover.has-img { border-style: solid; border-color: #16A87A; color: #0F6E56; }
.gcw-cover__preview { margin-top: 10px; }
.gcw-cover__preview img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 13px; display: block; }

.gcw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.gcw-chip {
  padding: 8px 14px; border-radius: var(--qz-r-pill); border: 1.5px solid #DCEFE8;
  background: #FFFFFF; color: #5E8A7C; font-size: 13.5px; cursor: pointer;
  transition: all var(--qz-dur-ui) ease;
}
.gcw-chip:hover { border-color: #CDE7DC; }
.gcw-chip.is-on { background: #E6F5EF; border-color: #16A87A; color: #0F6E56; font-weight: 700; }
.gcw-chip--add { border-style: dashed; color: #0F6E56; }
.gcw-chip--add i { font-size: 11px; margin-right: 2px; }

.gcw-hint {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 14px 0 4px; font-size: 12.5px; color: #5E8A7C; line-height: 1.45;
}
.gcw-hint i { color: #16A87A; margin-top: 1px; }

/* ── GC3 — settings sections ───────────────────────────────────────────── */
.gcw-sec { margin-top: 18px; background: #FFFFFF; border: 1px solid #E6F2EC; border-radius: 16px; overflow: hidden; }
.gcw-sec__label { padding: 13px 16px; font-size: 13px; font-weight: 700; color: #06342A; border-bottom: 1px solid #EFF7F3; }
.gcw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #EFF7F3; }
.gcw-row:last-child { border-bottom: none; }
.gcw-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcw-row__text b { font-size: 14.5px; font-weight: 600; color: #06342A; }
.gcw-row__text small { font-size: 12.5px; color: #5E8A7C; }
.gcw-select {
  flex: 0 0 auto; max-width: 54%;
  padding: 8px 10px; border: 1.5px solid #DCEFE8; border-radius: 10px;
  background: #F1FAF6; color: #06342A; font-size: 13px; font-family: inherit; cursor: pointer;
}
.gcw-select:focus { outline: none; border-color: #16A87A; }

.gcw-toggle {
  flex: 0 0 auto; position: relative; width: 48px; height: 28px;
  border: none; border-radius: var(--qz-r-pill); background: #D6E6DF; cursor: pointer;
  transition: background var(--qz-dur-ui) ease;
}
.gcw-toggle span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(6,52,42,.25); transition: left var(--qz-dur-ui) ease; }
.gcw-toggle.is-on { background: #16A87A; }
.gcw-toggle.is-on span { left: 23px; }
.gcw-toggle.is-disabled { opacity: .45; cursor: not-allowed; }

/* ── GC4 — invite ──────────────────────────────────────────────────────── */
.gcw-search {
  display: flex; align-items: center; gap: 9px;
  background: #FFFFFF; border: 1.5px solid #DCEFE8; border-radius: 13px; padding: 0 14px;
  transition: border-color var(--qz-dur-ui) ease;
}
.gcw-search:focus-within { border-color: #16A87A; }
.gcw-search i { color: #93B4A8; font-size: 14px; }
.gcw-search input { flex: 1 1 auto; border: none; background: transparent; padding: 12px 0; font-size: 15px; color: #06342A; outline: none; font-family: inherit; }
.gcw-search input::placeholder { color: #A7C6BB; }

.gcw-suggest { margin-top: 16px; }
.gcw-suggest__label, .gcw-share__label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #93B4A8; margin-bottom: 8px; }
.gcw-suggest__list { display: flex; flex-direction: column; gap: 8px; }
.gcw-suggest__empty { font-size: 13px; color: #5E8A7C; text-align: center; padding: 14px; background: #FFFFFF; border: 1px dashed #DCEFE8; border-radius: 13px; }
.gcw-person { display: flex; align-items: center; gap: 12px; background: #FFFFFF; border: 1px solid #E6F2EC; border-radius: 13px; padding: 10px 12px; }
.gcw-person__av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: #E6F5EF; color: #0F6E56; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.gcw-person__name { flex: 1 1 auto; font-size: 14.5px; color: #06342A; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcw-add, .gcw-added { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.gcw-add { background: #16A87A; color: #FFFFFF; }
.gcw-added { background: #E6F5EF; color: #0F6E56; cursor: default; }

.gcw-share { margin-top: 20px; }
.gcw-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #FFFFFF; border: 1px solid #E6F2EC; border-radius: 13px; padding: 12px 14px; margin-bottom: 10px; }
.gcw-code__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcw-code__text small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #93B4A8; }
.gcw-code__text b { font-size: 18px; font-weight: 800; color: #0F6E56; letter-spacing: .06em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.gcw-linkbox { display: flex; align-items: center; gap: 8px; background: #FFFFFF; border: 1px solid #E6F2EC; border-radius: 13px; padding: 0 6px 0 12px; }
.gcw-linkbox input { flex: 1 1 auto; border: none; background: transparent; padding: 11px 0; font-size: 13px; color: #06342A; outline: none; min-width: 0; font-family: inherit; }
.gcw-copy { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; border: none; background: #F1FAF6; color: #0F6E56; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--qz-dur-ui) ease, color var(--qz-dur-ui) ease; }
.gcw-copy:hover { background: #E6F5EF; }
.gcw-copy.is-copied { background: #16A87A; color: #FFFFFF; }

/* ── Footer CTA ────────────────────────────────────────────────────────── */
.gcw__foot { flex: 0 0 auto; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: #FFFFFF; border-top: 1px solid #E6F2EC; }
.gcw__cta {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: #16A87A; color: #FFFFFF; font-size: 15.5px; font-weight: 700;
  border-bottom: 3px solid #0F6E56; cursor: pointer;
  transition: background var(--qz-dur-ui) ease, transform .05s ease;
}
.gcw__cta:hover { background: #149870; }
.gcw__cta:active { transform: scale(var(--qz-press-scale)); border-bottom-width: 2px; }
.gcw__cta.is-loading, .gcw__cta:disabled { opacity: .7; cursor: default; }

/* ── Mobile: full-screen sheet ─────────────────────────────────────────── */
@media (max-width: 560px) {
  .gcw { padding: 0; align-items: stretch; }
  .gcw__sheet { width: 100%; height: 100%; max-height: 100%; border-radius: 0; transform: translateY(100%); }
  .gcw.is-visible .gcw__sheet { transform: none; }
}

/* GC4 — note shown for public groups (members join via code, not direct-add) */
.gcw-invite-note{ display:flex; align-items:flex-start; gap:10px; background:#FFFFFF; border:1px solid #E6F2EC; border-radius:13px; padding:13px 14px; margin-top:4px; font-size:13.5px; color:#5E8A7C; line-height:1.45; }
.gcw-invite-note i{ color:#16A87A; margin-top:2px; }
