/* Sign-in page — Sovereign palette + ambient glow from base.css.
 * tokens.css and base.css are injected before this file by /sign-in.
 */

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  /* base.css already sets background: var(--bg) and the body::before ambient glow */
}

/* ── Full-viewport split ────────────────────────────────────────────────────── */

.sign-in-page {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1; /* sit above body::before ambient (z-index: 0) */
}

/* ── Left column: marketing copy ───────────────────────────────────────────── */

.col-left {
  background: var(--surface); /* translucent so ambient shows through */
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2.75rem 3rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.col-left-header {
  flex-shrink: 0;
  margin-bottom: 3rem;
}

.brand {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}

.col-left-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
}

.welcome-title {
  font-size: 1.3125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 1.5rem;
}

.welcome-body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-2);
}

.welcome-body p {
  margin-bottom: 0.9rem;
}

.welcome-body strong {
  color: var(--text);
  font-weight: 600;
}

.welcome-list {
  margin: 0.4rem 0 1rem 1.1rem;
}

.welcome-list li {
  margin-bottom: 0.55rem;
}

.col-left-footer {
  flex-shrink: 0;
  padding-top: 2.5rem;
  font-size: var(--text-xs);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.col-left-footer a {
  color: var(--text-3);
  text-decoration: none;
}

.col-left-footer a:hover { color: var(--text-2); }

.footer-sep { color: var(--text-3); opacity: 0.6; }

/* ── Right column: auth form ───────────────────────────────────────────────── */

.col-right {
  background: transparent; /* let the body's ambient glow shimmer through */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.col-right-body {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#clerk-sign-in {
  width: 100%;
}

.error-msg {
  color: var(--red);
  font-size: 0.875rem;
}

.loading-msg {
  color: var(--text-3);
  font-size: var(--text-base);
}

.legal-notice {
  font-size: 0.6875rem;
  color: var(--text-3);
  line-height: 1.5;
}

.legal-notice a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-notice a:hover { color: var(--accent); }

/* ── Clerk badge repositioned below card ───────────────────────────────────── */

.cl-rootBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cl-card { order: 1; }

.cl-badge {
  order: 2;
  position: static !important;
  transform: none !important;
  margin-top: 0.75rem;
  opacity: 0.4;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .sign-in-page {
    grid-template-columns: 1fr;
  }

  .col-left {
    display: none;
  }

  .col-right {
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
    padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .col-right-body {
    max-width: 360px;
    gap: 0.65rem;
  }

  .legal-notice {
    font-size: 0.625rem;
    line-height: 1.45;
  }

  .cl-badge {
    margin-top: 0.45rem;
  }

  /* Clerk widget — tighter mobile rhythm (scoped to sign-in host) */
  #clerk-sign-in .cl-card {
    padding: 1rem 0.875rem !important;
  }

  #clerk-sign-in .cl-headerTitle {
    font-size: 1.125rem !important;
    line-height: 1.25 !important;
  }

  #clerk-sign-in .cl-headerSubtitle {
    font-size: 0.75rem !important;
  }

  #clerk-sign-in .cl-socialButtonsBlockButton {
    min-height: 2.125rem !important;
    padding-block: 0.35rem !important;
  }

  #clerk-sign-in .cl-socialButtonsBlockButtonText {
    font-size: 0.8125rem !important;
  }

  #clerk-sign-in .cl-formButtonPrimary {
    min-height: 2.25rem !important;
    font-size: 0.8125rem !important;
    padding-block: 0.4rem !important;
  }

  #clerk-sign-in .cl-formFieldInput {
    min-height: 2.125rem !important;
    font-size: 0.875rem !important;
    padding-block: 0.4rem !important;
  }

  #clerk-sign-in .cl-formFieldLabel {
    font-size: 0.6875rem !important;
  }

  #clerk-sign-in .cl-footer {
    padding-top: 0.65rem !important;
  }

  #clerk-sign-in .cl-footerAction,
  #clerk-sign-in .cl-footerActionText,
  #clerk-sign-in .cl-footerActionLink {
    font-size: 0.8125rem !important;
  }

  #clerk-sign-in .cl-dividerText {
    font-size: 0.6875rem !important;
  }
}
