/* TOKENS */
:root {
  --bg:        #0C0F15;
  --surface:   #1B212C;
  --surface-2: #243261;
  --primary:   #3E5DE9;
  --gold:      #F0A500;
  --white:     #EEEEF5;
  --muted:     #A7B0C3;
  --r:         8px;
  --hh:        64px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--white); font-family: 'Inter', system-ui, sans-serif; overflow-x: hidden; }
a     { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* HEADER */
.header {
  position: relative; z-index: 400;
  height: var(--hh); background: var(--bg);
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 24px;
  border-bottom: 1px solid rgba(129,140,163,.1);
}
.hamburger { justify-self: start; background: none; border: none; display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 2px; transition: background .2s; }
.logo { font-size: 22px; font-weight: 900; letter-spacing: -.5px; color: var(--white); }
.logo em { color: var(--primary); font-style: normal; }
.logo-sm { display: none; font-size: 20px; font-weight: 900; letter-spacing: -.5px; color: var(--white); }
.logo-sm em { color: var(--primary); font-style: normal; }
.header-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-sep { width: 1px; height: 16px; background: rgba(129,140,163,.5); flex-shrink: 0; }
.header-right .btn-ghost { border: none; }
.header-right .btn-secondary { border: none; }
.header-right .btn-secondary:hover { background: var(--primary); color: var(--white); }
.drawer-bottom .btn-secondary:hover { background: var(--primary); color: var(--white); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); font-weight: 500; font-size: 14px; padding: 8px 18px; transition: all .2s; border: none; white-space: nowrap; font-family: inherit; }
.btn-ghost { background: none; color: var(--muted); border: 1px solid rgba(129,140,163,.22); font-size: 13px; padding: 6px 12px; }
.btn-ghost:hover { color: var(--white); border-color: var(--muted); }
.btn-secondary { background: transparent; color: var(--white); border: 1px solid rgba(238,238,245,.15); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #2B4EFF; box-shadow: 0 0 16px rgba(62,93,233,.35); }
.btn-mobile-auth { display: none; background: none; border: none; color: var(--primary); font-weight: 600; font-size: 14px; padding: 8px 4px; }
.cta-primary { background: var(--primary); color: var(--white); border: none; }
.cta-primary:hover { background: #2B4EFF; box-shadow: 0 0 28px rgba(62,93,233,.42); }
.cta-outline { background: #1B212C; color: var(--white); border: 1.5px solid #243261; }
.cta-outline:hover { background: #243261; box-shadow: 0 0 28px rgba(62,93,233,.42); }
.drawer-left .cta-outline { background: #243261; }

/* OVERLAY */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 500; opacity: 0; pointer-events: none; transition: opacity .3s; }
.overlay.on { opacity: 1; pointer-events: all; }

/* DRAWER BASE */
.drawer { position: fixed; top: 0; height: 100%; z-index: 600; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.drawer-close { background: none; border: none; color: var(--muted); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r); transition: all .2s; }
.drawer-close:hover { color: var(--white); background: var(--surface-2); }

/* LEFT DRAWER */
.drawer-left { left: 0; width: min(280px, 85vw); background: var(--surface); transform: translateX(-100%); padding: 24px; display: flex; flex-direction: column; }
.drawer-left.on { transform: translateX(0); }
.drawer-signin { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; border-radius: var(--r); font-family: inherit; }
.drawer-top-ctas { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; margin-bottom: 16px; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 500; padding: 12px 16px; border-radius: var(--r); transition: all .2s; }
.nav-links a svg { flex-shrink: 0; }
.nav-links a:hover { background: var(--surface-2); color: var(--white); }
.nav-links a.nav-active { background: var(--surface-2); color: var(--white); }
.nav-links hr { border: none; border-top: 1px solid rgba(129,140,163,.25); margin: 4px -24px; }
.nav-links hr:first-child { margin-top: 64px; }
.cta-active { background: rgba(62,93,233,.15) !important; border: 1.5px solid var(--primary) !important; color: var(--white) !important; box-shadow: none !important; }
.drawer-spacer { flex: 1; min-height: 24px; }
.drawer-bottom { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 1px solid rgba(129,140,163,.15); }
.drawer-bottom-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; font-size: 14px; font-weight: 600; border-radius: var(--r); font-family: inherit; transition: all .2s; }

/* RIGHT DRAWER */
.drawer-right { right: 0; width: 100%; background: var(--bg); transform: translateX(100%); padding: 32px 24px; display: flex; flex-direction: column; }
.drawer-right.on { transform: translateX(0); }
.drawer-right-title { font-size: 28px; font-weight: 700; color: var(--white); }
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 400px; width: 100%; margin: 0 auto; }
.btn-full { width: 100%; padding: 14px; font-size: 15px; font-weight: 600; border-radius: var(--r); font-family: inherit; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--surface-2); }

/* FOOTER */
.footer { background: var(--bg); padding: 8px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-top: 1px solid rgba(129,140,163,.1); }
.footer-logo { font-size: 20px; font-weight: 900; color: var(--white); letter-spacing: -.5px; }
.footer-logo em { color: var(--primary); font-style: normal; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 13px; transition: color .2s; }
.footer-links a:hover { color: var(--white); }
.footer-copy { color: var(--muted); font-size: 13px; }

/* AUTH STATE */
body.hixp-auth .header-auth-guest { display: none !important; }
body:not(.hixp-auth) .header-auth-user { display: none !important; }

/* AVATAR HEADER */
.header-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid rgba(129,140,163,.3); transition: border-color .2s; flex-shrink: 0; }
.header-avatar:hover { border-color: var(--primary); }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ONLINE COUNT (admin) */
.online-count { display: flex; align-items: center; gap: 5px; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #10b981; font-size: 12px; font-weight: 600; padding: 4px 9px 4px 7px; border-radius: 20px; white-space: nowrap; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; flex-shrink: 0; animation: online-pulse 2s ease-in-out infinite; }
@keyframes online-pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.8); } }

