/* =====================================================
   ASTI — Professional Account / Login Menu
   Add to page.css or asti-style2.css
   ===================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.login-btn,
.register-btn,
.account-trigger {
  min-height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    background-color .22s ease,
    border-color .22s ease;
}

.login-btn {
  background: var(--g, #1b4332);
  color: #fff;
  border: 1px solid var(--g, #1b4332);
  box-shadow: 0 7px 18px rgba(27, 67, 50, .18);
}

.login-btn:hover,
.login-btn:focus-visible {
  color: #fff;
  background: #123728;
  transform: translateY(-2px);
  box-shadow: 0 11px 24px rgba(27, 67, 50, .26);
}

.register-btn {
  color: var(--g, #1b4332);
  background: #fff;
  border: 1px solid rgba(27, 67, 50, .25);
}

.register-btn:hover,
.register-btn:focus-visible {
  color: var(--g, #1b4332);
  background: #f4f8f5;
  border-color: var(--g, #1b4332);
  transform: translateY(-2px);
}

.account-menu {
  position: relative;
}

.account-trigger {
  border: 1px solid rgba(27, 67, 50, .18);
  background: #fff;
  color: var(--g, #1b4332);
  box-shadow: 0 7px 22px rgba(20, 47, 37, .12);
}

.account-trigger:hover,
.account-trigger:focus-visible,
.account-menu.is-open .account-trigger {
  border-color: rgba(201, 162, 39, .75);
  box-shadow: 0 11px 28px rgba(20, 47, 37, .17);
  transform: translateY(-1px);
}

.account-trigger__avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--g, #1b4332), #2d6a4f);
  box-shadow: 0 4px 12px rgba(27, 67, 50, .2);
}

.account-trigger__arrow {
  font-size: 11px;
  transition: transform .22s ease;
}

.account-menu.is-open .account-trigger__arrow {
  transform: rotate(180deg);
}

.account-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 12px);
  width: min(290px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(27, 67, 50, .12);
  border-radius: 17px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 60px rgba(14, 39, 29, .2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  z-index: 2500;
}

.account-menu.is-open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.account-dropdown::before {
  content: "";
  position: absolute;
  inset-inline-end: 27px;
  top: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-inline-start: 1px solid rgba(27, 67, 50, .12);
  border-top: 1px solid rgba(27, 67, 50, .12);
  transform: rotate(45deg);
}

.account-dropdown__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  margin-bottom: 6px;
  border-radius: 13px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(201, 162, 39, .35), transparent 35%),
    linear-gradient(135deg, #173f30, #245c45);
}

.account-dropdown__icon {
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #173f30;
  background: #fff;
}

.account-dropdown__head strong,
.account-dropdown__head small {
  display: block;
}

.account-dropdown__head small {
  margin-top: 2px;
  opacity: .8;
  font-size: 11px;
}

.account-dropdown__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  color: #183e30;
  text-decoration: none;
  font-weight: 700;
  transition: background-color .18s ease, transform .18s ease, color .18s ease;
}

.account-dropdown__link i {
  width: 21px;
  text-align: center;
  color: #8c711b;
}

.account-dropdown__link:hover,
.account-dropdown__link:focus-visible {
  color: #173f30;
  background: #f1f7f3;
  transform: translateX(-3px);
}

html[dir="ltr"] .account-dropdown__link:hover,
html[dir="ltr"] .account-dropdown__link:focus-visible {
  transform: translateX(3px);
}

.account-dropdown__divider {
  height: 1px;
  margin: 7px 5px;
  background: rgba(27, 67, 50, .11);
}

.account-dropdown__link--logout {
  color: #a72c2c;
}

.account-dropdown__link--logout i {
  color: #a72c2c;
}

.account-dropdown__link--logout:hover {
  color: #8d2020;
  background: #fff2f2;
}

.mob-link i {
  width: 22px;
  text-align: center;
}

.mob-link--logout {
  color: #a72c2c !important;
}

.mob-link--register {
  border: 1px solid rgba(27, 67, 50, .25);
  background: #fff;
  color: var(--g, #1b4332) !important;
}

/* Dark mode */
body.dark-mode .account-trigger,
body.dark-mode .account-dropdown,
html.dark .account-trigger,
html.dark .account-dropdown {
  color: #f3f7f4;
  background: #183428;
  border-color: rgba(255, 255, 255, .12);
}

body.dark-mode .account-dropdown::before,
html.dark .account-dropdown::before {
  background: #183428;
  border-color: rgba(255, 255, 255, .12);
}

body.dark-mode .account-dropdown__link,
html.dark .account-dropdown__link {
  color: #edf5f0;
}

body.dark-mode .account-dropdown__link:hover,
html.dark .account-dropdown__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

body.dark-mode .register-btn,
html.dark .register-btn {
  color: #eef6f1;
  background: #1b392d;
  border-color: rgba(255, 255, 255, .14);
}

@media (max-width: 1100px) {
  .register-btn {
    display: none;
  }

  .account-trigger__text {
    display: none;
  }

  .account-trigger {
    width: 46px;
    height: 46px;
    padding: 6px;
    border-radius: 50%;
  }

  .account-trigger__arrow {
    display: none;
  }
}

@media (max-width: 768px) {
  .guest-actions {
    gap: 6px;
  }

  .login-btn {
    width: 45px;
    height: 45px;
    min-height: 45px;
    padding: 0;
    border-radius: 50%;
  }

  .login-btn span {
    display: none;
  }

  .account-menu {
    display: none;
  }

  .account-dropdown {
    position: fixed;
    top: 82px;
    inset-inline: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-btn,
  .register-btn,
  .account-trigger,
  .account-dropdown,
  .account-dropdown__link,
  .account-trigger__arrow {
    transition: none;
  }
}
