:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f5f2;
  color: #191817;
  font-synthesis: none;
  --ink: #191817;
  --muted: #6f6c67;
  --line: #dedbd5;
  --panel: #f6f5f2;
  --story: #171618;
  --story-muted: #aaa6a0;
  --accent: #6757df;
  --accent-hover: #5949d0;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--panel);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  min-height: 100vh;
}

.story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(32px, 4.5vw, 72px);
  background:
    radial-gradient(circle at 18% 92%, rgba(103, 87, 223, 0.23), transparent 30rem),
    var(--story);
  color: #f5f3ef;
}

.story::after {
  position: absolute;
  right: -13rem;
  bottom: -18rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(255, 255, 255, 0.018),
    0 0 0 10rem rgba(255, 255, 255, 0.014);
  content: "";
  pointer-events: none;
}

.wordmark,
.mobile-wordmark {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  color: inherit;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 820;
}

.product-name {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #bdb9b2;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: 0;
}

.story-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 610px);
  margin: auto 0;
  padding: 72px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: #9388eb;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 600px;
  font-size: clamp(38px, 4.2vw, 64px);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1.01;
}

.story-intro {
  max-width: 510px;
  margin: 24px 0 0;
  color: var(--story-muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
}

.feature-list {
  display: grid;
  gap: 0;
  max-width: 540px;
  margin: clamp(48px, 7vh, 76px) 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
}

.feature-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.feature-index {
  padding-top: 2px;
  color: #706a77;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.feature-list strong,
.feature-list small {
  display: block;
}

.feature-list strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 680;
}

.feature-list small {
  color: var(--story-muted);
  font-size: 13px;
  line-height: 1.45;
}

.story-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #77736f;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.story-footer span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5f5a56;
}

.signin {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(28px, 6vw, 80px);
  background: var(--panel);
}

.signin-inner {
  width: 100%;
  max-width: 430px;
  min-width: 0;
}

.mobile-wordmark {
  display: none;
  margin-bottom: 72px;
  color: var(--ink);
}

.mobile-wordmark .product-name {
  border-color: var(--line);
  color: var(--muted);
}

.signin-heading {
  margin-bottom: 34px;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(31px, 3vw, 40px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.intro {
  max-width: 410px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #383633;
  font-size: 13px;
  font-weight: 680;
}

input,
button {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius);
  font: inherit;
}

input {
  padding: 0 15px;
  border: 1px solid #cfcbc4;
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(25, 24, 23, 0.03);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input::placeholder {
  color: #aaa69f;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(103, 87, 223, 0.18);
}

.help {
  margin: 9px 0 0;
  color: #8b8781;
  font-size: 11px;
  line-height: 1.45;
}

button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 0 17px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  transition:
    background 150ms ease,
    opacity 150ms ease;
}

button:hover {
  background: var(--accent-hover);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(103, 87, 223, 0.22);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.arrow {
  font-size: 18px;
  font-weight: 430;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: #a43d3d;
  font-size: 12px;
  line-height: 1.45;
}

.support {
  margin: 38px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #8b8781;
  font-size: 11px;
  line-height: 1.5;
}

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

  .story {
    display: none;
  }

  .signin {
    min-height: 100svh;
    min-width: 0;
    align-items: start;
    padding: 28px 24px 48px;
  }

  .signin-inner {
    margin: auto;
  }

  .mobile-wordmark {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .mobile-wordmark {
    margin-bottom: 54px;
  }

  .signin {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  input,
  button {
    transition: none;
  }
}

/* Google sign-in — the primary path. The token form below it is a fallback
   for when Google is unavailable. */
.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin: 4px 0 6px;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.google-signin:hover {
  background: #f3f4f6;
}

.token-fallback {
  margin-top: 18px;
}

.token-fallback > summary {
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 12px;
}

.token-fallback > summary:hover {
  opacity: 1;
}

/* ---- AtlaSync brand ---------------------------------------------------- */
/* The mark is an inline SVG so it renders under the page's strict CSP
   (img-src 'self' would otherwise need a data: or file exception). */
:root {
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --brand-cyan: #00d4ff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  background: none;
  border-radius: 0;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wordmark,
.mobile-wordmark {
  align-items: center;
  gap: 0.45em;
}

/* "atlasync" in brand gradient, product word stays muted */
.wordmark > span:not(.brand-mark):not(.product-name),
.mobile-wordmark > span:not(.brand-mark):not(.product-name) {
  background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.google-signin:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}
