/* Candidature chatteur — fenêtre en 5 étapes */
.cw {
  --cw-bg: #0a0b12; --cw-card: rgba(255,255,255,.04); --cw-line: rgba(255,255,255,.09); --cw-dim: #8d93a8; --cw-ink: #f2f3f8;
  --cw-a: #ec4899; --cw-b: #8b5cf6; --cw-grad: linear-gradient(120deg, #ec4899, #8b5cf6 60%, #6366f1);
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(4,4,10,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  font-family: "Inter", system-ui, sans-serif; color: var(--cw-ink);
}
.cw.is-open { opacity: 1; pointer-events: auto; }
.cw__box {
  position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: 28px; border: 1px solid var(--cw-line);
  background: radial-gradient(90% 60% at 0% 0%, rgba(236,72,153,.16), transparent 60%), radial-gradient(80% 60% at 100% 0%, rgba(139,92,246,.18), transparent 60%), var(--cw-bg);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02) inset;
  transform: translateY(16px) scale(.98); transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.cw.is-open .cw__box { transform: none; }
.cw__x { position: absolute; top: 16px; right: 16px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--cw-line); background: var(--cw-card); color: var(--cw-ink); cursor: pointer; }
.cw__in { padding: 28px 30px 26px; }
@media (max-width: 600px) { .cw__in { padding: 22px 18px; } .cw__box { border-radius: 22px; } }

.cw__head { display: grid; gap: 10px; margin-bottom: 22px; }
.cw__kicker { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #f9a8d4; }
.cw__head h2 { margin: 0; font-family: "Unbounded", "Inter", sans-serif; font-size: clamp(20px, 3.4vw, 26px); font-weight: 700; }
.cw__steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.cw__steps li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cw-dim); }
.cw__steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; border: 1px solid var(--cw-line); }
.cw__steps li.is-on { color: var(--cw-ink); }
.cw__steps li.is-on span { background: var(--cw-grad); border-color: transparent; color: #fff; }
.cw__steps li.is-done span { background: rgba(52,211,153,.18); border-color: rgba(52,211,153,.5); color: #6ee7b7; }
.cw__steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--cw-line); margin-right: 2px; }
@media (max-width: 600px) { .cw__steps li b { display: none; } }
.cw__bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.cw__bar i { display: block; height: 100%; background: var(--cw-grad); border-radius: inherit; transition: width .4s ease; }

.cw__lead { margin: 0 0 16px; color: #c4c8d6; line-height: 1.55; }
.cw__body { display: grid; gap: 14px; }
.cwgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .cwgrid { grid-template-columns: 1fr; } }
.cwf { display: grid; gap: 7px; }
.cwf--plein { grid-column: 1 / -1; }
.cwf > span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--cw-dim); }
.cwf small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.cw input, .cw textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--cw-line); background: rgba(0,0,0,.35);
  color: var(--cw-ink); font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.cw input:focus, .cw textarea:focus { border-color: rgba(236,72,153,.6); box-shadow: 0 0 0 4px rgba(236,72,153,.14); }
