@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');
@import url('/css/lexithra-premium.css');
@import url('/css/lexithra-site-nav.css');
@import url('/css/lexithra-main-nav.css?v=11');

:root {
  --lx-auth-bg: #16161a;
  --lx-auth-surface: #222226;
  --lx-auth-card: #26262c;
  --lx-auth-border: #323236;
  --lx-auth-gold: #fbbf24;
  --lx-auth-blue: #3b82f6;
  --lx-auth-text: #fafafa;
  --lx-auth-muted: #b0b0b8;
}

/* Header auth widget */
[data-lexithra-auth],
.lx-auth-mount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-height: 2.25rem;
  min-width: 5.25rem;
}

.lx-auth-mount:empty::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  animation: lx-auth-pulse 1.4s ease-in-out infinite;
}

@keyframes lx-auth-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.lx-auth-user.lx-auth-pending {
  opacity: 0.88;
  pointer-events: none;
}

.lx-auth-user.lx-auth-pending .lx-auth-avatar {
  animation: lx-auth-pulse 1.4s ease-in-out infinite;
}

.lx-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.lx-auth-btn-login {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.lx-auth-btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.lx-auth-btn-ghost {
  background: transparent;
  color: var(--lx-auth-muted);
  border: 1px solid var(--lx-auth-border);
}
.lx-auth-btn-ghost:hover { color: var(--lx-auth-text); border-color: #46464d; }

.lx-auth-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border-radius: 2rem;
  border: 1px solid var(--lx-auth-border);
  background: var(--lx-auth-surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lx-auth-user:hover { border-color: #46464d; background: #28282c; }

.lx-auth-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.lx-auth-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--lx-auth-text);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lx-auth-chevron { font-size: 0.625rem; color: var(--lx-auth-muted); }

.lx-auth-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  background: var(--lx-auth-card);
  border: 1px solid var(--lx-auth-border);
  border-radius: 0.75rem;
  padding: 0.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  z-index: 200;
}
.lx-auth-user.open .lx-auth-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lx-auth-menu a,
.lx-auth-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: none;
  color: var(--lx-auth-muted);
  font-size: 0.8125rem;
  font-family: inherit;
  text-align: left;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.lx-auth-menu a:hover,
.lx-auth-menu button:hover { background: #323236; color: var(--lx-auth-text); }
.lx-auth-menu .danger:hover { color: #f87171; }

.lx-auth-level-pill {
  font-size: 0.6875rem;
  color: var(--lx-auth-gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 1rem;
  margin-left: 0.25rem;
}

.lx-auth-mount.compact .lx-auth-name,
.lx-auth-mount.compact .lx-auth-level-pill,
.lx-auth-mount.compact .lx-auth-chevron { display: none; }
.lx-auth-mount.compact .lx-auth-btn-login { padding: 0.4rem 0.75rem; font-size: 0.75rem; }

/* Modal */
.lx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lx-modal-overlay.open { opacity: 1; visibility: visible; }

.lx-modal {
  width: 100%;
  max-width: 26rem;
  background: linear-gradient(165deg, #282830 0%, var(--lx-auth-card) 55%, #1c1c20 100%);
  border: 1px solid var(--lx-auth-border);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 1.75rem;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  position: relative;
}

.lx-modal-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.lx-modal-brand-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  font-size: 1.1rem;
}

.lx-modal-brand-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lx-auth-muted);
}
.lx-modal-overlay.open .lx-modal { transform: scale(1) translateY(0); }

.lx-modal h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.lx-modal-sub {
  font-size: 0.8125rem;
  color: var(--lx-auth-muted);
  margin-bottom: 1.35rem;
  line-height: 1.55;
  text-align: center;
}

.lx-modal-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--lx-auth-surface);
  border-radius: 0.625rem;
  padding: 0.25rem;
}
.lx-modal-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: none;
  color: var(--lx-auth-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.lx-modal-tab.active { background: var(--lx-auth-blue); color: #fff; }

.lx-field { margin-bottom: 1rem; }
.lx-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lx-auth-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lx-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.lx-field-label-row label {
  margin-bottom: 0;
}
.lx-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--lx-auth-surface);
  border: 1px solid var(--lx-auth-border);
  border-radius: 0.625rem;
  color: var(--lx-auth-text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.lx-field input:focus { border-color: var(--lx-auth-blue); }

.lx-auth-error {
  color: #f87171;
  font-size: 0.8125rem;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

.lx-auth-success {
  color: #6ee7b7;
  font-size: 0.8125rem;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.lx-verify-panel {
  margin-bottom: 0.5rem;
  text-align: center;
}

.lx-forgot-link {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  color: #60a5fa;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.15s;
  white-space: nowrap;
}
.lx-forgot-link:hover { color: #93c5fd; text-decoration: underline; }

.lx-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1rem;
  color: var(--lx-auth-muted);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}
.lx-back-link:hover { color: var(--lx-auth-text); }

.lx-reset-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  font-size: 1.1rem;
}

.lx-modal-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.lx-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--lx-auth-surface);
  color: var(--lx-auth-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.lx-modal-close:hover { color: var(--lx-auth-text); }

.lx-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 0.625rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.lx-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.lx-btn-submit {
  width: 100%;
}

.lx-btn-primary:disabled,
.lx-btn-primary:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lx-pw-rules {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--lx-auth-border);
  border-radius: 0.625rem;
}

.lx-pw-rules-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--lx-auth-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}

.lx-pw-rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lx-pw-rule {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  transition: color 0.15s;
}

.lx-pw-rule-icon {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

.lx-pw-rule.idle {
  color: var(--lx-auth-muted);
}
.lx-pw-rule.idle .lx-pw-rule-icon { color: #52525b; }

.lx-pw-rule.met {
  color: #6ee7b7;
}
.lx-pw-rule.met .lx-pw-rule-icon { color: #34d399; }

.lx-pw-rule.unmet {
  color: #fca5a5;
}
.lx-pw-rule.unmet .lx-pw-rule-icon { color: #f87171; }

/* Mandatory auth / section gate — blur main content behind overlay */
body.lx-page-locked .ae-app,
body.lx-page-locked .ae-hub-content,
body.lx-page-locked .ae-main,
body.lx-page-locked .cq-app,
body.lx-page-locked .cq-hub-content,
body.lx-page-locked .cq-hub-hero,
body.lx-page-locked .cq-hub-footer,
body.lx-page-locked .cmq-hub-content,
body.lx-page-locked .pm-hub-content,
body.lx-page-locked .pm-hub-hero,
body.lx-page-locked .pm-app,
body.lx-page-locked .pm-main,
body.lx-page-locked .cs-layout,
body.lx-page-locked .cs-page > .pm-hub-content,
body.lx-page-locked .cs-page > header,
body.lx-page-locked .gl-exercise-grid,
body.lx-page-locked .gl-hub-hero-banner,
body.lx-page-locked .gl-body > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-page-locked .clg-body > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-page-locked .cq-gamified-hub > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-page-locked .lb-board,
body.lx-page-locked .lb-podium,
body.lx-page-locked .lb-hero,
body.lx-page-locked #dash-content,
body.lx-page-locked main,
body.lx-page-locked nav:not(.lx-main-nav):not(.lx-main-nav *):not(.lx-auth-gate *),
body.lx-section-locked .ae-app,
body.lx-section-locked .ae-hub-content,
body.lx-section-locked .ae-main,
body.lx-section-locked .cq-app,
body.lx-section-locked .cq-hub-content,
body.lx-section-locked .cq-hub-hero,
body.lx-section-locked .cq-hub-footer,
body.lx-section-locked .cmq-hub-content,
body.lx-section-locked .pm-hub-content,
body.lx-section-locked .pm-hub-hero,
body.lx-section-locked .pm-app,
body.lx-section-locked .pm-main,
body.lx-section-locked .cs-layout,
body.lx-section-locked .cs-page > .pm-hub-content,
body.lx-section-locked .cs-page > header,
body.lx-section-locked .gl-exercise-grid,
body.lx-section-locked .gl-hub-hero-banner,
body.lx-section-locked .gl-body > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-section-locked .clg-body > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-section-locked .cq-gamified-hub > *:not(.lx-auth-gate):not(#lx-main-nav-root),
body.lx-section-locked main,
body.lx-section-locked nav:not(.lx-main-nav):not(.lx-main-nav *):not(.lx-auth-gate *) {
  pointer-events: none !important;
  user-select: none !important;
  filter: blur(5px);
  opacity: 0.65;
}

/* Hard lock: hide interactive page content for restricted modules (Gamified Law etc.) */
html.lx-content-locked body > *:not(.lx-auth-gate):not(#lx-main-nav-root):not(script):not(style):not(link) {
  visibility: hidden !important;
  pointer-events: none !important;
}
html.lx-content-locked body > #lx-main-nav-root,
html.lx-content-locked body > #lx-main-nav-root * {
  visibility: visible !important;
  pointer-events: auto !important;
  filter: none !important;
  opacity: 1 !important;
}
html.lx-content-locked body > .lx-auth-gate,
html.lx-content-locked body > .lx-auth-gate * {
  visibility: visible !important;
  pointer-events: auto !important;
  filter: none !important;
  opacity: 1 !important;
}

.lx-auth-gate {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(9, 9, 11, 0.78);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  pointer-events: none;
}
.lx-auth-gate.visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.lx-auth-gate-card {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  background: var(--lx-auth-card);
  border: 1px solid var(--lx-auth-border);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: lxGateIn 0.4s ease;
}
@keyframes lxGateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lx-auth-gate-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #60a5fa;
}

.lx-auth-gate-card h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.lx-auth-gate-card p {
  font-size: 0.875rem;
  color: var(--lx-auth-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.lx-auth-gate-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.lx-auth-gate-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--lx-auth-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.lx-auth-gate-home:hover { color: var(--lx-auth-text); }

.lx-section-gate-icon {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(5, 150, 105, 0.1));
  border-color: rgba(20, 184, 166, 0.35);
  color: #5eead4;
}



.lx-modal-overlay.required { background: rgba(0, 0, 0, 0.82); }
.lx-modal-overlay.required .lx-modal { box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(59, 130, 246, 0.2); }