/* Forum top bar: navigation + login dropdown.
   New class names on purpose: the legacy #top-bar/.loginBox/.bt-login rules and the
   toggle handlers in global.js do not touch these. */
.forum-nav {
  position: sticky;
  top: 0;
  /* the legacy forum body is wider than a phone screen: keep the bar the width of the
     screen (and pinned left) so the login button never ends up off-screen */
  left: 0;
  width: 100vw;
  max-width: 100%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 16px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, #2b3437, #171d1f);
  border-bottom: 1px solid #5d6664;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  font-family: Arial, Helvetica, sans-serif;
}

.forum-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.forum-nav__links a {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 12px;
  box-sizing: border-box;
  color: #e8ecec;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.forum-nav__links a i {
  width: 14px;
  text-align: center;
  color: #c9a227;
  font-size: 13px;
}

.forum-nav__links a:hover,
.forum-nav__links a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-bottom-color: #c9a227;
  outline: none;
}

.forum-nav__side {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.forum-nav__welcome {
  color: #e8ecec;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

.forum-nav__logout {
  margin: 0;
}

/* login dropdown: same dark stone as the bar, gold accents like .ui-btn--gold */
.forum-login {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 310px;
  max-width: calc(100vw - 16px);
  padding: 18px;
  box-sizing: border-box;
  border: 1px solid #5d6664;
  border-top: 2px solid #c9a227;
  border-radius: 8px;
  background: linear-gradient(to bottom, #2b3437, #1b2224);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
  color: #e8ecec;
  animation: forum-login-in 0.14s ease-out;
}

/* caret pointing at the Log in button */
.forum-login::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 34px;
  width: 12px;
  height: 12px;
  background: #2b3437;
  border-top: 2px solid #c9a227;
  border-left: 2px solid #c9a227;
  transform: rotate(45deg);
}

@keyframes forum-login-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.forum-login[hidden] {
  display: none;
}

.forum-login__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.forum-login__badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #f0dc92;
  border-radius: 50%;
  background: linear-gradient(to bottom, #d9b13a, #9a7714);
  color: #2a2005;
  font-size: 16px;
}

.forum-login__title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

.forum-login__sub {
  margin: 2px 0 0;
  color: #9aa4a3;
  font-size: 12px;
}

.forum-login__field {
  margin: 0 0 12px;
}

.forum-login__field label {
  display: block;
  margin: 0 0 6px;
  color: #c9d0cf;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.forum-login__control {
  position: relative;
}

.forum-login__control > i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #8a9392;
  font-size: 13px;
  pointer-events: none;
  transition: color 0.15s ease;
}

.forum-login__control:focus-within > i {
  color: #c9a227;
}

.forum-login__control input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 40px 0 36px;
  box-sizing: border-box;
  border: 1px solid #4a5452;
  border-radius: 6px;
  background: #11171a;
  color: #f2f4f3;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forum-login__control input:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.forum-login__reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: none;
  border-radius: 4px;
  background: none;
  color: #8a9392;
  font-size: 13px;
  cursor: pointer;
}

.forum-login__reveal:hover,
.forum-login__reveal[aria-pressed="true"] {
  color: #e8ecec;
}

.forum-login__reveal:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: -2px;
}

.forum-login__caps {
  margin: -4px 0 12px;
  color: #f0c24b;
  font-size: 12px;
}

.forum-login__caps[hidden] {
  display: none;
}

.forum-login form .ui-btn {
  margin-top: 4px;
}

.forum-login__links {
  margin: 12px 0 0;
  font-size: 12px;
  text-align: center;
}

.forum-login a {
  color: #e2c35a;
  text-decoration: none;
}

.forum-login a:hover {
  color: #f5dc85;
  text-decoration: underline;
}

.forum-login__signup {
  margin: 14px -18px -18px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 8px 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #9aa4a3;
  font-size: 12px;
  text-align: center;
}

.forum-login__signup a {
  font-weight: bold;
}

@media (max-width: 760px) {
  .forum-nav {
    flex-wrap: wrap;
    padding: 0 8px;
  }

  .forum-nav__links {
    flex-wrap: wrap;
  }

  .forum-nav__links a {
    height: 40px;
    padding: 0 8px;
  }

  .forum-nav__links a span {
    display: none;
  }
}
