.xt-auth-entry { flex: 0 0 auto; position: relative; z-index: 80; }
.xt-auth-button {
  max-width: 190px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #343a35;
  border-radius: 4px;
  color: #f3f6f3;
  background: #111411;
  cursor: pointer;
}
.xt-auth-button:hover { border-color: #86efac; color: #86efac; }
.xt-auth-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.xt-auth-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.xt-auth-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 1px solid #3f4740;
  border-radius: 6px;
  color: #f4f7f4;
  background: #111411;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.xt-auth-dialog::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(7px); }
.xt-auth-dialog section { padding: 32px; }
.xt-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #3f4740;
  border-radius: 50%;
  color: #dce2dc;
  background: #171b18;
  font-size: 21px;
  cursor: pointer;
}
.xt-auth-close:hover { border-color: #fb7185; color: #fb7185; }
.xt-auth-eyebrow { margin: 0; color: #67e8f9; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.xt-auth-dialog h2 { margin: 8px 0 24px; font-size: 28px; letter-spacing: 0; }
.xt-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; border: 1px solid #303731; }
.xt-auth-tabs button { min-height: 42px; border: 0; color: #aab2ab; background: #171b18; cursor: pointer; }
.xt-auth-tabs button.active { color: #071008; background: #86efac; }
.xt-auth-form { display: grid; gap: 14px; }
.xt-auth-form label { display: grid; gap: 7px; color: #b8c0b9; font-size: 12px; }
.xt-auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #343a35;
  border-radius: 3px;
  outline: 0;
  color: #f4f7f4;
  background: #0b0d0c;
}
.xt-auth-form input:focus { border-color: #86efac; }
.xt-auth-submit,
.xt-auth-logout {
  min-height: 46px;
  border: 1px solid #86efac;
  border-radius: 3px;
  color: #071008;
  background: #86efac;
  cursor: pointer;
}
.xt-auth-submit:disabled,
.xt-auth-logout:disabled { opacity: 0.55; cursor: wait; }
.xt-auth-message { min-height: 18px; margin: -4px 0 0; color: #fb7185; font-size: 12px; }
.xt-auth-message.success { color: #86efac; }
.xt-auth-secondary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.xt-auth-secondary button,
.xt-auth-back {
  min-height: 32px;
  padding: 0;
  border: 0;
  color: #9faba2;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.xt-auth-secondary button:hover,
.xt-auth-back:hover { color: #86efac; }
.xt-auth-back { justify-self: start; }
.xt-auth-form [hidden] { display: none !important; }
.xt-auth-note { margin: 18px 0 0; color: #7f8881; font-size: 11px; line-height: 1.7; }
.xt-auth-profile { display: flex; align-items: center; gap: 14px; margin: 14px 0 28px; }
.xt-auth-avatar { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #86efac; border-radius: 50%; color: #86efac; font-weight: 800; }
.xt-auth-profile div { min-width: 0; display: grid; gap: 4px; }
.xt-auth-profile small { color: #9fa8a1; overflow-wrap: anywhere; }
.xt-auth-logout { width: 100%; border-color: #fb7185; color: #fb7185; background: transparent; }

body > .xt-auth-entry { position: fixed; top: 14px; right: 14px; z-index: 80; }

@media (max-width: 1100px) {
  .site-shell > .topbar .xt-auth-label { display: none; }
  .site-shell > .topbar .xt-auth-button { width: 38px; padding: 0; justify-content: center; }
}

@media (max-width: 640px) {
  .top-actions .xt-auth-label { display: none; }
  .top-actions .xt-auth-button { width: 38px; padding: 0; justify-content: center; }
  .xt-auth-dialog section { padding: 28px 20px 24px; }
}

/* Industrial account and entry gate */
.xt-auth-entry {
  z-index: 80;
}

.xt-auth-button {
  min-height: 40px;
  padding: 0 12px;
  border-color: var(--line, #343a35);
  border-radius: 3px;
  color: var(--text, #f3f6f3);
  background: var(--surface, #111411);
  font-weight: 700;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.xt-auth-button:hover {
  border-color: var(--accent, #67e8f9);
  color: var(--accent, #67e8f9);
  background: var(--surface-2, #171b18);
}

.xt-auth-icon {
  border-radius: 3px;
}

.xt-auth-dialog {
  width: min(500px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  border-color: var(--line-strong, #3f4740);
  border-radius: 4px;
  color: var(--text, #f4f7f4);
  background: var(--surface, #111411);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.xt-auth-dialog::backdrop {
  background: rgba(4, 6, 8, 0.88);
  backdrop-filter: blur(8px);
}

.xt-auth-dialog.is-entry-gate {
  border-top: 3px solid var(--accent, #67e8f9);
}

.xt-auth-dialog section {
  padding: 34px;
}

.xt-auth-close {
  border-radius: 3px;
  color: var(--muted, #dce2dc);
  background: var(--surface-2, #171b18);
}

.xt-auth-eyebrow {
  color: var(--accent, #67e8f9);
  font-weight: 800;
}

.xt-auth-dialog h2 {
  max-width: 380px;
  margin: 8px 0 12px;
  font-size: 32px;
  line-height: 1.08;
}

.xt-auth-intro {
  margin: 0 0 24px;
  color: var(--muted, #9fa8a1);
  font-size: 12px;
  line-height: 1.7;
}

.xt-auth-tabs {
  gap: 3px;
  padding: 3px;
  border-color: var(--line, #303731);
  border-radius: 3px;
  background: var(--bg, #0b0d0c);
}

.xt-auth-tabs button {
  min-height: 40px;
  border-radius: 2px;
  color: var(--muted, #aab2ab);
  background: transparent;
  font-weight: 700;
}

.xt-auth-tabs button.active {
  color: var(--bg, #071008);
  background: var(--hot, #86efac);
}

.xt-auth-form input {
  min-height: 44px;
  border-color: var(--line, #343a35);
  color: var(--text, #f4f7f4);
  background: var(--bg, #0b0d0c);
}

.xt-auth-form input:focus {
  border-color: var(--accent, #67e8f9);
  box-shadow: inset 3px 0 0 var(--accent, #67e8f9);
}

.xt-auth-submit,
.xt-auth-logout,
.xt-auth-continue {
  width: 100%;
  min-height: 44px;
  border-radius: 3px;
  font-weight: 750;
}

.xt-auth-submit {
  border-color: var(--hot, #86efac);
  color: #071008;
  background: var(--hot, #86efac);
}

.xt-auth-continue {
  border: 1px solid var(--accent, #67e8f9);
  color: var(--accent, #67e8f9);
  background: transparent;
  cursor: pointer;
}

.xt-auth-continue:hover {
  color: var(--bg, #071008);
  background: var(--accent, #67e8f9);
}

.xt-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted, #7f8881);
  font-size: 10px;
}

.xt-auth-divider::before,
.xt-auth-divider::after {
  height: 1px;
  content: "";
  background: var(--line, #303731);
}

.xt-auth-note {
  color: var(--muted, #7f8881);
}

.xt-auth-avatar {
  border-radius: 3px;
  color: var(--accent, #86efac);
  border-color: var(--accent, #86efac);
}

@media (max-width: 640px) {
  .xt-auth-dialog {
    width: calc(100% - 18px);
    max-height: calc(100vh - 18px);
  }

  .xt-auth-dialog section {
    padding: 26px 18px 22px;
  }

  .xt-auth-dialog h2 {
    padding-right: 26px;
    font-size: 28px;
  }
}

/* Full-screen motion layer for the account experience */
.xt-auth-motion {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: visible;
  opacity: 1;
  background: #06090b url("./assets/auth/entry-motion-poster.jpg") center / cover no-repeat;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.xt-auth-motion.auth-active {
  z-index: 70;
}

.xt-auth-motion video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.94) contrast(1.04) brightness(0.92);
  transform: scale(1.035);
}

.xt-auth-motion.active video {
  animation: xt-auth-camera 12s cubic-bezier(0.33, 1, 0.68, 1) infinite alternate;
}

.xt-auth-motion.auth-active video {
  animation-duration: 5.8s;
  filter: saturate(0.76) contrast(1.08) brightness(0.7);
}

.xt-auth-motion-shade,
.xt-auth-motion-scan {
  position: absolute;
  inset: 0;
}

.xt-auth-motion-shade {
  background: transparent;
}

html[data-theme="dark"] .xt-auth-motion-shade {
  background: transparent;
}

.xt-auth-motion.auth-active .xt-auth-motion-shade {
  background:
    linear-gradient(90deg, rgba(3, 5, 7, 0.58), rgba(3, 5, 7, 0.22) 45%, rgba(3, 5, 7, 0.5)),
    linear-gradient(180deg, rgba(3, 5, 7, 0.18), rgba(3, 5, 7, 0.62));
}

.xt-auth-motion-scan {
  width: 26%;
  left: -32%;
  right: auto;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.11), transparent);
  transform: skewX(-8deg);
}

.xt-auth-motion.auth-active .xt-auth-motion-scan {
  animation: xt-auth-scan 2.8s 0.2s ease-out both;
}

html {
  background: #06090b !important;
}

body {
  background: transparent !important;
}

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c0d;
  --surface: rgba(8, 13, 14, 0.9);
  --surface-2: rgba(16, 23, 22, 0.88);
  --surface-3: rgba(25, 34, 32, 0.88);
  --text: #f4f7f5;
  --muted: #d3dad5;
  --line: rgba(211, 218, 213, 0.23);
  --line-strong: rgba(211, 218, 213, 0.42);
  --accent: #5edbff;
  --hot: #8cf26b;
  --warning: #ffd166;
  --danger: #ff7885;
  --code-bg: rgba(4, 8, 9, 0.94);
  --code-text: #dfffe6;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.topbar {
  background: rgba(8, 12, 13, 0.91);
}

.meta,
.tag,
.brand small,
.panel-head,
.tool-domain,
.directory-card p,
.community-post-identity small {
  color: #9ca8a1;
}

.category-menu button {
  color: #d3dad5;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.72);
}

.section-head h2,
.section-head .eyebrow {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.96),
    0 0 14px rgba(0, 0, 0, 0.72);
}

.post-card,
.latest-panel,
.share-card,
.book-card,
.tool-card,
.directory-card,
.prompt-card,
.assistant-panel,
.assistant-side,
.generator-workspace,
.generator-history,
.community-compose,
.community-post {
  backdrop-filter: blur(12px) saturate(1.06);
}

.hero-copy h1,
.hero-copy p,
.hero-copy .eyebrow {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.88),
    0 0 14px rgba(255, 255, 255, 0.58);
}

html[data-theme="dark"] .hero-copy h1,
html[data-theme="dark"] .hero-copy p,
html[data-theme="dark"] .hero-copy .eyebrow {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.92),
    0 0 16px rgba(0, 0, 0, 0.68);
}

.xt-auth-dialog[open] {
  background: rgba(11, 15, 17, 0.94);
  backdrop-filter: blur(16px) saturate(1.1);
  animation: xt-auth-panel-in 0.58s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.xt-auth-dialog[open]::backdrop {
  background: rgba(2, 4, 6, 0.38);
  backdrop-filter: blur(1px);
}

@keyframes xt-auth-camera {
  0% { transform: scale(1.035) translate3d(0, 0, 0); }
  100% { transform: scale(1.095) translate3d(-1.2%, -0.8%, 0); }
}

@keyframes xt-auth-scan {
  0% { left: -32%; opacity: 0; }
  18% { opacity: 1; }
  100% { left: 112%; opacity: 0; }
}

@keyframes xt-auth-panel-in {
  0% { opacity: 0; transform: translateY(24px) scale(0.965); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .xt-auth-motion video {
    object-position: 49% center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xt-auth-motion,
  .xt-auth-dialog[open] {
    transition: none;
    animation: none;
  }

  .xt-auth-motion video,
  .xt-auth-motion-scan {
    display: none;
    animation: none;
  }
}

/* Pure monochrome background. The account layer no longer loads video media. */
.xt-auth-motion {
  display: none !important;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --surface-3: #e9e9e9;
  --text: #111111;
  --muted: #5f5f5f;
  --line: #d7d7d7;
  --line-strong: #a9a9a9;
  --accent: #111111;
  --hot: #1f7a1f;
  --warning: #8a5a00;
  --danger: #b4232f;
  --code-bg: #111111;
  --code-text: #f5f5f5;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #090909;
  --surface-2: #111111;
  --surface-3: #181818;
  --text: #f5f5f5;
  --muted: #aaaaaa;
  --line: #2d2d2d;
  --line-strong: #505050;
  --accent: #ffffff;
  --hot: #8cf26b;
  --warning: #ffd166;
  --danger: #ff7885;
  --code-bg: #050505;
  --code-text: #f5f5f5;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
}

html,
body {
  background: var(--bg) !important;
  background-image: none !important;
}

.topbar {
  background: rgba(255, 255, 255, 0.97);
}

html[data-theme="dark"] .topbar {
  background: rgba(0, 0, 0, 0.97);
}

.hero-copy h1,
.hero-copy p,
.hero-copy .eyebrow,
.section-head h2,
.section-head .eyebrow,
.category-menu button {
  text-shadow: none !important;
}

.post-card,
.latest-panel,
.share-card,
.book-card,
.tool-card,
.directory-card,
.prompt-card,
.assistant-panel,
.assistant-side,
.generator-workspace,
.generator-history,
.community-compose,
.community-post {
  backdrop-filter: none;
}

.xt-auth-dialog[open] {
  color: var(--text);
  background: var(--surface);
  backdrop-filter: none;
}

.xt-auth-dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: none;
}
