:root {
  --bg: #070b1f;
  --bg-2: #0b1230;
  --panel: #111a3f;
  --panel-2: #172252;
  --line: rgba(88, 101, 242, 0.28);
  --line-strong: rgba(120, 134, 255, 0.55);
  --ink: #f2f4ff;
  --muted: #a7b0dd;
  --faint: #6f7bb5;
  --blurple: #5865f2;
  --blurple-2: #7983f5;
  --sky: #00b0f4;
  --green: #23a559;
  --green-2: #2dc770;
  --red: #da373c;
  --red-2: #f23f43;
  --yellow: #f0b232;
  --fuchsia: #eb459e;
  --grad: linear-gradient(135deg, #5865f2 0%, #00b0f4 100%);
  --c: 10px;
  --display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --body: 'Segoe UI', system-ui, -apple-system, 'gg sans', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 16px/1.6 var(--body); color: var(--ink); min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(88, 101, 242, 0.28), transparent 60%),
    radial-gradient(700px 500px at -5% 30%, rgba(0, 176, 244, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35;
  background-image: linear-gradient(rgba(88, 101, 242, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(88, 101, 242, 0.08) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--muted); }
.wrap { width: min(1160px, 92vw); margin: 0 auto; position: relative; z-index: 1; }
main { position: relative; z-index: 1; }
section.block { padding: 72px 0; }
.eyebrow { font: 700 0.85rem var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--sky); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* ===== Éléments biseautés (angles coupés) : bordure = ::before, remplissage = ::after ===== */
.card, .panel, .step, .btn, .chip, .note, .tile, dialog, .qcm-opt, .field-box {
  --c: 14px; --edge: var(--line); --fill: var(--panel);
  position: relative; isolation: isolate; background: none; border: 0;
}
.card::before, .panel::before, .step::before, .btn::before, .chip::before, .note::before, .tile::before, dialog::before, .qcm-opt::before, .field-box::before,
.card::after, .panel::after, .step::after, .btn::after, .chip::after, .note::after, .tile::after, dialog::after, .qcm-opt::after, .field-box::after {
  content: ''; position: absolute; z-index: -1; transition: background 0.18s, filter 0.18s;
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.card::before, .panel::before, .step::before, .btn::before, .chip::before, .note::before, .tile::before, dialog::before, .qcm-opt::before, .field-box::before { inset: 0; background: var(--edge); }
.card::after, .panel::after, .step::after, .btn::after, .chip::after, .note::after, .tile::after, dialog::after, .qcm-opt::after, .field-box::after {
  inset: 1px; background: var(--fill);
  clip-path: polygon(0 0, calc(100% - var(--c) + 1px) 0, 100% calc(var(--c) - 1px), 100% 100%, calc(var(--c) - 1px) 100%, 0 calc(100% - var(--c) + 1px));
}
.card, .panel, .step, .note, .tile { padding: 26px; }
.card:hover, .tile:hover { --edge: var(--line-strong); }

/* ===== Boutons ===== */
.btn {
  --c: 10px; --edge: var(--line-strong); --fill: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em; cursor: pointer;
  font: 700 0.98rem var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink);
  padding: 0.75em 1.5em; text-decoration: none !important; user-select: none; transition: transform 0.12s, color 0.18s;
}
.btn:hover { --fill: var(--panel-2); --edge: var(--blurple-2); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { --edge: transparent; color: #fff; }
.btn.primary::before { background: var(--grad); }
.btn.primary::after { display: none; }
.btn.primary:hover::before { filter: brightness(1.15) saturate(1.1); }
.btn.green { --edge: transparent; color: #fff; }
.btn.green::before { background: linear-gradient(135deg, var(--green), var(--green-2)); }
.btn.green::after { display: none; }
.btn.green:hover::before { filter: brightness(1.12); }
.btn.danger { color: #ffc9ca; --edge: rgba(242, 63, 67, 0.6); }
.btn.danger:hover { --fill: rgba(218, 55, 60, 0.2); --edge: var(--red-2); }
.btn.danger.solid { color: #fff; --edge: transparent; }
.btn.danger.solid::before { background: linear-gradient(135deg, var(--red), var(--red-2)); }
.btn.danger.solid::after { display: none; }
.btn.discord { --edge: transparent; color: #fff; }
.btn.discord::before { background: #5865f2; }
.btn.discord::after { display: none; }
.btn.discord:hover::before { background: #6d78f6; }
.btn.big { --c: 14px; padding: 0.95em 1.9em; font-size: 1.1rem; }
.btn.small { --c: 7px; padding: 0.45em 1em; font-size: 0.86rem; }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 1.25em; height: 1.25em; fill: currentColor; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.chip { --c: 6px; display: inline-block; padding: 0.25em 0.8em; font: 600 0.82rem var(--display); color: var(--sky); --fill: rgba(0, 176, 244, 0.08); --edge: rgba(0, 176, 244, 0.4); }
.chip.ok { color: var(--green-2); --fill: rgba(35, 165, 89, 0.1); --edge: rgba(35, 165, 89, 0.5); }
.chip.warn { color: var(--yellow); --fill: rgba(240, 178, 50, 0.1); --edge: rgba(240, 178, 50, 0.5); }

/* ===== Header ===== */
header.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(16px) saturate(1.3); background: rgba(7, 11, 31, 0.78); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 26px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 1.45rem var(--display); color: var(--ink) !important; text-decoration: none !important; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--muted); font-weight: 600; padding: 8px 13px; position: relative; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 0; height: 2px; background: var(--grad); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang { display: inline-flex; gap: 2px; }
.lang button { background: none; border: 0; color: var(--faint); font: 700 0.86rem var(--display); padding: 7px 9px; cursor: pointer; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed='true'] { color: var(--sky); box-shadow: inset 0 -2px 0 var(--sky); }
.user-chip { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px 4px 4px; border: 1px solid var(--line); background: rgba(88, 101, 242, 0.1); border-radius: 40px; color: var(--ink); font-weight: 600; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px; display: none; z-index: 60; }
.user-chip:focus-within .user-menu, .user-chip.open .user-menu { display: block; }
.user-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; text-decoration: none; }
.user-menu a:hover { background: rgba(88, 101, 242, 0.25); }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); width: 42px; height: 42px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); padding: 12px 4vw; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .user-chip .uname { display: none; }
}

/* ===== Hero & sections ===== */
.hero { padding: 90px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.2rem; max-width: 560px; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(380px, 80%); filter: drop-shadow(0 0 60px rgba(88, 101, 242, 0.6)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.banner { margin: 0 auto; width: min(1160px, 92vw); position: relative; z-index: 1; }
.banner img { width: 100%; border-radius: 18px; border: 1px solid var(--line-strong); box-shadow: 0 0 60px rgba(88, 101, 242, 0.25); display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-top: 44px; }
.stats .tile { text-align: center; padding: 20px; }
.stats b { display: block; font: 700 2rem var(--display); color: var(--sky); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 36px; }
.card .ico { width: 54px; height: 54px; margin-bottom: 14px; padding: 10px; border-radius: 14px; background: rgba(88, 101, 242, 0.18); }
.card .ico img { width: 100%; height: 100%; filter: brightness(0) invert(1) sepia(1) saturate(4) hue-rotate(195deg); }
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 36px; counter-reset: s; }
.step .n { width: 46px; height: 46px; display: grid; place-items: center; font: 700 1.4rem var(--display); background: var(--grad); color: #fff; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); margin-bottom: 14px; }
.cta-band { text-align: center; padding: 56px 24px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
@media (max-width: 820px) { .hero-grid, .split { grid-template-columns: 1fr; } .hero-art { order: -1; } }
.srv-card { text-align: center; padding: 38px 28px; }
.srv-card img.logo { width: 150px; height: 150px; border-radius: 28px; margin-bottom: 16px; filter: drop-shadow(0 0 30px rgba(88, 101, 242, 0.5)); }
.srv-card .btn { margin-top: 10px; }
.page-head { padding: 56px 0 8px; }
footer.site-foot { margin-top: 60px; border-top: 1px solid var(--line); padding: 30px 0; color: var(--faint); font-size: 0.92rem; position: relative; z-index: 1; }
footer.site-foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.links-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 30px; }
.link-card { display: flex; align-items: center; gap: 16px; color: var(--ink) !important; text-decoration: none !important; }
.link-card img { width: 52px; height: 52px; border-radius: 14px; }
.link-card small { color: var(--muted); display: block; }
.login-box { max-width: 480px; margin: 90px auto; text-align: center; padding: 44px 34px; }
.login-box img.logo { width: 110px; margin-bottom: 10px; }
.err { color: #ffb3b5; font-weight: 600; }

/* ===== Dashboard ===== */
.guilds { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 28px; }
.guild { display: flex; align-items: center; gap: 16px; cursor: pointer; padding: 18px 20px; color: var(--ink) !important; text-decoration: none !important; }
.guild .gicon { width: 60px; height: 60px; border-radius: 18px; flex: none; display: grid; place-items: center; background: var(--blurple); font: 700 1.3rem var(--display); overflow: hidden; }
.guild .gicon img { width: 100%; height: 100%; object-fit: cover; }
.guild .gname { font: 700 1.1rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild .meta { min-width: 0; }
.guild.present { --edge: rgba(88, 101, 242, 0.7); --fill: #16225a; }
.guild.present:hover { --edge: var(--sky); }
.guild.absent { filter: grayscale(1); opacity: 0.6; }
.guild.absent:hover { opacity: 0.9; }
.quota-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.form-grid { display: grid; gap: 18px; max-width: 760px; }
label.lbl { display: block; font: 700 0.95rem var(--display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--sky); margin-bottom: 6px; }
input[type=text], textarea, select {
  width: 100%; background: #0a1230; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; font: inherit; outline: none;
}
input[type=text]:focus, textarea:focus, select:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(0, 176, 244, 0.2); }
textarea { min-height: 90px; resize: vertical; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: rgba(88, 101, 242, 0.06); }
.check:hover { border-color: var(--line-strong); }
.check input { accent-color: var(--blurple); width: 18px; height: 18px; }
.theme-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); margin-top: 28px; }
.theme-card { cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.theme-card.selected { --edge: var(--sky); --fill: #14296b; }
.theme-card ul { margin: 6px 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.alert { padding: 14px 18px; border-left: 4px solid var(--yellow); background: rgba(240, 178, 50, 0.1); border-radius: 6px; margin: 18px 0; }
.alert.bad { border-color: var(--red-2); background: rgba(242, 63, 67, 0.1); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--sky); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Conversations ===== */
body.chat-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.chat-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; width: min(980px, 96vw); margin: 0 auto; padding: 14px 0 18px; position: relative; z-index: 1; }
.chat-top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17, 26, 63, 0.8); }
.chat-top .gicon { width: 44px; height: 44px; border-radius: 14px; background: var(--blurple); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.chat-top .gicon img { width: 100%; height: 100%; object-fit: cover; }
.chat-top .grow { flex: 1; min-width: 0; }
.chat-top .grow b { display: block; font: 700 1.15rem var(--display); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 6px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 12px; max-width: 88%; animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg .av { width: 38px; height: 38px; border-radius: 12px; flex: none; background: var(--panel-2); overflow: hidden; }
.msg .av img { width: 100%; height: 100%; }
.msg .bubble { padding: 12px 16px; border-radius: 6px 16px 16px 16px; background: var(--panel); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: linear-gradient(135deg, #4752c4, #5865f2); border-color: transparent; border-radius: 16px 6px 16px 16px; }
.msg.system { align-self: center; max-width: 94%; }
.msg.system .bubble { background: rgba(0, 176, 244, 0.08); border-color: rgba(0, 176, 244, 0.3); border-radius: 12px; font-size: 0.92rem; color: var(--muted); }
.qcm { margin-top: 12px; display: grid; gap: 8px; }
.qcm .q { font-weight: 700; color: var(--sky); }
.qcm-opt { --c: 8px; --fill: var(--panel-2); --edge: var(--line-strong); padding: 10px 14px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; width: 100%; }
.qcm-opt:hover { --edge: var(--sky); --fill: #1d2c6e; }
.qcm-opt.sel { --edge: var(--sky); --fill: #1b3a82; }
.qcm-opt:disabled { cursor: default; opacity: 0.55; }
.qcm-opt.chosen { opacity: 1; --edge: var(--green); }
.qcm-other { display: none; gap: 8px; }
.qcm-other.show { display: flex; }
.qcm-other input { flex: 1; }
.action-box { margin-top: 12px; padding: 12px; border: 1px dashed rgba(35, 165, 89, 0.55); border-radius: 12px; background: rgba(35, 165, 89, 0.07); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.action-box.done { border-color: var(--line); background: transparent; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; }
.chat-input textarea { min-height: 50px; max-height: 140px; border-radius: 12px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
dialog { --c: 16px; --fill: #101a47; --edge: var(--red-2); color: var(--ink); padding: 30px; width: min(460px, 92vw); margin: auto; }
dialog::backdrop { background: rgba(3, 6, 20, 0.8); backdrop-filter: blur(4px); }
dialog h3 { color: #ffb3b5; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 200; background: var(--panel); border: 1px solid var(--line-strong); border-left: 4px solid var(--sky); padding: 12px 18px; border-radius: 10px; max-width: 360px; animation: pop 0.2s; }
.toast.bad { border-left-color: var(--red-2); }
.toast.ok { border-left-color: var(--green-2); }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: #26357f; border-radius: 6px; } ::-webkit-scrollbar-track { background: transparent; }
