/* Modern SPA Auth Screen Styles (Routes /login and /register) */
.auth-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.auth-page[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-page__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-page__container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 16px;
  margin: auto;
}

.auth-card {
  position: relative;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #eeeeec;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

.auth-card * {
  box-sizing: border-box;
}

.auth-card__close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 0;
  color: #888884;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-card__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.auth-card__header {
  margin-bottom: 22px;
  text-align: left;
}

.auth-card__title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  letter-spacing: -0.4px;
}

.auth-card__subtitle {
  font-size: 13.5px;
  color: #8e8e8a;
  margin: 0;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #7d7d79;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab:hover {
  color: #bbb;
}

.auth-tab.is-active {
  background: #242424;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form__group {
  margin-bottom: 16px;
  text-align: left;
}

.auth-form__group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #b5b5b0;
  margin-bottom: 6px;
}

.auth-form__group input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form__group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.auth-form__group input::placeholder {
  color: #555552;
}

.auth-field-hint {
  display: block;
  font-size: 11.5px;
  color: #71716c;
  margin-top: 5px;
}

/* Error Alert */
.auth-error-msg {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 10px 0 16px 0;
  text-align: left;
}

/* Buttons */
.auth-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: #f4f4f2;
  color: #121212;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.auth-primary-btn:hover {
  opacity: 0.9;
}

.auth-primary-btn:active {
  transform: scale(0.99);
}

.auth-primary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

.auth-secondary-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
}

.auth-secondary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-switch-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 13px;
  color: #73736e;
}

.auth-link-btn {
  background: transparent;
  border: 0;
  color: #60a5fa;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s ease;
}

.auth-link-btn:hover {
  color: #93c5fd;
}

.auth-logged-in-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.auth-outline-btn {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eeeeec;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s ease;
}

.auth-outline-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Activity Logs Panel */
.auth-page__container.has-logs {
  max-width: 640px;
}

.auth-logs-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.auth-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.auth-logs-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e5e0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-logs-counter {
  font-size: 11px;
  color: #888884;
  margin-left: 8px;
}

.auth-logs-refresh-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #93c5fd;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-logs-refresh-btn:hover {
  background: rgba(147, 197, 253, 0.1);
  border-color: #93c5fd;
}

.auth-logs-list {
  max-height: 280px;
  overflow-y: auto;
  border-radius: 8px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.auth-logs-empty {
  padding: 16px;
  font-size: 12px;
  color: #73736e;
  text-align: center;
}

.auth-log-item {
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-log-item.is-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.auth-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-log-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-log-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.auth-log-badge.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.auth-log-badge.badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.auth-log-action {
  font-weight: 600;
  color: #f3f4f6;
}

.auth-log-time {
  font-size: 10px;
  color: #71717a;
}

.auth-log-route {
  color: #a1a1aa;
  word-break: break-all;
}

.auth-log-detail {
  margin-top: 2px;
  font-size: 10px;
  color: #94a3b8;
  word-break: break-all;
  white-space: pre-wrap;
}

.auth-log-err {
  color: #f87171;
  font-weight: 500;
}

@media (max-width: 440px) {
  .auth-card {
    padding: 24px 20px;
    border-radius: 14px;
  }
}
