.user-menu { position: relative; min-width: 0; }
.user-button { max-width: 220px; gap: 8px; cursor: pointer; }
.user-menu-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); transition: transform .2s ease, color .2s ease; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); color: var(--text); }
.user-dropdown { position: absolute; z-index: 80; top: calc(100% + 10px); right: 0; width: 205px; padding: 7px; border: 1px solid var(--border); border-radius: 14px; background: rgba(10, 11, 2, .98); box-shadow: 0 20px 50px rgba(0,0,0,.42); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .16s ease, visibility .16s ease, transform .16s ease; }
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
.user-dropdown-item { width: 100%; min-height: 42px; display: flex; align-items: center; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-strong); font: inherit; font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; transition: color .16s ease, background .16s ease; }
.user-dropdown-item:hover, .user-dropdown-item:focus-visible { color: var(--text); background: rgba(255,255,255,.055); outline: none; }
.user-dropdown-separator { height: 1px; margin: 5px 7px; background: var(--border); }
.user-dropdown-form { margin: 0; }
.user-dropdown-logout { color: #fca5a5; }
.user-dropdown-logout:hover, .user-dropdown-logout:focus-visible { color: #fecaca; background: rgba(248,113,113,.08); }

.auth-page, .account-page { position: relative; z-index: 1; min-height: 100vh; padding: 150px 24px 90px; }
.auth-shell { width: min(1080px, 100%); margin: 0 auto; display: grid; grid-template-columns: .9fr 1.1fr; gap: 42px; align-items: center; }
.auth-shell.single { width: min(560px, 100%); grid-template-columns: 1fr; }
.auth-intro h1, .auth-card-head h1, .account-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -.045em; }
.auth-intro > p, .auth-card-head > p, .account-hero p { margin-top: 18px; color: var(--muted-strong); line-height: 1.75; }
.auth-benefits { margin-top: 30px; display: grid; gap: 13px; color: var(--muted); font-size: 14px; }
.auth-benefits span { display: flex; align-items: center; gap: 10px; }
.auth-benefits span::first-letter { color: var(--accent); }

.auth-card, .account-card, .account-hero, .stat-card { border: 1px solid var(--border); background: rgba(8, 9, 1, .78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.auth-card { padding: 34px; border-radius: 26px; }
.login-card { padding: 40px; }
.auth-card-head { margin-bottom: 26px; }
.auth-card-head h2, .account-card-head h2 { font-size: 1.7rem; letter-spacing: -.035em; }
.auth-card-head p, .account-card-head p { margin-top: 8px; color: var(--muted); line-height: 1.65; }

.auth-form { display: grid; gap: 17px; }
.auth-form label { display: grid; gap: 8px; }
.auth-form label > span { color: var(--muted-strong); font-size: 13px; font-weight: 650; }
.auth-form input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid var(--border); border-radius: 12px; outline: none; background: rgba(255,255,255,.025); color: var(--text); font: inherit; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.auth-form input::placeholder { color: #727768; }
.auth-form input:focus { border-color: rgba(240,254,9,.55); background: rgba(240,254,9,.025); box-shadow: 0 0 0 4px rgba(240,254,9,.07); }
.auth-submit { height: 52px; margin-top: 4px; border: 1px solid rgba(240,254,9,.62); border-radius: 12px; background: linear-gradient(180deg, rgba(240,254,9,.96), rgba(240,254,9,.84)); color: #090b00; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(240,254,9,.14); transition: transform .2s ease, box-shadow .2s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 36px rgba(240,254,9,.2); }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--accent); font-weight: 700; }

.alert { width: min(1080px, 100%); margin: 0 auto 20px; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.auth-card .alert { margin-bottom: 20px; }
.alert p + p { margin-top: 4px; }
.alert.error { border: 1px solid rgba(248,113,113,.28); background: rgba(127,29,29,.18); color: #fecaca; }
.alert.success { border: 1px solid rgba(240,254,9,.25); background: rgba(240,254,9,.08); color: #f6ff9a; }

.account-page { padding-top: 138px; }
.account-shell { width: min(1160px, 100%); margin: 0 auto; }

.account-hero { position: relative; min-height: 178px; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px 38px; border: 1px solid rgba(240,254,9,.13); border-radius: 26px; background: linear-gradient(112deg, rgba(17,18,5,.96), rgba(8,9,1,.8)); box-shadow: 0 24px 70px rgba(0,0,0,.26); }
.account-hero::before { content: ''; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(240,254,9,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(240,254,9,.06) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(90deg, #000, transparent 72%); pointer-events: none; }
.account-hero-glow { position: absolute; width: 330px; height: 220px; left: -80px; top: -120px; border-radius: 50%; background: rgba(240,254,9,.16); filter: blur(70px); pointer-events: none; }
.account-identity { position: relative; z-index: 1; min-width: 0; display: flex; align-items: center; gap: 22px; }
.avatar { width: 92px; height: 92px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(240,254,9,.36); border-radius: 26px; background: linear-gradient(145deg, rgba(240,254,9,.16), rgba(240,254,9,.035)); color: var(--accent); font-size: 2.35rem; font-weight: 800; box-shadow: 0 18px 45px rgba(0,0,0,.32), inset 0 0 30px rgba(240,254,9,.05); }
.avatar.has-image { padding: 0; background: #111; }
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; }
.account-identity-copy { min-width: 0; }
.account-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #b9bea9; font-size: 12px; font-weight: 700; letter-spacing: .025em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #65d977; box-shadow: 0 0 12px rgba(101,217,119,.55); }
.account-hero h1 { overflow: hidden; margin: 0; color: var(--text); font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1; letter-spacing: -.045em; text-overflow: ellipsis; }
.account-hero p { margin-top: 11px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.role-pill { position: relative; z-index: 1; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.045); color: var(--muted-strong); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.role-pill.creator { border-color: rgba(240,254,9,.32); background: rgba(240,254,9,.085); color: #f4fd6b; box-shadow: inset 0 0 20px rgba(240,254,9,.035); }
.account-page .alert { width: 100%; margin: 18px 0 0; }

.account-layout { margin-top: 24px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-sidebar { position: sticky; top: 112px; padding: 8px 0; }
.profile-nav { display: grid; gap: 4px; }
.profile-nav a { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 650; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.profile-nav a:hover { color: var(--text); background: rgba(255,255,255,.025); transform: translateX(2px); }
.profile-nav a.active { border-color: rgba(240,254,9,.13); background: rgba(240,254,9,.055); color: var(--text); }
.profile-nav svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.profile-nav a:nth-child(2) svg { fill: currentColor; stroke: none; }
.profile-nav .admin-nav-link { margin-top: 9px; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; color: #e9f05c; }
.profile-nav .admin-nav-link i { margin-left: auto; font-style: normal; font-size: 15px; }
.account-meta { margin: 24px 14px 0; padding-top: 19px; border-top: 1px solid var(--border); }
.account-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.account-meta dt { color: var(--muted); font-size: 11px; }
.account-meta dd { overflow: hidden; margin: 0; color: var(--muted-strong); font-size: 11px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.account-meta dd.connected { color: #9ce7a7; }

.account-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: rgba(8,9,1,.76); box-shadow: 0 24px 70px rgba(0,0,0,.23); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.account-section { position: relative; padding: 34px 38px 38px; scroll-margin-top: 120px; }
.account-section + .account-section { border-top: 1px solid var(--border); }
.account-section-head { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 26px; }
.section-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(240,254,9,.14); border-radius: 13px; background: rgba(240,254,9,.045); color: #e9f05c; }
.section-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.section-icon.discord-icon svg { fill: currentColor; stroke: none; }
.section-kicker { display: block; margin: 1px 0 4px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.account-section-head h2 { margin: 0; color: var(--text); font-size: 1.4rem; letter-spacing: -.025em; }
.account-section-head p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.account-form { gap: 20px; }
.account-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.password-fields { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 14px; }
.account-form input { height: 48px; border-color: rgba(255,255,255,.085); background: rgba(255,255,255,.018); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 2px; }
.form-actions > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-actions .auth-submit { width: auto; min-width: 128px; height: 46px; margin: 0; padding: 0 20px; border-radius: 11px; font-size: 13px; }

.discord-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.075); border-radius: 16px; background: rgba(255,255,255,.018); }
.discord-row.unlinked { align-items: stretch; }
.discord-profile { min-width: 0; display: flex; align-items: center; gap: 14px; }
.discord-avatar { width: 54px; height: 54px; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(240,254,9,.2); border-radius: 16px; background: rgba(240,254,9,.07); color: var(--accent); font-size: 1.15rem; font-weight: 800; }
.discord-avatar img { width: 100%; height: 100%; object-fit: cover; }
.discord-profile > div:last-child { min-width: 0; display: grid; gap: 3px; }
.discord-name-line { display: flex; align-items: center; gap: 9px; }
.discord-profile strong, .discord-profile span, .discord-profile code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-profile span { color: var(--muted); font-size: 12px; }
.discord-profile code { color: #8f9485; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.linked-badge { display: inline-flex !important; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 99px; background: rgba(34,197,94,.08); color: #9ce7a7 !important; font-size: 9px !important; font-weight: 800; text-transform: uppercase; }
.linked-badge i { width: 5px; height: 5px; border-radius: 50%; background: #65d977; }
.discord-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 13px; }
.discord-actions form { margin: 0; }
.discord-button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid rgba(240,254,9,.35); border-radius: 11px; background: rgba(240,254,9,.085); color: #f2fa64; font-size: 12px; font-weight: 800; transition: transform .18s ease, background .18s ease; }
.discord-button:hover { transform: translateY(-1px); background: rgba(240,254,9,.13); }
.danger-link { padding: 8px 0; border: 0; background: transparent; color: #e99191; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.integration-state { min-width: 0; display: flex; align-items: center; gap: 13px; }
.integration-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(240,254,9,.15); border-radius: 13px; background: rgba(240,254,9,.045); color: var(--accent); font-size: 13px; font-weight: 800; }
.integration-state strong { display: block; font-size: 13px; }
.integration-state p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.muted-state { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); }

.nav-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.footer-column > span { color: var(--muted); font-size: 13px; line-height: 1.5; opacity: .72; }

@media (max-width: 960px) {
  .account-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 18px; }
  .account-section { padding-inline: 28px; }
  .password-fields { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-page, .account-page { padding: 122px 14px 70px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { text-align: center; }
  .auth-benefits { width: fit-content; margin-inline: auto; text-align: left; }
  .account-hero { min-height: auto; align-items: flex-start; padding: 26px; }
  .avatar { width: 72px; height: 72px; border-radius: 21px; font-size: 1.8rem; }
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { position: static; padding: 0; }
  .profile-nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .profile-nav::-webkit-scrollbar { display: none; }
  .profile-nav a { min-width: max-content; padding-inline: 13px; border-color: var(--border); background: rgba(255,255,255,.018); }
  .profile-nav .admin-nav-link { margin-top: 0; border-top: 1px solid var(--border); border-radius: 12px; }
  .account-meta { display: none; }
  .account-fields { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .auth-card, .login-card { padding: 23px 20px; }
  .auth-card-head h1, .auth-intro h1 { font-size: 2.35rem; }
  .account-hero { display: grid; gap: 18px; padding: 22px 20px; border-radius: 20px; }
  .account-identity { align-items: flex-start; gap: 15px; }
  .avatar { width: 62px; height: 62px; border-radius: 18px; }
  .account-hero h1 { font-size: 1.8rem; }
  .account-hero p { margin-top: 8px; font-size: 12px; }
  .role-pill { width: fit-content; }
  .account-panel { border-radius: 19px; }
  .account-section { padding: 26px 20px 29px; }
  .account-section-head { gap: 12px; }
  .section-icon { width: 38px; height: 38px; border-radius: 11px; }
  .account-section-head h2 { font-size: 1.2rem; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .auth-submit { width: 100%; }
  .discord-row { align-items: stretch; flex-direction: column; padding: 16px; }
  .discord-actions { justify-content: space-between; }
  .discord-row.unlinked .discord-button { width: 100%; }
}

/* Menu utilisateur de la navigation */
@media (max-width: 840px) {
  .mobile-actions { grid-template-columns: 1fr; }
  .mobile-actions .user-menu { width: 100%; }
  .mobile-actions .user-button { width: 100%; max-width: none; justify-content: flex-start; }
  .mobile-actions .user-menu-chevron { margin-left: auto; }
  .mobile-actions .user-dropdown { position: static; width: 100%; margin-top: 7px; display: none; opacity: 1; visibility: visible; transform: none; pointer-events: auto; box-shadow: none; background: rgba(255,255,255,.025); }
  .mobile-actions .user-menu.open .user-dropdown { display: block; }
}
