.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
}

.auth-modal.is-open {
  display: block;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 20, 0.7);
  backdrop-filter: blur(10px);
}

.auth-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(100% - 24px, 580px);
  margin: 7vh auto 0;
  padding: 28px;
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-modal__content {
  display: grid;
  gap: 12px;
}

.auth-modal__badge {
  width: fit-content;
}

.auth-modal__title {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
}

.auth-modal__text {
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 48ch;
}

.auth-form {
  margin-top: 8px;
  display: grid;
  gap: 14px;
}

.auth-form__grid {
  display: grid;
  gap: 14px;
}

.auth-form__grid--2 {
  grid-template-columns: 1fr 1fr;
}

.auth-form__group {
  display: grid;
  gap: 8px;
}

.auth-form__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

.auth-form__submit {
  width: 100%;
  margin-top: 4px;
}

.auth-form__meta {
  font-size: 13px;
  line-height: 1.6;
}

.auth-alert {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.auth-alert--error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.28);
}

.auth-alert--success {
  color: #dcfce7;
  background: rgba(20, 83, 45, 0.24);
  border-color: rgba(74, 222, 128, 0.28);
}

html[data-theme="light"] .auth-alert--error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

html[data-theme="light"] .auth-alert--success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

@media (max-width: 640px) {
  .auth-modal__dialog {
    width: min(100% - 16px, 580px);
    margin-top: 16px;
    padding: 22px;
  }

  .auth-form__grid--2 {
    grid-template-columns: 1fr;
  }

  .auth-modal__title {
    font-size: 24px;
  }
}

.account-menu {
  position: relative;
}

.account-menu__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 14px;
  border-radius: 18px;
  z-index: 150;
}

.account-menu__dropdown[hidden] {
  display: none;
}

.account-menu__header {
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}

html[data-theme="light"] .account-menu__header {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.account-menu__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.account-menu__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.account-menu__links {
  display: grid;
  gap: 6px;
}

.account-menu__link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.account-menu__link:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

html[data-theme="light"] .account-menu__link:hover {
  background: rgba(15, 23, 42, 0.05);
}

.account-menu__link--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.account-menu__actions {
  display: grid;
  gap: 10px;
}

.account-menu__button {
  width: 100%;
}

.account-menu__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 14px;
  border-radius: 18px;
  z-index: 150;

  /* FIX */
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: none; /* remove glass effect */
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

html[data-theme="light"] .account-menu__dropdown {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}