/* BasinMind — auth.css — Login/Register modal + profile dropdown */

/* ── Auth button in header ───────────────────────────────────────────────── */
.chr-auth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.chr-auth-btn:hover { background: var(--bg-elev-2); border-color: var(--ink-3); }
.chr-auth-btn.signed-in { border-color: var(--water-soft); }
.chr-auth-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--water-soft);
  color: var(--water);
  font-size: .68rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chr-auth-avatar.glyph {
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
}
.chr-auth-asks {
  font-size: .68rem;
  color: var(--ink-3);
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-elev-2);
}

/* ── Profile dropdown ────────────────────────────────────────────────────── */
.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  z-index: 200;
  overflow: hidden;
  animation: authDropFade .12s ease;
}
html[data-bm-theme="day"] .auth-dropdown {
  box-shadow: 0 8px 32px rgba(60,50,30,.15);
}
@keyframes authDropFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-drop-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-drop-glyph {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.auth-drop-name  { font-size: .82rem; font-weight: 600; color: var(--ink); }
.auth-drop-email { font-size: .72rem; color: var(--ink-3); margin-top: 1px; }
.auth-drop-persona {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  color: var(--water);
  background: var(--water-soft);
  padding: 2px 8px;
  border-radius: 99px;
}
.auth-drop-limit {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.auth-drop-limit-lbl {
  font-size: .7rem;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.auth-drop-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.auth-drop-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--water);
  transition: width .3s;
}
.auth-drop-bar-fill.warn { background: var(--dry); }
.auth-drop-bar-fill.exhausted { background: var(--alarm); }
.auth-drop-limit-count { font-size: .7rem; color: var(--ink-3); margin-top: 4px; }
.auth-drop-actions { padding: 8px; }
.auth-drop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: .78rem;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.auth-drop-btn:hover { background: var(--bg-elev-2); color: var(--ink); }
.auth-drop-btn.sign-out { color: var(--alarm); }
.auth-drop-btn.sign-out:hover { background: var(--alarm-soft); }
.auth-drop-btn.danger { color: var(--alarm); }
.auth-drop-btn.danger:hover { background: var(--alarm-soft); }

/* Profile readout (persona description, location, who-you-are) */
.auth-drop-readout {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-drop-ro-row { display: flex; flex-direction: column; gap: 2px; }
.auth-drop-ro-lbl {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-4);
}
.auth-drop-ro-val { font-size: .76rem; color: var(--ink-2); line-height: 1.4; }

/* Profile edit — danger zone */
.auth-danger-zone {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-danger-link { color: var(--alarm); }
.auth-danger-link:hover { background: var(--alarm-soft); color: var(--alarm); }
.auth-danger-confirm { text-align: left; }
.auth-danger-title { font-size: .9rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.auth-danger-sub { font-size: .78rem; color: var(--ink-3); line-height: 1.45; margin-bottom: 12px; }
.auth-danger-btn { background: var(--alarm); }
.auth-danger-btn:hover { filter: brightness(1.05); }

/* ── Auth modal overlay ──────────────────────────────────────────────────── */
#bm-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
#bm-auth-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.auth-modal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  position: relative;
  box-shadow: 0 16px 64px rgba(0,0,0,.45);
  animation: authModalIn .16s ease;
}
html[data-bm-theme="day"] .auth-modal {
  box-shadow: 0 16px 64px rgba(60,50,30,.18);
}
@keyframes authModalIn {
  from { transform: translateY(16px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.auth-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%; border: none;
  background: var(--bg-elev-2);
  color: var(--ink-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: background .12s, color .12s;
}
.auth-modal-close:hover { background: var(--line); color: var(--ink); }
.auth-modal-logo {
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.auth-modal-logo img { height: 32px; }
.auth-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.auth-modal-sub {
  font-size: .8rem;
  color: var(--ink-3);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Tabs (Join / Sign In) ───────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elev-2);
  padding: 3px;
  border-radius: 9px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 7px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.auth-tab.active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ── Step progress ───────────────────────────────────────────────────────── */
.auth-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  justify-content: center;
}
.auth-step-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background .2s, transform .2s;
}
.auth-step-dot.active { background: var(--water); transform: scale(1.3); }
.auth-step-dot.done   { background: var(--water-2); }

/* ── Form elements ───────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-label {
  display: block;
  font-size: .72rem;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 5px;
  letter-spacing: .01em;
}
.auth-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: .85rem;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--water);
  box-shadow: 0 0 0 3px rgba(104,172,200,.15);
}
.auth-input.error { border-color: var(--alarm); }
.auth-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}
.auth-hint {
  font-size: .7rem;
  color: var(--ink-4);
  margin-top: 4px;
  line-height: 1.4;
}
.auth-error {
  font-size: .75rem;
  color: var(--alarm);
  margin-top: 4px;
}
.auth-success {
  font-size: .8rem;
  color: var(--crop);
  background: rgba(155,179,122,.1);
  border: 1px solid rgba(155,179,122,.3);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.auth-info {
  font-size: .78rem;
  color: var(--ink-3);
  background: var(--bg-elev-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Persona preview chip ────────────────────────────────────────────────── */
.auth-persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--water);
  background: var(--water-soft);
  padding: 5px 10px;
  border-radius: 99px;
  margin-top: 8px;
}

/* ── Location row ────────────────────────────────────────────────────────── */
.auth-loc-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.auth-loc-row .auth-input { flex: 1; }
.auth-geo-btn {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev-2);
  color: var(--ink-2);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .12s;
  display: flex; align-items: center; gap: 4px;
}
.auth-geo-btn:hover { background: var(--line); }
.auth-geo-status { font-size: .7rem; color: var(--ink-3); margin-top: 4px; }

/* Colorado location autocomplete */
.auth-ac-drop {
  position: absolute;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 4px;
}
.auth-ac-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: .82rem;
  color: var(--ink-2);
  cursor: pointer;
}
.auth-ac-item:hover, .auth-ac-item.active {
  background: var(--water-soft);
  color: var(--water);
}

