/* Atlas Sync team auth / home shell — exact tokens from atlasync.io */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors — atlasync.io :root */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #111111;
  --color-surface: #1a1a1a;
  --color-surface-hover: #222222;
  --color-border: #2a2a2a;
  --color-text-primary: #ffffff;
  --color-text-secondary: #b3b3b3;
  --color-text-tertiary: #808080;
  --color-accent-primary: #00d4ff;
  --color-accent-secondary: #7c3aed;

  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --gradient-surface: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);

  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 32px rgba(0, 212, 255, 0.3);

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========== Standalone team home ========== */
.atlas-team-home {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.atlas-team-home *,
.atlas-team-home *::before,
.atlas-team-home *::after {
  box-sizing: border-box;
}

.atlas-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  min-height: 100vh;
}

.atlas-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--color-bg-primary);
  border-right: 1px solid var(--color-border);
}

.atlas-panel::before,
.atlas-panel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.atlas-panel::before {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.18) 0%, transparent 68%);
}

.atlas-panel::after {
  width: 480px;
  height: 480px;
  right: -160px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, transparent 70%);
}

.atlas-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.atlas-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.75rem;
  text-decoration: none;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
}

.atlas-brand img,
.atlas-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.atlas-brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.atlas-panel h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.atlas-panel .atlas-lead {
  margin: 0 0 2.75rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 38ch;
}

.atlas-features {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.atlas-features li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.85rem;
  align-items: start;
}

.atlas-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 212, 255, 0.12);
  color: var(--color-accent-primary);
  margin-top: 0.1rem;
}

.atlas-check svg {
  width: 14px;
  height: 14px;
}

.atlas-feature-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.atlas-feature-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.atlas-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(circle at top, rgba(0, 212, 255, 0.1), transparent 55%),
    var(--gradient-surface),
    var(--color-bg-secondary);
}

.atlas-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: clamp(1.6rem, 3vw, 2.25rem);
}

.atlas-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.atlas-card-sub {
  margin: 0 0 1.4rem;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.atlas-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.3rem;
  margin-bottom: 1.35rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.atlas-tabs a,
.atlas-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.atlas-tabs a.is-active,
.atlas-tabs button.is-active {
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.atlas-field {
  margin-bottom: 1rem;
}

.atlas-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.atlas-input {
  position: relative;
}

.atlas-input svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-tertiary);
  pointer-events: none;
}

.atlas-input input {
  width: 100%;
  height: 48px;
  padding: 0 0.95rem 0 2.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #0d0d0d;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.atlas-input input::placeholder {
  color: #606060;
}

.atlas-input input:focus {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.atlas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 6px;
  background: var(--gradient-primary);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.atlas-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.atlas-btn:active {
  transform: translateY(0);
}

.atlas-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.85rem;
  margin: 1.2rem 0;
  color: var(--color-text-tertiary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.atlas-divider::before,
.atlas-divider::after {
  content: '';
  height: 1px;
  background: var(--color-border);
}

.atlas-btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.atlas-btn-google:hover {
  border-color: var(--color-accent-primary);
  color: var(--color-accent-primary);
  background: transparent;
}

.atlas-btn-google svg {
  width: 18px;
  height: 18px;
}

.atlas-foot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
}

.atlas-foot a {
  color: var(--color-accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.atlas-foot a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .atlas-shell {
    grid-template-columns: 1fr;
  }

  .atlas-panel {
    min-height: auto;
    padding: 2rem 1.5rem 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .atlas-panel h1 {
    font-size: 1.85rem;
  }

  .atlas-features {
    display: none;
  }

  .atlas-form-side {
    padding: 0 1.25rem 2rem;
    background: var(--color-bg-secondary);
  }
}

/* ========== LibreChat auth overlay ========== */
body.atlas-auth-shell {
  font-family: var(--font-primary) !important;
  background: var(--color-bg-primary) !important;
  color: var(--color-text-primary) !important;
}

body.atlas-auth-shell #root > div.relative.flex.min-h-screen {
  display: grid !important;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr) !important;
  min-height: 100vh !important;
  background: var(--color-bg-secondary) !important;
  color: var(--color-text-primary) !important;
}

body.atlas-auth-shell #atlas-auth-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4.5vw, 4rem);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  border-right: 1px solid var(--color-border);
  order: -1;
}

