/**
 * RISKOS — Institutional Supabase Auth & Notification Modal Styles (authModal.css)
 * Bloomberg / Aladdin Terminal Aesthetic
 */

:root {
  --auth-bg-base: #060709;
  --auth-card-bg: rgba(14, 17, 23, 0.96);
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-accent-cyan: #22d3ee;
  --auth-accent-emerald: #10b981;
  --auth-accent-amber: #f59e0b;
  --auth-accent-rose: #f43f5e;
  --auth-text-primary: #f8fafc;
  --auth-text-muted: #64748b;
  --auth-font-mono: 'JetBrains Mono', monospace;
}

/* ── Universal Header Auth & Notification Elements ── */
.nav-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--auth-accent-cyan);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-auth-pill:hover {
  background: rgba(34, 211, 238, 0.16);
  border-color: var(--auth-accent-cyan);
  color: #fff;
}

.nav-auth-pill.authenticated {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--auth-accent-emerald);
}

.nav-auth-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-accent-cyan);
  box-shadow: 0 0 6px var(--auth-accent-cyan);
}

.nav-auth-pill.authenticated .nav-auth-dot {
  background: var(--auth-accent-emerald);
  box-shadow: 0 0 6px var(--auth-accent-emerald);
}

.nav-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-notif-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--auth-accent-rose);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  font-family: var(--auth-font-mono);
  padding: 1px 4px;
  border-radius: 10px;
  border: 1px solid #060709;
}

/* ── Modal Overlay ── */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.auth-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal Dialog ── */
.auth-modal-dialog {
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(34, 211, 238, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: authModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalPop {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--auth-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.auth-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
}

.auth-modal-close-btn {
  background: none;
  border: none;
  color: var(--auth-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.auth-modal-close-btn:hover {
  color: #fff;
}

/* ── Modal Tabs ── */
.auth-modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--auth-border);
  padding: 0 16px;
  gap: 8px;
  overflow-x: auto;
}

.auth-tab-btn {
  background: none;
  border: none;
  color: var(--auth-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 12px 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  white-space: nowrap;
}

.auth-tab-btn:hover {
  color: #fff;
}

.auth-tab-btn.active {
  color: var(--auth-accent-cyan);
}

.auth-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--auth-accent-cyan);
  box-shadow: 0 0 8px var(--auth-accent-cyan);
}

/* ── Tab Content Panes ── */
.auth-tab-pane {
  padding: 24px 20px;
  display: none;
}

.auth-tab-pane.active {
  display: block;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--auth-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-accent-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.25);
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(34, 211, 238, 0.15));
  border: 1px solid var(--auth-accent-cyan);
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: var(--auth-accent-cyan);
  color: #000;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

.auth-status-msg {
  margin-top: 12px;
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}

.auth-status-msg.error {
  display: block;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--auth-accent-rose);
}

.auth-status-msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--auth-accent-emerald);
}

/* ── Notification Settings Toggle List ── */
.notif-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-toggle-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.notif-toggle-desc {
  font-size: 0.7rem;
  color: var(--auth-text-muted);
}

.notif-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.notif-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.notif-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 20px;
}

.notif-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .notif-slider {
  background-color: var(--auth-accent-cyan);
}

input:checked + .notif-slider:before {
  transform: translateX(18px);
}

/* ── Notifications Inbox Drawer ── */
.notif-drawer-overlay {
  position: fixed;
  top: 56px;
  right: 20px;
  width: 380px;
  max-width: 90vw;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(34, 211, 238, 0.08);
  z-index: 25000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.notif-drawer-overlay.active {
  display: flex;
}

.notif-drawer-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--auth-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-drawer-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.75rem;
}

.notif-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.68rem;
  color: var(--auth-text-muted);
}

.notif-card-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