/* Human-in-the-loop persona-review note */
.auth-hitl-note {
  font-size: .72rem;
  line-height: 1.45;
  color: var(--ink-3);
  background: var(--water-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  margin: 10px 0 4px;
}

/* ── Outside-CO notice ───────────────────────────────────────────────────── */
.auth-outside-co {
  font-size: .78rem;
  color: var(--dry);
  background: var(--dry-soft);
  border: 1px solid rgba(199,148,97,.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── OTP input ───────────────────────────────────────────────────────────── */
.auth-otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0;
}
.auth-otp-digit {
  width: 44px; height: 52px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--mono);
}
.auth-otp-digit:focus {
  border-color: var(--water);
  box-shadow: 0 0 0 3px rgba(104,172,200,.15);
}
.auth-otp-digit.filled { border-color: var(--water-2); }

/* ── Primary action button ───────────────────────────────────────────────── */
.auth-primary-btn {
  width: 100%;
  padding: 11px;
  border-radius: 9px;
  border: none;
  background: var(--water);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity .15s, filter .15s;
  margin-top: 6px;
}
.auth-primary-btn:hover  { filter: brightness(1.08); }
.auth-primary-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-primary-btn.loading {
  opacity: .7; cursor: wait;
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 20px,
    rgba(255,255,255,.08) 20px, rgba(255,255,255,.08) 40px
  );
  background-size: 200% 100%;
  animation: authBtnLoading 1s linear infinite;
}
@keyframes authBtnLoading {
  from { background-position: 200% 0; }
  to   { background-position: 0 0; }
}
.auth-ghost-btn {
  width: 100%;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: .82rem;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 8px;
  transition: background .12s, color .12s;
}
.auth-ghost-btn:hover { background: var(--bg-elev-2); color: var(--ink); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ink-4);
  font-size: .72rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Page gate overlay ───────────────────────────────────────────────────── */
.auth-page-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
}
.auth-gate-icon { font-size: 2.5rem; }
.auth-gate-title { font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.auth-gate-sub   { font-size: .85rem; color: var(--ink-3); max-width: 320px; line-height: 1.5; }

/* ── Verified success screen ─────────────────────────────────────────────── */
.auth-verify-success {
  text-align: center;
  padding: 20px 0;
}
.auth-verify-check {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.auth-verify-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.auth-verify-sub {
  font-size: .82rem;
  color: var(--ink-3);
  line-height: 1.5;
}