body.atlas-auth-shell #atlas-auth-panel::before,
body.atlas-auth-shell #atlas-auth-panel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

body.atlas-auth-shell #atlas-auth-panel::before {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.18) 0%, transparent 68%);
}

body.atlas-auth-shell #atlas-auth-panel::after {
  width: 480px;
  height: 480px;
  right: -160px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, transparent 70%);
}

body.atlas-auth-shell #atlas-auth-panel .atlas-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

body.atlas-auth-shell #root > div.relative.flex.min-h-screen > div.mt-6.h-10,
body.atlas-auth-shell #root .mt-6.h-10.w-full.bg-cover {
  display: none !important;
}

body.atlas-auth-shell #root main.flex.flex-grow {
  grid-column: 2;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(1.25rem, 3vw, 2.5rem) !important;
  background:
    radial-gradient(circle at top, rgba(0, 212, 255, 0.1), transparent 55%),
    var(--gradient-surface),
    var(--color-bg-secondary) !important;
}

body.atlas-auth-shell #root .w-authPageWidth {
  width: 100% !important;
  max-width: 440px !important;
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: clamp(1.5rem, 3vw, 2.15rem) !important;
  color: var(--color-text-primary) !important;
}

body.atlas-auth-shell #root .w-authPageWidth h1 {
  text-align: left !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--color-text-primary) !important;
  margin-bottom: 0.35rem !important;
}

body.atlas-auth-shell #atlas-auth-subtitle {
  margin: 0 0 1.15rem;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

body.atlas-auth-shell #atlas-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.3rem;
  margin: 0 0 1.2rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

body.atlas-auth-shell #atlas-auth-tabs a {
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-align: center;
  text-decoration: none;
}

body.atlas-auth-shell #atlas-auth-tabs a.is-active {
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

body.atlas-auth-shell #root .w-authPageWidth label {
  color: var(--color-text-secondary) !important;
  /* Floating labels sit on the card border — match card surface, not white */
  background: var(--color-surface) !important;
  background-color: var(--color-surface) !important;
}

body.atlas-auth-shell #root .w-authPageWidth input,
body.atlas-auth-shell #root .w-authPageWidth input[type='text'],
body.atlas-auth-shell #root .w-authPageWidth input[type='email'],
body.atlas-auth-shell #root .w-authPageWidth input[type='password'] {
  border-radius: 6px !important;
  border-color: var(--color-border) !important;
  background: #0d0d0d !important;
  background-color: #0d0d0d !important;
  color: var(--color-text-primary) !important;
  -webkit-text-fill-color: var(--color-text-primary) !important;
  caret-color: var(--color-accent-primary) !important;
  box-shadow: none !important;
}

/* Chrome/Safari autofill paints a white field — force Atlas dark */
body.atlas-auth-shell #root .w-authPageWidth input:-webkit-autofill,
body.atlas-auth-shell #root .w-authPageWidth input:-webkit-autofill:hover,
body.atlas-auth-shell #root .w-authPageWidth input:-webkit-autofill:focus,
body.atlas-auth-shell #root .w-authPageWidth input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0d0d0d inset !important;
  box-shadow: 0 0 0 1000px #0d0d0d inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: var(--color-accent-primary) !important;
  border-color: var(--color-border) !important;
  transition: background-color 99999s ease-out;
}

body.atlas-auth-shell #root .w-authPageWidth input::placeholder {
  color: #606060 !important;
  opacity: 1 !important;
}

