/* The login page (login.js) in the website's Editorial look (specter-ai-website, site/index.html): the
   painting fills the page, the form sits in a warm card on its left. Newsreader for the wordmark and the
   title, Inter for everything else, an ink-brown button, hairlines inside the card. Its tokens live on
   .login only; the app's own look (styles.css) is unchanged. Fonts are self-hosted (OFL, web/fonts) and
   only load when this page shows. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

.login {
  --l-card: rgb(251 249 245 / 0.94);
  --l-foreground: #1c1914;
  --l-muted-foreground: #5f584e;
  --l-placeholder: #757575;
  --l-field: #ffffff;
  --l-border: #d9d1c4;
  --l-border-hover: #c4baa9;
  --l-rule: #e3dbcf;
  --l-hover: #faf8f4;
  --l-primary: #2b2219;
  --l-primary-foreground: #faf8f4;
  --l-accent: #7a5c2a;
  --l-focus: #7a5c2a;
  --l-danger: #b42318;
  --l-shadow: 0 28px 64px rgb(28 22 12 / 0.34), 0 2px 10px rgb(28 22 12 / 0.12);
  --l-display: "Newsreader", Georgia, serif;
  --l-sans: "Inter", system-ui, sans-serif;

  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: 32px 5vw;
  background: #8f8a77;
  color: var(--l-foreground);
  font: 400 14px/1.5 var(--l-sans);
  font-feature-settings: "ss01", "cv11";
  /* The design is drawn with the system's smoothing, not the app's thinner antialiased text. */
  -webkit-font-smoothing: auto;
}
:root[data-theme="dark"] .login {
  --l-card: rgb(23 21 18 / 0.9);
  --l-foreground: #f5f2ec;
  --l-muted-foreground: #a8a196;
  --l-placeholder: #8a847a;
  --l-field: #1f1c18;
  --l-border: #3d3831;
  --l-border-hover: #524b41;
  --l-rule: #332f29;
  --l-hover: #26231e;
  --l-primary: #f3eee6;
  --l-primary-foreground: #1c1914;
  --l-accent: #d8b778;
  --l-focus: #d8b778;
  --l-danger: #f97066;
  --l-shadow: 0 24px 64px rgb(0 0 0 / 0.45), 0 2px 8px rgb(0 0 0 / 0.25);
  /* Light text on a dark card reads too heavy without it. */
  -webkit-font-smoothing: antialiased;
}

/* The painting, behind everything. */
.login-art {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.login-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}

/* The card: centred top to bottom, 5% of the width from the left edge. */
.login-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 420px);
  margin: auto 0;
  padding: 36px 36px 34px;
  border-radius: 16px;
  background: var(--l-card);
  box-shadow: var(--l-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  backdrop-filter: blur(24px) saturate(1.1);
}
.login-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.login-wordmark {
  margin: 0;
  font: 500 26px/1 var(--l-display);
  letter-spacing: -0.01em;
}
.login-main {
  display: flex;
  flex-direction: column;
  margin-top: 28px;
}
.login h1 {
  margin: 0;
  font: 370 34px/1.1 var(--l-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.login-lead {
  margin: 0;
  font-size: 14px;
  color: var(--l-muted-foreground);
  text-wrap: pretty;
}
.login-lead strong {
  color: var(--l-foreground);
  font-weight: 500;
}
.login form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.login-field {
  display: grid;
  gap: 3px;
}
.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-field label {
  font-size: 13px;
  font-weight: 500;
}
.login-input {
  height: 44px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--l-border);
  border-radius: 8px;
  background: var(--l-field);
  color: var(--l-foreground);
  font: 400 15px/1 var(--l-sans);
  transition: border-color 0.15s;
}
.login-input:hover {
  border-color: var(--l-border-hover);
}
/* The browser's autofill paints its own (yellow or blue) fill; keep the field's. */
.login :is(.login-input, .input):autofill {
  -webkit-text-fill-color: var(--l-foreground);
  box-shadow: 0 0 0 40px var(--l-field) inset;
  caret-color: var(--l-foreground);
}
.login :is(.login-input, .input):autofill:focus-visible {
  box-shadow:
    0 0 0 40px var(--l-field) inset,
    0 0 0 3px color-mix(in srgb, var(--l-focus) 18%, transparent);
}
.login-input::placeholder {
  color: var(--l-placeholder);
  opacity: 1;
}
.login-input:focus-visible {
  outline: none;
  border-color: var(--l-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-focus) 18%, transparent);
}
.login-input[aria-invalid="true"] {
  border-color: var(--l-danger);
}
.login-code {
  font: 400 22px/1 var(--l-display);
  letter-spacing: 0.32em;
}
.login-error {
  margin: 0;
  color: var(--l-danger);
  font-size: 13px;
}
.login-error:empty {
  display: none;
}

