
#nav-auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

.auth-signin-btn {
  display: inline-block;
  text-decoration: none;
  background: #5b8dd9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.auth-signin-btn:hover { background: #4a7bc8; }

.auth-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a2a3e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 5px 12px 5px 8px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  transition: background 0.2s;
}
.auth-profile-btn:hover { background: #3a3a58; }
.auth-profile-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #2a2a3e;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.auth-profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
}
.auth-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e1e2e;
  border: 1px solid #444;
  border-radius: 10px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 9999;
  padding: 6px 0;
  display: none;
}
.auth-profile-dropdown.open { display: block; }
.auth-profile-dropdown a,
.auth-profile-dropdown button {
  display: block; width: 100%;
  padding: 9px 16px;
  background: none; border: none;
  color: #ccc; font-size: 0.9rem;
  text-align: left; cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.auth-profile-dropdown a:hover,
.auth-profile-dropdown button:hover { background: #2a2a3e; color: #fff; }
.auth-profile-dropdown .dropdown-divider {
  height: 1px; background: #333; margin: 4px 0;
}
.auth-profile-dropdown .danger-btn { color: #e05a5a; }
.auth-profile-dropdown .danger-btn:hover { background: #3a1e1e; color: #ff8080; }

.auth-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.auth-modal-overlay.visible {
  opacity: 1; pointer-events: all;
}

.auth-modal {
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 14px;
  width: 380px;
  max-width: 95vw;
  padding: 28px 30px 24px;
  position: relative;
  transform: translateY(-16px);
  transition: transform 0.2s;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.auth-modal-overlay.visible .auth-modal { transform: translateY(0); }

.auth-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: #888; font-size: 1.4rem;
  cursor: pointer; line-height: 1;
}
.auth-modal-close:hover { color: #fff; }

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 22px;
  border-bottom: 2px solid #333;
}
.auth-tab {
  flex: 1; background: none; border: none;
  color: #888; font-size: 0.97rem; font-weight: 600;
  padding: 10px 0; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active { color: #5b8dd9; border-bottom-color: #5b8dd9; }
.auth-tab:hover:not(.active) { color: #ccc; }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.auth-form label {
  font-size: 0.85rem; color: #999; margin-bottom: 2px; display: block;
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  background: #0d0d1a; border: 1px solid #444; border-radius: 7px;
  color: #e0e0e0; font-size: 0.95rem;
  transition: border-color 0.15s;
}
.auth-form input:focus {
  outline: none; border-color: #5b8dd9;
}
.auth-submit-btn {
  background: #5b8dd9; color: #fff; border: none;
  border-radius: 8px; padding: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background 0.2s; margin-top: 4px;
}
.auth-submit-btn:hover { background: #4a7bc8; }
.auth-submit-btn:disabled { background: #444; cursor: not-allowed; }

.auth-form-error {
  color: #e05a5a; font-size: 0.88rem;
  background: #2a1010; border-radius: 6px;
  padding: 8px 12px; display: none;
}
.auth-form-error.visible { display: block; }
.auth-form-success {
  color: #5acd7e; font-size: 0.88rem;
  background: #0f2a1a; border-radius: 6px;
  padding: 8px 12px; display: none;
}
.auth-form-success.visible { display: block; }

.ui-dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.ui-dialog-overlay.visible {
  opacity: 1; pointer-events: all;
}
.ui-dialog {
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 14px;
  width: 400px;
  max-width: 95vw;
  padding: 26px 28px 22px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  transform: translateY(-12px);
  transition: transform 0.2s;
}
.ui-dialog-overlay.visible .ui-dialog { transform: translateY(0); }
.ui-dialog-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #e8e8f0;
  padding-right: 24px;
}
.ui-dialog-message {
  margin: 0 0 20px;
  color: #bbb;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ui-dialog-message.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #ffd700;
  background: #12121f;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 14px;
}
.ui-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ui-dialog-btn {
  min-height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.ui-dialog-btn.primary {
  background: #5b8dd9;
  color: #fff;
}
.ui-dialog-btn.primary:hover { background: #4a7bc8; }
.ui-dialog-btn.danger {
  background: #c44;
  color: #fff;
}
.ui-dialog-btn.danger:hover { background: #b33; }
.ui-dialog-btn.secondary {
  background: #2a2a3e;
  color: #ccc;
}
.ui-dialog-btn.secondary:hover { background: #34344a; color: #fff; }
.ui-dialog-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: #888; font-size: 1.35rem;
  cursor: pointer; line-height: 1;
}
.ui-dialog-close:hover { color: #fff; }

.auth-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: #bbb;
  line-height: 1.45;
  cursor: pointer;
}
.auth-terms-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #5b8dd9;
}
.auth-terms-row a {
  color: #5b8dd9;
  text-decoration: none;
}
.auth-terms-row a:hover { text-decoration: underline; }

.auth-terms-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
}
.auth-terms-gate-overlay.visible {
  display: flex;
}
.auth-terms-gate {
  width: min(100%, 440px);
  background: #141824;
  border: 1px solid rgba(91, 141, 217, 0.35);
  border-radius: 12px;
  padding: 28px 24px 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.auth-terms-gate-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: #fff;
}
.auth-terms-gate-text {
  margin: 0 0 18px;
  color: #bbb;
  line-height: 1.55;
  font-size: 0.95rem;
}
.auth-terms-gate-logout {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.875rem;
  cursor: pointer;
}
.auth-terms-gate-logout:hover { color: #ccc; }

.auth-captcha-wrap {
  display: flex;
  justify-content: center;
  min-height: 65px;
}
