/**
 * Меню аккаунта «Войти» (components/header_account_menu.html): шапка заданий /ege-{n}/ и курс Calc.
 */

.hf-task-account-menu {
  position: relative;
  flex-shrink: 0;
}

.hf-task-account-menu__trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  max-width: min(11rem, 100%);
  padding: 0.28rem 0.55rem 0.28rem 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(5, 184, 125, 0.38);
  background: linear-gradient(
    165deg,
    rgba(5, 184, 125, 0.16) 0%,
    rgba(15, 23, 42, 0.72) 100%
  );
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

a.hf-task-account-menu__trigger--link {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.hf-task-account-menu__trigger::-webkit-details-marker {
  display: none;
}

.hf-task-account-menu__trigger:hover,
.hf-task-account-menu[open] .hf-task-account-menu__trigger {
  border-color: rgba(52, 211, 153, 0.62);
  box-shadow:
    0 6px 20px rgba(5, 184, 125, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .hf-task-account-menu__trigger {
  border-color: rgba(5, 150, 105, 0.32);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(236, 253, 245, 0.92) 100%
  );
  box-shadow:
    0 4px 14px rgba(26, 36, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.hf-task-account-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ecfdf5;
  background: linear-gradient(145deg, rgba(5, 184, 125, 0.85) 0%, rgba(16, 185, 129, 0.55) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .hf-task-account-menu__avatar {
  color: #064e3b;
  background: linear-gradient(145deg, rgba(110, 231, 183, 0.95) 0%, rgba(5, 184, 125, 0.75) 100%);
}

.hf-task-account-menu__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(246, 252, 250, 0.96);
}

[data-theme="light"] .hf-task-account-menu__name {
  color: rgba(14, 24, 33, 0.92);
}

.hf-task-account-menu__chevron {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.08rem;
  border-right: 2px solid rgba(110, 231, 183, 0.9);
  border-bottom: 2px solid rgba(110, 231, 183, 0.9);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease;
}

.hf-task-account-menu[open] .hf-task-account-menu__chevron {
  transform: rotate(225deg) translateY(1px);
}

.hf-task-account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 13.5rem;
  padding: 0.42rem;
  border-radius: 12px;
  border: 1px solid rgba(5, 184, 125, 0.32);
  background: linear-gradient(175deg, rgba(22, 28, 34, 0.98) 0%, rgba(15, 19, 24, 0.99) 100%);
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.hf-task-account-menu__theme {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  padding: 0.28rem 0.2rem 0.4rem;
}

.hf-task-account-menu__theme-label {
  padding: 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(148, 163, 184, 0.9));
}

.hf-task-account-menu__theme .theme-cycle-toggle {
  --theme-toggle-seg: calc((100% - 0.36rem) / 4);
  width: 100%;
  margin: 0;
}

.hf-task-account-menu__theme .theme-cycle-toggle__option {
  width: auto;
  min-height: 2.4rem;
  padding: 0.22rem 0.12rem 0.18rem;
}

.hf-task-account-menu__theme .theme-cycle-toggle__label {
  font-size: 0.58rem;
  line-height: 1.1;
}

/* Панель меню «Войти»: шапка/toolbar с overflow обрезали absolute — JS ставит fixed. */
.hf-task-header-toolbar:has(.hf-task-account-menu[open]) {
  overflow: visible;
}

[data-theme="light"] .hf-task-account-menu__panel {
  border-color: rgba(5, 150, 105, 0.24);
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 252, 250, 0.98) 100%);
  box-shadow: 0 14px 36px rgba(26, 36, 48, 0.12);
}

.hf-task-account-menu__link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.48rem 0.62rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: rgba(236, 245, 242, 0.92);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.hf-task-account-menu__link:hover,
.hf-task-account-menu__link:focus-visible {
  color: #ecfdf5;
  border-color: rgba(5, 184, 125, 0.35);
  background: rgba(5, 184, 125, 0.12);
  outline: none;
}

[data-theme="light"] .hf-task-account-menu__link {
  color: rgba(25, 35, 46, 0.88);
}

[data-theme="light"] .hf-task-account-menu__link:hover,
[data-theme="light"] .hf-task-account-menu__link:focus-visible {
  color: #047857;
  background: rgba(5, 184, 125, 0.1);
}

.hf-task-account-menu__link--accent {
  color: rgba(110, 231, 183, 0.98);
}

.hf-task-account-menu__hint {
  margin: 0 0.35rem 0.45rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(148, 163, 184, 0.95);
}

.hf-task-account-menu__link--muted {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.92);
}

.hf-task-account-menu__link--muted:hover,
.hf-task-account-menu__link--muted:focus-visible {
  color: rgba(236, 245, 242, 0.96);
}

[data-theme="light"] .hf-task-account-menu__link--muted {
  color: rgba(71, 85, 105, 0.88);
}

.hf-task-account-menu__link--button {
  appearance: none;
}

.hf-task-account-menu__divider {
  height: 1px;
  margin: 0.12rem 0.2rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(5, 184, 125, 0.35) 50%,
    transparent 100%
  );
}