/* Buttons: one ink button per step; after "or", the other ways in as white buttons as wide as it. */
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  width: 100%;
  margin-top: 6px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--l-primary);
  color: var(--l-primary-foreground);
  font: 600 15px/1 var(--l-sans);
  cursor: pointer;
  transition: opacity 0.15s;
}
.login-btn:hover {
  opacity: 0.88;
}
.login-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-or {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 17px 0;
  color: var(--l-muted-foreground);
  font-size: 13px;
  line-height: 1;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--l-rule);
}
.login-alts {
  display: grid;
  gap: 8px;
}
.login-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--l-border);
  border-radius: 8px;
  background: var(--l-field);
  color: var(--l-foreground);
  font: 500 14px/1 var(--l-sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.login-alt:hover {
  border-color: var(--l-border-hover);
  background: var(--l-hover);
}
.login-alt:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-alt svg {
  width: 16px;
  height: 16px;
}
.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 20px;
}
/* Text links: "Request access", "Forgot password?", and the steps' links below the form. */
.login-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--l-accent);
  font: 500 13px/1.5 var(--l-sans);
  text-decoration: none;
  cursor: pointer;
}
.login-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-link.quiet {
  color: var(--l-muted-foreground);
  font-weight: 400;
}
.login-link.quiet:hover {
  color: var(--l-foreground);
}
.login-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 26px;
  padding-top: 16.5px;
  border-top: 1px solid var(--l-rule);
  color: var(--l-muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}
.login :is(.login-btn, .login-alt, .login-link):focus-visible {
  outline: 2px solid var(--l-focus);
  outline-offset: 2px;
}

/* The invitation page (members.js) builds its form from the app's parts (.field, .input, .hint, .btn,
   .error-text); inside this frame they take the same look as the login form's. */
.login .field {
  display: grid;
  gap: 3px;
}
.login .field label {
  font-size: 13px;
  font-weight: 500;
}
.login .hint {
  margin: 0;
  color: var(--l-muted-foreground);
  font-size: 13px;
  line-height: 1.5;
}
.login .error-text {
  margin: 0;
  color: var(--l-danger);
  font-size: 13px;
}
.login .error-text:empty {
  display: none;
}
.login .input {
  height: 44px;
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--l-border);
  border-radius: 8px;
  background: var(--l-field);
  color: var(--l-foreground);
  font: 400 15px/1 var(--l-sans);
}
.login .input::placeholder {
  color: var(--l-placeholder);
}
.login .input.mono {
  font:
    400 13px/1 ui-monospace,
    monospace;
}
.login .input:focus-visible {
  outline: none;
  border-color: var(--l-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-focus) 18%, transparent);
}
.login .input[aria-invalid="true"] {
  border-color: var(--l-danger);
}
.login .row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.login .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--l-border);
  border-radius: 8px;
  background: var(--l-field);
  color: var(--l-foreground);
  font: 500 14px/1 var(--l-sans);
  cursor: pointer;
  white-space: nowrap;
}
.login .btn svg {
  width: 14px;
  height: 14px;
}
.login .btn[data-variant="default"] {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border-radius: 7px;
  border-color: var(--l-primary);
  background: var(--l-primary);
  color: var(--l-primary-foreground);
  font-weight: 600;
  font-size: 15px;
}
.login .btn:hover {
  opacity: 0.88;
}
.login .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Phones: the card takes the width, the painting stays behind it. */
@media (max-width: 599px) {
  .login {
    padding: 16px;
  }
  .login-art img {
    object-position: 74% 50%;
  }
  .login-card {
    width: 100%;
    padding: 28px 24px;
  }
  .login-main {
    margin-top: 24px;
  }
  .login h1 {
    font-size: 30px;
  }
}
