/* ══════════════════════════════════════════════════════════════════
   auth_modal.css — Phase 6 authentication modal
   Completely isolated from styles.css — no shared selectors.
   All rules prefixed with .auth- or #auth- to avoid any conflicts.

   Class contract (set by auth_modal.js):
     .auth-overlay.open      → visible
     .auth-tab.active        → selected tab
     .auth-panel.active      → visible panel
     .auth-msg.error/.success → message state
     #nav-auth-btn.logged-in → post-login nav button
══════════════════════════════════════════════════════════════════ */

/* ── Nav button (replaces the static Login link) ─────────────────── */
#nav-auth-btn {
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  outline: none;
  transition: color 0.15s;
}

#nav-auth-btn:hover { color: #6b6b6b; }

#nav-auth-btn:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Logged-in state — reads LOGOUT, same uppercase treatment as LOGIN */
#nav-auth-btn.logged-in {
  font-weight: 400;
}

/* ── Overlay backdrop ────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 10, 10, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.20s ease, visibility 0.20s ease;
}

.auth-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal card ──────────────────────────────────────────────────── */
.auth-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  width: 380px;                 /* fixed width — never varies */
  padding: 0 0 28px;
  position: fixed;              /* fixed position — never jumps */
  top: 80px;                    /* consistent distance from top */
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  transition: transform 0.20s ease;
}

.auth-overlay.open .auth-card {
  transform: translateX(-50%) translateY(0);
}

/* ── Card header ─────────────────────────────────────────────────── */
.auth-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid #e0e0e0;
}

.auth-card-title {
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #0a0a0a;
}

/* ── Close button ────────────────────────────────────────────────── */
.auth-close {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b6b6b;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  outline: none;
  transition: color 0.15s;
}

.auth-close:hover { color: #0a0a0a; }

.auth-close:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Tabs ────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.auth-tab {
  flex: 1;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b6b6b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 0;
  cursor: pointer;
  outline: none;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab:hover { color: #0a0a0a; }

.auth-tab.active {
  color: #0a0a0a;
  border-bottom-color: #0a0a0a;
}

.auth-tab:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: -4px;
}

/* ── Panels ──────────────────────────────────────────────────────── */
.auth-panel {
  display: none;
  padding: 24px 28px 4px;
}

.auth-panel.active {
  display: block;
}

/* ── Fields ──────────────────────────────────────────────────────── */
.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #0a0a0a;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-field input::placeholder { color: #d0d0d0; }
.auth-field input:focus { border-color: #0a0a0a; }

.auth-hint {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #6b6b6b;
  margin: 6px 0 0;
  line-height: 1.4;
}

/* ── Submit button ───────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  background: #0a0a0a;
  border: none;
  padding: 12px 0;
  margin-top: 4px;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, opacity 0.15s;
}

.auth-submit:hover { background: #2a2a2a; }

.auth-submit:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 3px;
}

/* ── Message line ────────────────────────────────────────────────── */
.auth-msg {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: center;
  margin-top: 14px;
  min-height: 16px;
  transition: opacity 0.2s;
}

.auth-msg.error   { color: #b5002f; }
.auth-msg.success { color: #228B22; }

/* ── Narrow viewport ─────────────────────────────────────────────── */
@media (max-width: 440px) {
  .auth-card {
    width: calc(100% - 32px);
    left: 16px;
    transform: translateX(0) translateY(12px);
  }
  .auth-overlay.open .auth-card {
    transform: translateX(0) translateY(0);
  }
}

/* ── Section divider inside Reset panel ─────────────────────────── */
.auth-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 20px 0 16px;
}

/* ── Events enrollment section (events_widget.js) ────────────────── */
/* Lives inside the modal card as a footer; shown across all tabs.
   Read-only context while logged out; interactive once logged in. */
.auth-events {
  padding: 0 28px;
}

.auth-events-label {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin-bottom: 10px;
}

.auth-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-evt-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.auth-evt-name {
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0a0a0a;
  transition: color 0.15s;
}

/* Minimal monochrome square checkbox — matches modal's flat aesthetic. */
.auth-evt-box {
  appearance: none;
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin: 0;
  border: 1px solid #b8b8b8;
  border-radius: 0;
  background: #ffffff;
  cursor: inherit;
  position: relative;
  flex: 0 0 auto;
  transition: border-color 0.15s, background 0.15s;
}

.auth-evt-box:hover { border-color: #6b6b6b; }

.auth-evt-box:checked {
  background: #0a0a0a;
  border-color: #0a0a0a;
}

.auth-evt-box:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #ffffff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* Read-only (logged-out) state — muted, no interaction affordance. */
.auth-evt-box:disabled {
  border-color: #d8d8d8;
  background: #f4f4f4;
  cursor: default;
}
.auth-evt-row:has(.auth-evt-box:disabled) { cursor: default; }
.auth-evt-row:has(.auth-evt-box:disabled) .auth-evt-name { color: #9a9a9a; }

.auth-evt-box:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
}

.auth-events-hint {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #6b6b6b;
  margin: 12px 0 0;
  line-height: 1.4;
  transition: color 0.2s;
}

.auth-events-hint.flash { color: #b5002f; }

/* ── Account panel (logged-in view) ───────────────────────────────── */
/* Mirrors the Login panel's structure (auth-field blocks) so the modal
   height and typography stay constant across auth states. The identity
   line below uses .auth-readonly — visually identical to a disabled
   input, so it sits in the rhythm of the form without being editable. */

.auth-readonly {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #0a0a0a;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 10px 12px;
  cursor: default;
  user-select: text;
}

/* Secondary variant of .auth-submit — same shape, lower visual weight.
   Used for the in-modal Log out button so it doesn't look like a
   primary "sign in" call to action. */
.auth-submit--secondary {
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #0a0a0a;
}

.auth-submit--secondary:hover {
  background: #0a0a0a;
  color: #ffffff;
}
