/**
 * Call — sign-in and sign-up.
 *
 * Laid out to match chatapp.ai-sns.io: a site header across the top, then a
 * single centred card holding the form. The measurements are theirs
 * (max-width 440, 32px padding, 10px radius on inputs, stacked label/field
 * pairs with a 14px rhythm) so the two products feel like one suite; the
 * colours are ours, taken from theme.css tokens rather than hard-coded, so
 * these pages follow the light/dark toggle like everything else.
 */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--txt);
}

/* ---------------- header ---------------- */

.auth-header {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.auth-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.auth-nav .brand {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.auth-nav .brand img {
  height: 26px;
  display: block;
}

/* theme.css hides the wrong-mode lockup with `html[data-theme=x] .only-y`,
   which scores exactly the same as `.auth-nav .brand img` below — and loses
   only because this file loads later, so BOTH lockups rendered. Restated here
   with enough specificity to win. Third time this display-vs-[hidden]/theme
   class of bug has bitten: whenever a rule sets `display` on an element that
   something else toggles, check what it outranks. */
html[data-theme='light'] .auth-nav .only-dark,
html[data-theme='dark'] .auth-nav .only-light {
  display: none;
}


.auth-nav-links {
  display: flex;
  gap: 20px;
}

.auth-nav-links a {
  color: var(--txt-3);
  font-size: 13.5px;
  text-decoration: none;
}

.auth-nav-links a:hover {
  color: var(--txt);
}

.auth-nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------------- card ---------------- */

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  padding: 32px;
  box-shadow: var(--shadow, 0 18px 50px rgba(0, 0, 0, 0.22));
}

.auth-card h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.auth-card .muted {
  color: var(--txt-3);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.auth-card .center {
  text-align: center;
}

.auth-card .mt-3 {
  margin-top: 24px;
}

/* ---------------- fields ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-2);
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.field-head a {
  font-size: 13px;
  color: var(--violet);
  text-decoration: none;
}

.input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--film-1);
  border: 1px solid var(--line-2);
  color: var(--txt);
  font-size: 15px;
  font-family: inherit;
}

.input::placeholder {
  color: var(--txt-3);
}

.input:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

/* A password field with a reveal toggle inside it. */
.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 60px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--txt-3);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}

.pw-toggle:hover {
  color: var(--txt-2);
}

.auth-btn {
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  padding: 13px;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  color: var(--on-brand, #fff);
  background: var(--brand);
  cursor: pointer;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------------- messages ---------------- */

/* Both states reserve no space until used, but never shift the button once
   shown — the box is inserted above the form, not between the fields. */
.msg {
  display: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0;
}

.msg.on {
  display: block;
}

.msg.err {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent);
}

.msg.ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 32%, transparent);
}

.auth-foot {
  font-size: 14px;
  color: var(--txt-3);
}

.auth-foot a {
  color: var(--violet);
  text-decoration: none;
}

.auth-meta {
  font-size: 13px;
  color: var(--txt-3);
  margin: 14px 0 0;
}

/* Sign-in hints for the seeded demo accounts. Clearly separated so nobody
   mistakes them for part of the form. */
.demo-hint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--txt-3);
  line-height: 1.85;
}

.demo-hint b {
  color: var(--txt-2);
  font-weight: 600;
}

.demo-hint code {
  font-family: var(--font-m, ui-monospace, monospace);
  font-size: 11.5px;
  background: var(--film-1);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 1px 6px;
}

.demo-fill {
  border: 0;
  background: none;
  color: var(--violet);
  font: inherit;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 700px) {
  .auth-nav-links {
    display: none;
  }

  .auth-card {
    padding: 26px 20px;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ---------------- buttons ----------------
   The .btn family lives in lp.css, which these pages deliberately do not load
   (it is a whole landing page of styles for two header buttons). The handful
   actually used here are restated, matching lp.css so the header reads the
   same across the site. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13.5px;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  border-color: var(--line-2);
  color: var(--txt-2);
  background: var(--film-1);
}

.btn-outline:hover {
  color: var(--txt);
  border-color: var(--line-3);
}

/* ---------------- social sign-in ---------------- */

.sa-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--txt-3);
  font-size: 13px;
}

.sa-divider::before,
.sa-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--line-2);
}

.sa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--film-1);
  color: var(--txt);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.sa-btn:hover {
  border-color: var(--line-3);
  background: var(--film-2);
}

/* An author display rule outranks the UA's [hidden] { display:none }. */
.sa-btn[hidden] {
  display: none;
}

.sa-hint {
  font-size: 11.5px;
  color: var(--txt-3);
  text-align: center;
  margin-top: 6px;
  line-height: 1.55;
}

.sa-flow {
  margin-top: 16px;
}

.sa-flow[hidden] {
  display: none;
}

.sa-msg {
  font-size: 12.5px;
  color: var(--txt-3);
  line-height: 1.6;
  margin: 12px 0 0;
  /* The demo code is shown here; it must wrap rather than overflow the card. */
  overflow-wrap: anywhere;
}