body.atlas-auth-shell #root .w-authPageWidth input:focus {
  border-color: var(--color-accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

/* Field stack spacing — LibreChat uses mb-2 on password which collapses visually under floating labels */
body.atlas-auth-shell #root .w-authPageWidth form[aria-label='Login form'] > .mb-4,
body.atlas-auth-shell #root .w-authPageWidth form[aria-label='Login form'] > .mb-2,
body.atlas-auth-shell #root .w-authPageWidth form > div.mb-4,
body.atlas-auth-shell #root .w-authPageWidth form > div.mb-2 {
  margin-bottom: 1.35rem !important;
}

body.atlas-auth-shell #root .w-authPageWidth form .relative {
  margin-top: 0.35rem;
}

/* Password show/hide control */
body.atlas-auth-shell #root .w-authPageWidth button[type='button'] {
  color: var(--color-text-tertiary) !important;
}

body.atlas-auth-shell #root .w-authPageWidth button[type='button']:hover {
  color: var(--color-text-primary) !important;
  background: transparent !important;
}

/* Left panel: keep lead → features gap when injected into LibreChat */
body.atlas-auth-shell #atlas-auth-panel .atlas-lead {
  margin-bottom: 2.75rem !important;
}

body.atlas-auth-shell #atlas-auth-panel .atlas-features {
  margin-top: 0.5rem !important;
  gap: 1.5rem !important;
}

body.atlas-auth-shell #root [data-testid='login-button'],
body.atlas-auth-shell #root button[type='submit'].h-12.w-full,
body.atlas-auth-shell #root .w-authPageWidth button[type='submit'] {
  background-image: var(--gradient-primary) !important;
  background-color: transparent !important;
  color: var(--color-text-primary) !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  border: 0 !important;
}

body.atlas-auth-shell #root [data-testid='login-button']:hover,
body.atlas-auth-shell #root .w-authPageWidth button[type='submit']:hover {
  box-shadow: var(--shadow-glow) !important;
  filter: none !important;
}

body.atlas-auth-shell #root .w-authPageWidth a[aria-label*='Google'],
body.atlas-auth-shell #root .w-authPageWidth a[href*='/oauth/'] {
  border-radius: 6px !important;
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-text-primary) !important;
}

body.atlas-auth-shell #root .w-authPageWidth a[aria-label*='Google']:hover,
body.atlas-auth-shell #root .w-authPageWidth a[href*='/oauth/']:hover {
  border-color: var(--color-accent-primary) !important;
  color: var(--color-accent-primary) !important;
}

body.atlas-auth-shell #root .w-authPageWidth a[href='/forgot-password'],
body.atlas-auth-shell #root .w-authPageWidth a.text-green-600 {
  color: var(--color-accent-primary) !important;
}

/* Hide LibreChat registration links — invite-only */
body.atlas-auth-shell #root .w-authPageWidth a[href='/register'],
body.atlas-auth-shell #root a[href='/register'] {
  display: none !important;
}

body.atlas-auth-shell #root > div.relative.flex.min-h-screen > div.absolute.bottom-0 {
  display: none !important;
}

body.atlas-auth-shell #root [role='contentinfo'] {
  grid-column: 1 / -1;
  background: transparent;
  padding-bottom: 1rem;
  border-top: 1px solid var(--color-border);
}

body.atlas-auth-shell #root [role='contentinfo'] a {
  color: var(--color-accent-primary) !important;
}

@media (max-width: 900px) {
  body.atlas-auth-shell #root > div.relative.flex.min-h-screen {
    grid-template-columns: 1fr !important;
  }

  body.atlas-auth-shell #atlas-auth-panel {
    padding: 1.75rem 1.35rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  body.atlas-auth-shell #atlas-auth-panel .atlas-features {
    display: none;
  }

  body.atlas-auth-shell #root main.flex.flex-grow {
    grid-column: 1;
    padding: 0 1.15rem 2rem !important;
  }
}
