/* Centre compte (popover + modal) — style ChatGPT / dark */

body.account-modal-open {
  overflow: hidden;
}

.profile-popover {
  width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.35rem;
  border-radius: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: #1a1f2e;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
}

.profile-popover__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: 0.65rem;
  text-align: left;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.profile-popover__head:hover {
  background: rgba(51, 65, 85, 0.45);
}

.profile-popover__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #f1f5f9;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  overflow: hidden;
}

.profile-popover__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-popover__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.profile-popover__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-popover__plan {
  font-size: 0.75rem;
  color: #94a3b8;
}

.profile-popover__chev {
  flex-shrink: 0;
  color: #64748b;
}

.profile-popover__upgrade-wrap {
  padding: 0 0.45rem 0.35rem;
}

.profile-popover__upgrade {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f8fafc;
  background: #0b0e14;
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.profile-popover__upgrade:hover {
  background: #121722;
  border-color: rgba(148, 163, 184, 0.55);
}

.profile-popover__divider {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: rgba(51, 65, 85, 0.65);
}

.profile-popover__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  color: #e2e8f0;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
}

.profile-popover__item:hover {
  background: rgba(51, 65, 85, 0.5);
}

.profile-popover__item--danger {
  color: #fda4af;
}

.profile-popover__item--danger:hover {
  background: rgba(127, 29, 29, 0.25);
}

/* Modal paramètres */
.account-modal.hidden {
  display: none !important;
}

.account-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.account-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  border: none;
  cursor: pointer;
}

.account-modal__shell {
  position: relative;
  display: flex;
  width: min(56rem, 100%);
  max-height: min(32rem, calc(100vh - 2rem));
  border-radius: 1.25rem;
  border: 1px solid rgba(51, 65, 85, 0.75);
  background: #161b28;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.account-modal__nav {
  width: 11.5rem;
  flex-shrink: 0;
  padding: 0.75rem 0.5rem;
  border-right: 1px solid rgba(51, 65, 85, 0.55);
  background: #121722;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.account-modal__close {
  align-self: flex-start;
  margin: 0.15rem 0.35rem 0.5rem;
  padding: 0.35rem;
  border: none;
  border-radius: 0.5rem;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
}

.account-modal__close:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.45);
}

.account-modal__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.account-nav-btn {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  text-align: left;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.account-nav-btn:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.4);
}

.account-nav-btn.is-active {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.65);
}

.account-modal__main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.account-modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 1.25rem;
}

.account-panel__heading {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 1rem;
}

.account-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.account-profile-avatar-wrap {
  position: relative;
}

.account-profile-avatar {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #e2e8f0;
  background: linear-gradient(145deg, #6366f1, #4338ca);
  border: 2px solid rgba(99, 102, 241, 0.45);
}

.account-profile-avatar-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0e14;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  cursor: pointer;
}

.account-profile-avatar-btn:hover {
  background: #1e293b;
}

.account-profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.account-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 24rem;
}

.account-field__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.account-field__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.9375rem;
  color: #f1f5f9;
  background: #0b0e14;
  border: 1px solid rgba(51, 65, 85, 0.85);
}

.account-field__input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
}

.account-field__input--readonly {
  color: #94a3b8;
  cursor: default;
}

.account-field-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
}

.account-panel__actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.account-panel__actions--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.account-panel__actions--stack .account-btn {
  min-width: min(100%, 18rem);
  padding: 0.65rem 1.25rem;
}

.account-field-hint--below-btn {
  margin: 0;
  max-width: 22rem;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.account-btn--primary {
  color: #0b0e14;
  background: #f8fafc;
}

.account-btn--primary:hover {
  background: #e2e8f0;
}

.account-btn--outline {
  color: #f1f5f9;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.account-btn--outline:hover {
  background: rgba(51, 65, 85, 0.45);
}

.account-btn--secondary {
  color: #e9d5ff;
  background: rgba(91, 33, 182, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.5);
}

.account-btn--secondary:hover:not(:disabled) {
  background: rgba(91, 33, 182, 0.55);
  border-color: rgba(196, 181, 253, 0.65);
}

.account-btn--secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.account-btn--with-icon {
  gap: 0.5rem;
}

.account-btn__icon {
  flex-shrink: 0;
}

.account-btn--ghost {
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(51, 65, 85, 0.65);
}

.account-btn--ghost:hover {
  color: #fda4af;
  border-color: rgba(248, 113, 113, 0.45);
}

.account-btn--danger {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.account-btn--danger:hover {
  background: rgba(127, 29, 29, 0.55);
}

.account-link-btn {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #38bdf8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.account-link-btn:hover {
  text-decoration: underline;
}

.account-billing-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(11, 14, 20, 0.55);
  margin-bottom: 0.75rem;
}

.account-billing-card__plan {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.account-billing-card__hint {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.account-billing-portal {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(30, 27, 75, 0.25);
}

.account-billing-portal__lead {
  font-size: 0.8125rem;
  color: #cbd5e1;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.account-billing-portal__list {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.55;
  list-style: disc;
}

.account-billing-portal__note {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.account-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 20rem;
}

.account-shortcut {
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  text-align: left;
  font-size: 0.875rem;
  color: #e2e8f0;
  background: rgba(11, 14, 20, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.55);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.account-shortcut:hover {
  background: rgba(51, 65, 85, 0.35);
  border-color: rgba(100, 116, 139, 0.55);
}

.account-shortcut--admin {
  color: #c4b5fd;
}

@media (max-width: 640px) {
  .account-modal__shell {
    flex-direction: column;
    max-height: calc(100vh - 1rem);
  }

  .account-modal__nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid rgba(51, 65, 85, 0.55);
    padding: 0.5rem;
  }

  .account-modal__nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
  }

  .account-nav-btn {
    flex: 1 1 auto;
    min-width: 5.5rem;
    text-align: center;
    font-size: 0.8125rem;
    padding: 0.45rem 0.5rem;
  }
}
