/* Auth UI styles — nav account menu, modal, account page bits. */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  background: transparent;
  color: var(--fg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--fg-mute);
}

.nav-right .btn-primary {
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Highlighted sign-in CTA — brand accent. */
.nav-right .btn-accent {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}
.nav-right .btn-accent:hover {
  background: var(--accent);
  filter: brightness(0.94);
}

.account-menu {
  position: relative;
}
.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--fg-mute);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.account-menu-trigger:hover {
  border-color: var(--fg-soft);
}
.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
}
.account-menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--fg-mute);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 6px;
  z-index: 60;
}
.account-menu-pop .menu-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--fg-mute);
  margin-bottom: 4px;
}
.account-menu-pop .menu-header b {
  display: block;
  font-size: 14px;
  color: var(--fg);
}
.account-menu-pop .menu-header span {
  font-size: 12px;
  color: var(--fg-soft);
  font-family: "JetBrains Mono", monospace;
}
.account-menu-pop .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
}
/* Hover background was --fg-mute which is too dark in light mode against
   dark text. Use a soft tint of the foreground so contrast stays high in
   both themes. */
.account-menu-pop .menu-item:hover {
  background: color-mix(in oklab, var(--fg) 8%, transparent);
  color: var(--fg);
}
.account-menu-pop .menu-item.admin {
  color: var(--accent);
}
.account-menu-pop .menu-item.admin:hover {
  color: var(--accent);
}
.account-menu-pop .menu-sep {
  height: 1px;
  background: var(--fg-mute);
  margin: 4px 0;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.auth-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--fg-mute);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}
.auth-modal h2 {
  font-family: "Newsreader", serif;
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 4px;
}
.auth-modal .auth-sub {
  color: var(--fg-soft);
  font-size: 14px;
  margin: 0 0 20px;
}
.auth-modal label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  margin: 14px 0 6px;
  font-family: "JetBrains Mono", monospace;
}
.auth-modal input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--fg-mute);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}
.auth-modal input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-error {
  margin-top: 14px;
  font-size: 13px;
  color: #b3261e;
  background: color-mix(in oklab, #b3261e 10%, transparent);
  padding: 8px 10px;
  border-radius: 8px;
}
.auth-modal .auth-cta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.auth-modal .auth-cta .btn-primary {
  flex: 1;
}
.auth-modal .auth-switch {
  font-size: 13px;
  color: var(--fg-soft);
  margin-top: 16px;
  text-align: center;
}
.auth-modal .auth-switch button {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.auth-modal .auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 20px;
  color: var(--fg-soft);
  cursor: pointer;
  line-height: 1;
}
.auth-turnstile {
  margin-top: 16px;
  min-height: 65px;
}
.auth-modal-wrap {
  position: relative;
}

.account-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 24px;
}
.account-page h1 {
  font-family: "Newsreader", serif;
  font-weight: 500;
  font-size: 40px;
  margin: 0 0 8px;
}
.account-page .acct-block {
  border-top: 1px solid var(--fg-mute);
  padding: 24px 0;
}
.account-page .acct-block h2 {
  font-family: "Newsreader", serif;
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 12px;
}
.account-page label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  margin: 12px 0 6px;
  font-family: "JetBrains Mono", monospace;
}
.account-page input,
.account-page textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--fg-mute);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}
.account-page textarea {
  min-height: 80px;
  resize: vertical;
}
.account-page .acct-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.account-page .acct-status {
  font-size: 13px;
  color: var(--fg-soft);
}
.account-page .acct-status.ok {
  color: #1d6b3a;
}
.account-page .acct-status.err {
  color: #b3261e;
}

@media (max-width: 640px) {
  .nav-right .btn-ghost {
    display: none;
  } /* on mobile show just the highlighted Přihlásit, hide Registrovat */

  /* Modal: align to top so the on-screen keyboard doesn't clip it; tighter padding. */
  .auth-overlay {
    align-items: flex-start;
    padding: 16px 12px;
    overflow-y: auto;
  }
  .auth-modal {
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
  }
  .auth-modal input {
    font-size: 16px;
    padding: 12px 14px;
  } /* >=16px avoids iOS zoom; taller touch target */

  /* Account page: smaller heading + tighter vertical rhythm. */
  .account-page {
    padding: 32px 16px;
  }
  .account-page h1 {
    font-size: clamp(28px, 6vw, 40px);
  }
  .account-page input,
  .account-page textarea {
    font-size: 16px;
    padding: 12px 14px;
  }
  .account-page .acct-actions {
    flex-wrap: wrap;
  }
}
