/* Auth modal, account chip, settings, verify banner, guided tour, toasts.
 *
 * Layer 13 of the stylesheet. ORDER IS SIGNIFICANT: this file's rules
 * are overridden by every later layer and override every earlier one, exactly as
 * when they were one file. See docs/frontend-architecture.md. */

/* ===== AUTH (Phase 2 frontend) ===== */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.auth-modal {
  background: #0a1218;
  border: 1px solid rgba(0,255,153,.25);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 400px;
  color: #d7e2e9;
  font-size: 14px;
  box-shadow: 0 0 40px rgba(0,255,153,.15);
  position: relative;
}

.auth-modal h3 {
  margin: 0 0 16px 0;
  color: #00ff99;
  font-size: 17px;
  padding-right: 28px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent !important;
  border: none !important;
  color: #8e9aa5;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  flex: 1;
  margin: 0;
  font-weight: 600;
}

.auth-tabs button.active {
  background: rgba(0,255,153,.12);
  border-color: rgba(0,255,153,.4);
  color: #00ff99;
}

.auth-modal form { margin: 0; }

.auth-modal label {
  display: block;
  color: #8e9aa5;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.auth-modal input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 0 0;
  background: #0d161d;
  border: 1px solid #26333d;
  color: #d7e2e9;
  font-size: 14px;
}

.auth-modal input:focus {
  border-color: rgba(0,255,153,.45);
}

.auth-hint {
  color: #5a6770;
  font-size: 11px;
  margin: -6px 0 12px 0;
}
/* Without this the terms/privacy links render browser-default blue-purple —
   the same trap the sidebar links fell into on 18 July. */
.auth-hint a { color: #8e9aa5; text-decoration: underline; }
.auth-hint a:hover { color: #00ff99; }

.auth-primary {
  width: 100%;
  margin: 4px 0 0 0;
  background: rgba(0,255,153,.12) !important;
  border: 1px solid rgba(0,255,153,.4) !important;
  color: #00ff99 !important;
  font-weight: 700;
  font-size: 14px;
}

.auth-primary:hover { background: rgba(0,255,153,.2) !important; }
.auth-primary:disabled { opacity: .5; cursor: wait; }

.auth-link {
  background: none !important;
  border: none !important;
  color: #8e9aa5 !important;
  font-size: 12px;
  margin: 10px auto 0 auto;
  padding: 4px;
  display: block;
}

.auth-link:hover { color: #00ff99 !important; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5a6770;
  font-size: 11px;
  margin: 14px 0;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid rgba(255,255,255,.08);
}

.auth-google {
  display: none; /* revealed when /auth/providers says google is configured */
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #1f1f1f !important;
  font-weight: 600;
  font-size: 14px;
}

.auth-google:hover { background: #f1f3f4 !important; border-color: #f1f3f4 !important; }

/* The bare global `svg { width:100%; height:80px }` rule overrides the SVG's
   own width/height attributes, blowing the Google logo up to 316x80 and the
   button to ~102px tall. Pin it back to the intended 18px (higher specificity
   than the bare selector, so no need to touch that load-bearing global rule). */
.auth-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-error {
  color: #ff4d4d;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.auth-msg {
  color: #00ff99;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* Sidebar account chip */
.account-chip {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-chip .account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,255,153,.14);
  border: 1px solid rgba(0,255,153,.35);
  color: #00ff99;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.account-chip .account-meta {
  min-width: 0;
  flex: 1;
}

.account-chip .account-email {
  color: #d7e2e9;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-chip .account-tier {
  color: #8e9aa5;
  font-size: 11px;
}

.account-chip .account-signout {
  background: none !important;
  border: none !important;
  color: #5a6770;
  font-size: 11px;
  padding: 4px;
  margin: 0;
  flex-shrink: 0;
}

.account-chip .account-signout:hover { color: #ff4d4d; }

.account-chip[role="button"] { cursor: pointer; }
.account-chip[role="button"]:hover { border-color: rgba(0,255,153,.3); }

.account-chip .account-resend {
  background: none !important;
  border: none !important;
  color: #5a6770;
  font-size: 11px;
  padding: 4px;
  margin: 0;
  flex-shrink: 0;
}

.account-chip .account-resend:hover { color: #00ff99; }

/* Account settings view */
.auth-divider {
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 16px 0;
}

.auth-section-title {
  color: #5a6770;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 10px 0;
}

.auth-link.danger:hover { color: #ff4d4d !important; }

/* Verify-email banner */
#verifyBanner {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255,204,51,.06);
  border: 1px solid rgba(255,204,51,.3);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  color: #d7e2e9;
  font-size: 13px;
}

#verifyBanner button {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
}

/* Guided tour (Phase 4) */
#tourSpotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(5,11,16,.82);
  border: 2px solid rgba(0,255,153,.6);
  z-index: 10600;
  pointer-events: none;
  transition: all .3s ease;
}

#tourCard {
  position: fixed;
  z-index: 10601;
  background: #0a1218;
  border: 1px solid rgba(0,255,153,.3);
  border-radius: 14px;
  padding: 18px 20px;
  max-width: 340px;
  width: calc(100vw - 40px);
  color: #d7e2e9;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}

#tourCard h4 {
  margin: 0 0 8px 0;
  color: #00ff99;
  font-size: 15px;
}

#tourCard .tour-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

#tourCard .tour-step-count {
  color: #5a6770;
  font-size: 12px;
  margin-right: auto;
}

#tourCard button { margin: 0; font-size: 13px; padding: 8px 14px; }
#tourCard .tour-skip {
  background: none !important;
  border: none !important;
  color: #8e9aa5 !important;
}

/* Watchlist starter chips (Phase 4B) */
.starter-chip {
  background: rgba(0,255,153,.08) !important;
  border: 1px solid rgba(0,255,153,.3) !important;
  color: #d7e2e9 !important;
  border-radius: 99px !important;
  padding: 8px 16px !important;
  font-size: 13px;
  margin: 0 !important;
}

.starter-chip:hover { border-color: #00ff99 !important; color: #00ff99 !important; }

/* Auth toast */
.auth-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 18, 24, .95);
  border: 1px solid rgba(0,255,153,.35);
  color: #d7e2e9;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 10001;
  backdrop-filter: blur(8px);
  max-width: calc(100vw - 40px);
}