/* AUTH PANEL (drawer-right étendu) */
.drawer-right { right: 0; width: min(480px, 100vw); background: var(--surface); transform: translateX(100%); display: flex; flex-direction: column; overflow-y: auto; }
.drawer-right.on { transform: translateX(0); }
.auth-panel { padding: 24px; display: flex; flex-direction: column; flex: 1; min-height: 100vh; }
.auth-tabs { display: flex; border-bottom: 1px solid rgba(129,140,163,.15); margin-bottom: 32px; }
.auth-tab { flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s; font-family: inherit; }
.auth-tab:hover { color: var(--white); }
.auth-tab.active { color: var(--white); border-bottom-color: var(--primary); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }
.auth-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; display: block; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-input { width: 100%; background: var(--bg); border: 1px solid rgba(129,140,163,.25); border-radius: var(--r); color: var(--white); font-family: inherit; font-size: 15px; padding: 12px 16px; outline: none; transition: border-color .2s; }
.auth-input:focus { border-color: var(--primary); }
.auth-input::placeholder { color: var(--muted); }
.auth-input.error { border-color: #f87171; }
.pwd-wrap { position: relative; }
.pwd-wrap .auth-input { padding-right: 44px; }
.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; transition: color .2s; }
.pwd-toggle:hover { color: var(--white); }
.auth-error { font-size: 12px; color: #f87171; }
.auth-btn-primary { width: 100%; padding: 14px; background: var(--primary); color: var(--white); border: none; border-radius: var(--r); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: all .2s; }
.auth-btn-primary:hover { background: #2B4EFF; box-shadow: 0 0 16px rgba(62,93,233,.35); }
.auth-social-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; background: var(--surface-2); border: 1px solid rgba(129,140,163,.2); border-radius: var(--r); color: var(--white); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit; }
.auth-social-btn:hover { border-color: var(--muted); }
.auth-social-btn.discord { color: #5865F2; border-color: rgba(88,101,242,.3); }
.auth-social-btn.discord:hover { border-color: #5865F2; background: rgba(88,101,242,.08); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(129,140,163,.2); }
.auth-link { font-size: 13px; color: var(--muted); text-align: center; }
.auth-link a, .auth-link button { color: var(--primary); background: none; border: none; font-family: inherit; font-size: inherit; cursor: pointer; padding: 0; }
.auth-link a:hover, .auth-link button:hover { text-decoration: underline; }
.auth-forgot-link { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit; text-align: right; padding: 0; }
.auth-forgot-link:hover { color: var(--white); }
.auth-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); border-radius: var(--r); padding: 12px 16px; color: #10b981; font-size: 14px; text-align: center; }
.forgot-panel { display: none; flex-direction: column; gap: 20px; }
.forgot-panel.active { display: flex; }
.forgot-back { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; padding: 0; }
.forgot-back:hover { color: var(--white); }

/* STANDALONE AUTH PAGE */
.auth-page { min-height: calc(100svh - var(--hh)); display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; z-index: 1; }
.auth-card { background: var(--surface); border-radius: 12px; padding: 40px; width: 100%; max-width: 440px; }
.auth-card .auth-tabs { margin-left: -40px; margin-right: -40px; padding: 0 40px; }

/* PROFIL */
.profile-page { min-height: calc(100svh - var(--hh)); display: grid; grid-template-columns: 30% 70%; position: relative; z-index: 1; }
.profile-nav { background: var(--surface); border-right: 1px solid rgba(129,140,163,.1); padding: 32px 0; display: flex; flex-direction: column; position: sticky; top: var(--hh); height: calc(100svh - var(--hh)); overflow-y: auto; }
.profile-nav__header { padding: 0 24px 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; border-bottom: 1px solid rgba(129,140,163,.1); margin-bottom: 16px; }
.profile-nav__avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(129,140,163,.3); }
.profile-nav__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-nav__pseudo { font-size: 16px; font-weight: 700; color: var(--white); }
.profile-nav__email { font-size: 13px; color: var(--muted); }
.profile-nav__links { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.profile-nav__item { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 500; padding: 12px 16px; border-radius: var(--r); border-left: 3px solid transparent; cursor: pointer; background: none; border-right: none; border-top: none; border-bottom: none; font-family: inherit; width: 100%; text-align: left; transition: all .2s; }
.profile-nav__item:hover { background: rgba(129,140,163,.08); color: var(--white); }
.profile-nav__item.active { background: rgba(62,93,233,.1); color: var(--white); border-left-color: var(--primary); }
.profile-nav__item.danger { color: var(--muted); margin-top: auto; }
.profile-nav__item.danger:hover { color: #f87171; background: rgba(248,113,113,.08); }
.profile-nav__spacer { flex: 1; min-height: 16px; }
.profile-content { padding: 40px; overflow-y: auto; }
.profile-section { display: none; flex-direction: column; gap: 32px; }
.profile-section.active { display: flex; }
.profile-section__title { font-size: 22px; font-weight: 800; color: var(--white); margin: 0; }
.profile-section__subtitle { font-size: 14px; color: var(--muted); margin-top: -20px; }
.profile-form { display: flex; flex-direction: column; gap: 20px; max-width: 480px; }
.profile-input { width: 100%; background: var(--surface-2); border: 1px solid rgba(129,140,163,.2); border-radius: var(--r); color: var(--white); font-family: inherit; font-size: 15px; padding: 12px 16px; outline: none; transition: border-color .2s; }
.profile-input:focus { border-color: var(--primary); }
.profile-input::placeholder { color: var(--muted); }
.profile-label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.profile-field { display: flex; flex-direction: column; }
.profile-avatar-wrap { display: flex; align-items: center; gap: 20px; }
.profile-avatar-big { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(129,140,163,.3); flex-shrink: 0; }
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-btn-save { background: var(--primary); color: var(--white); border: none; border-radius: var(--r); font-family: inherit; font-size: 15px; font-weight: 700; padding: 12px 28px; cursor: pointer; transition: all .2s; align-self: flex-start; }
.profile-btn-save:hover { background: #2B4EFF; box-shadow: 0 0 16px rgba(62,93,233,.35); }
.profile-btn-danger { background: none; border: 1px solid rgba(248,113,113,.3); color: var(--muted); border-radius: var(--r); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; cursor: pointer; transition: all .2s; align-self: flex-start; }
.profile-btn-danger:hover { border-color: #f87171; color: #f87171; }
.profile-btn-gold { background: var(--gold); color: #0C0F15; border: none; border-radius: var(--r); font-family: inherit; font-size: 15px; font-weight: 700; padding: 12px 28px; cursor: pointer; transition: all .2s; align-self: flex-start; }
.profile-btn-gold:hover { background: #f5b800; box-shadow: 0 0 16px rgba(240,165,0,.4); }
.profile-card { background: var(--surface); border: 1px solid rgba(129,140,163,.15); border-radius: var(--r); padding: 20px 24px; }
.profile-plan-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(240,165,0,.12); border: 1px solid rgba(240,165,0,.3); color: var(--gold); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 100px; }
.profile-counter { font-size: 32px; font-weight: 800; color: var(--white); }
.profile-counter span { font-size: 16px; color: var(--muted); font-weight: 500; }
.profile-perk { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 4px 0; }
.profile-perk::before { content: '✓'; color: var(--gold); font-weight: 700; flex-shrink: 0; }
.profile-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(129,140,163,.1); }
.profile-toggle:last-child { border-bottom: none; }
.profile-toggle__label { font-size: 15px; color: var(--white); }
.profile-toggle__sub { font-size: 13px; color: var(--muted); }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch__slider { position: absolute; inset: 0; background: rgba(129,140,163,.3); border-radius: 100px; cursor: pointer; transition: .2s; }
.toggle-switch__slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .toggle-switch__slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-switch__slider::before { transform: translateX(20px); }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.avatar-option { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: border-color .2s; }
.avatar-option:hover, .avatar-option.selected { border-color: var(--primary); }
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.profile-select { background: var(--surface-2); border: 1px solid rgba(129,140,163,.2); border-radius: var(--r); color: var(--white); font-family: inherit; font-size: 15px; padding: 10px 14px; outline: none; cursor: pointer; }
.coming-soon { text-align: center; padding: 60px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.coming-soon__icon { font-size: 48px; }
.coming-soon__title { font-size: 20px; font-weight: 700; color: var(--white); }
.coming-soon__sub { font-size: 15px; color: var(--muted); max-width: 360px; line-height: 1.6; }
.confirm-box { background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.2); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 440px; }
.confirm-box p { font-size: 15px; color: var(--white); }

/* RESPONSIVE PROFIL */
@media (max-width: 768px) {
  .profile-page { grid-template-columns: 1fr; }
  .profile-nav { position: static; height: auto; }
  .profile-content { padding: 24px 16px; }
  .auth-card { padding: 24px; }
  .auth-card .auth-tabs { margin-left: -24px; margin-right: -24px; padding: 0 24px; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .logo { display: none; }
  .logo-sm { display: block; }
  .header-right .btn-ghost,
  .header-right .btn-secondary,
  .header-right .btn-primary { display: none; }
  .btn-mobile-auth { display: block; }
  .footer { flex-direction: column; align-items: center; text-align: center; padding: 32px 16px; gap: 16px; }
  .footer-links { justify-content: center; gap: 12px 20px; }
}