.cwchips { display: flex; flex-wrap: wrap; gap: 6px; }
.cwchip { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--cw-line); background: var(--cw-card); color: #cfd3e0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.cwchip:hover { border-color: rgba(236,72,153,.5); }
.cwchip.is-on { background: var(--cw-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px rgba(236,72,153,.9); }

.cw__nav { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--cw-line); }
.cw__nav small { color: var(--cw-dim); font-size: 12px; text-align: center; flex: 1; }
.cwb { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 14px; border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 14px; color: #fff; background: var(--cw-grad); box-shadow: 0 14px 32px -14px rgba(236,72,153,.9); text-decoration: none; transition: transform .15s, filter .15s, opacity .15s; }
.cwb:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.cwb:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.cwb--ghost { background: var(--cw-card); border: 1px solid var(--cw-line); box-shadow: none; color: var(--cw-ink); }
.cwb--big { padding: 15px 28px; font-size: 15px; border-radius: 16px; }
.cwcenter { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* Connexion */
.cwgauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cwgauge { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: 20px; background: var(--cw-card); border: 1px solid var(--cw-line); }
.cwgauge__ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--cw-bg) 80%, transparent 82% 100%), conic-gradient(#ec4899 0%, #8b5cf6 calc(var(--p) * 1%), rgba(255,255,255,.07) 0); transition: background .4s; }
.cwgauge__ring b { font-family: "Unbounded", sans-serif; font-size: 22px; }
.cwgauge__ring small { font-size: 10px; color: var(--cw-dim); }
.cwgauge > span { font-size: 12px; font-weight: 700; color: #c4c8d6; }
@media (max-width: 520px) { .cwgauge__ring { width: 82px; height: 82px; } .cwgauge__ring b { font-size: 17px; } }
.cwstatus { display: flex; align-items: center; justify-content: center; gap: 10px; color: #c4c8d6; margin: 0; }
.cwspin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: #ec4899; animation: cwspin .8s linear infinite; }
@keyframes cwspin { to { transform: rotate(360deg); } }
.cwverdict { margin: 0; padding: 12px 14px; border-radius: 14px; text-align: center; font-weight: 700; }
.cwverdict--ok { background: rgba(52,211,153,.12); color: #6ee7b7; }
.cwverdict--moyen { background: rgba(251,191,36,.12); color: #fcd34d; }
.cwverdict--faible { background: rgba(248,113,113,.12); color: #fca5a5; }

/* Clavier */
.cwtimer { display: grid; justify-items: center; }
.cwtimer b { font-family: "Unbounded", sans-serif; font-size: 44px; background: var(--cw-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.cwtimer small { color: var(--cw-dim); }
.cwtype { padding: 20px; border-radius: 18px; background: rgba(0,0,0,.35); border: 1px solid var(--cw-line); font-size: 20px; line-height: 1.6; letter-spacing: .01em; font-family: ui-monospace, "Cascadia Mono", monospace; word-break: break-word; }
.cwtype span { color: #5b6075; border-radius: 3px; }
.cwtype span.ok { color: #f2f3f8; }
.cwtype span.ko { color: #fff; background: rgba(248,113,113,.55); }
.cwtype span.cur { color: #f2f3f8; box-shadow: inset 0 -3px 0 #ec4899; animation: cwcur 1s steps(2) infinite; }
@keyframes cwcur { 50% { box-shadow: none; } }
.cwtype__in { font-family: ui-monospace, monospace !important; font-size: 16px !important; }
.cwhint { margin: 0; color: var(--cw-dim); font-size: 12px; text-align: center; }
.cwscores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cwscores div, .cwrecap div { padding: 18px; border-radius: 18px; background: var(--cw-card); border: 1px solid var(--cw-line); display: grid; gap: 4px; }
.cwscores b { font-family: "Unbounded", sans-serif; font-size: 34px; background: var(--cw-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cwscores span { color: var(--cw-dim); font-size: 13px; }

/* Simulation */
.cwsimintro { display: grid; justify-items: center; text-align: center; gap: 4px; }
.cwsimintro__av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--cw-grad); box-shadow: 0 16px 40px -14px rgba(236,72,153,.9); margin-bottom: 8px; }
.cwrules { list-style: none; padding: 0; margin: 4px 0 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cwrules li { padding: 6px 12px; border-radius: 999px; background: var(--cw-card); border: 1px solid var(--cw-line); font-size: 12.5px; color: #c4c8d6; }
.cwchat { display: grid; grid-template-rows: auto 1fr auto; height: min(460px, 58vh); border-radius: 22px; overflow: hidden; border: 1px solid var(--cw-line); background: rgba(0,0,0,.3); }
.cwchat__top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--cw-line); background: rgba(255,255,255,.03); }
.cwchat__top b { display: block; font-size: 14px; }
.cwchat__top small { color: #6ee7b7; font-size: 11.5px; }
.cwchat__av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.cwchat__n { margin-left: auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--cw-card); border: 1px solid var(--cw-line); }
.cwchat__msgs { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cwmsg { display: flex; }
.cwmsg p { margin: 0; max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.cwmsg--fan p { background: rgba(255,255,255,.07); border-bottom-left-radius: 6px; }
.cwmsg--moi { justify-content: flex-end; }
.cwmsg--moi p { background: var(--cw-grad); color: #fff; border-bottom-right-radius: 6px; }
.cwdots { display: flex; gap: 4px; padding: 14px 16px !important; }
.cwdots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa0b4; animation: cwdot 1.2s infinite; }
.cwdots i:nth-child(2) { animation-delay: .15s; }
.cwdots i:nth-child(3) { animation-delay: .3s; }
@keyframes cwdot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.cwchat__in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--cw-line); }
.cwchat__in input { border-radius: 999px; }
.cwchat__in .cwb { border-radius: 999px; padding: 10px 18px; }
.cwchat__fin { margin: 0; padding: 14px; text-align: center; color: #6ee7b7; font-weight: 700; border-top: 1px solid var(--cw-line); }

/* Envoi */
.cwrecap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .cwrecap, .cwscores { grid-template-columns: 1fr; } }
.cwrecap span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-dim); }
.cwrecap b { font-size: 17px; }
.cwrecap small { color: #aab0c2; font-size: 12px; }
.cwbot { display: grid; gap: 8px; padding: 16px; border-radius: 18px; border: 1px solid rgba(251,191,36,.35); background: rgba(251,191,36,.07); }
.cwbot b { color: #fcd34d; }
.cwbot p { margin: 0; color: #d6d0b8; font-size: 13px; }
.cwbot .cwb { justify-self: start; }
.cwdone { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 20px 0; }
.cwdone__ico { font-size: 56px; }
.cwdone h2 { margin: 0; font-family: "Unbounded", sans-serif; }
.cwdone p { margin: 0; color: #c4c8d6; max-width: 420px; }

@media (prefers-reduced-motion: reduce) { .cw, .cw__box, .cw__bar i { transition: none; } .cwspin, .cwdots i, .cwtype span.cur { animation: none; } }

/* La page d'accueil pose position:relative sur les blocs du body : on reprend la main. */
body > .cw, .cw { position: fixed !important; inset: 0 !important; z-index: 1000 !important; width: auto !important; height: auto !important; margin: 0 !important; }
body > .simov { position: fixed !important; inset: 0 !important; z-index: 2000 !important; }

/* Capture speedtest */
.cwdrop { display: grid; justify-items: center; gap: 8px; padding: 26px 16px; border-radius: 20px; border: 2px dashed rgba(236,72,153,.4); background: rgba(236,72,153,.05); cursor: pointer; text-align: center; transition: all .15s; }
.cwdrop:hover { border-color: rgba(236,72,153,.8); background: rgba(236,72,153,.1); }
.cwdrop b { font-size: 15px; }
.cwdrop span { color: #8d93a8; font-size: 12.5px; }
.cwdrop.is-ok { border-style: solid; border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.06); }
.cwdrop.is-ok span { color: #6ee7b7; }
.cwdrop img { max-width: 100%; max-height: 220px; border-radius: 12px; }
.cw *, .cw *::before, .cw *::after { box-sizing: border-box; }
.cw__box { overflow-x: hidden; }
