/*
 * The sign-in page in makr.ai's landing look, matching the sign-in box in
 * moshi-ai (UI #636) so the box does not change look when this page loads
 * inside it.
 *
 * Colours, glow, wordmark, button and focus ring are copied from moshi-ai
 * prod-7: src/components/shared/AuthDialog.tsx (the box) and
 * src/components/marketing/living-landing/living-landing.css (--night,
 * --cream, --cream2, --gold, --ember, .btn-glass, .fine a). The face is Geist
 * (src/app/fonts/GeistVF.woff), the face the box itself renders in.
 *
 * The box shows this page in an iframe that fills it and is never wider than
 * 480px. Below 640px wide the page therefore paints exactly the box's
 * background and glow and no card of its own. Opened directly on a wider
 * screen, the card takes the box's look on the landing's night background.
 *
 * Display is left to the Tailwind utilities in the markup (flex, hidden):
 * signin.js shows and hides parts by toggling `hidden`, so nothing here sets
 * `display` on those parts.
 */

@font-face {
  font-family: "Geist";
  src: url("fonts/GeistVF.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --makr-night: #07080d;
  --makr-cream: #f4eee3;
  --makr-cream-2: rgba(244, 238, 227, 0.72);
  --makr-gold: #e8bc72;
  --makr-ember: #f07148;
  --makr-frame-line: rgba(244, 238, 227, 0.12);
  /* The warm glow under the box, as at the landing's close (AuthDialog). */
  --makr-frame-glow: radial-gradient(
      120% 70% at 50% 115%,
      rgba(240, 113, 72, 0.22),
      transparent 60%
    ),
    radial-gradient(90% 50% at 50% -10%, rgba(232, 188, 114, 0.08), transparent 70%);
  color-scheme: dark;
  background-color: var(--makr-night);
}

.auth-page {
  background: var(--makr-frame-glow), var(--makr-night);
  color: var(--makr-cream);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* Visible gold focus ring, as on the landing (.dark-focus) and the box. */
.auth-page :focus-visible {
  outline: 2px solid var(--makr-gold);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ card */
.auth-card {
  padding: 8px;
}
@media (min-width: 440px) {
  .auth-card {
    padding: 24px;
  }
}
@media (min-width: 640px) {
  .auth-page {
    background: radial-gradient(
        900px 520px at 50% 100%,
        rgba(222, 120, 60, 0.22),
        transparent 65%
      ),
      radial-gradient(700px 400px at 50% 0%, rgba(232, 188, 114, 0.06), transparent 60%),
      var(--makr-night);
  }
  .auth-card {
    padding: 48px 40px 40px;
    background: var(--makr-frame-glow), var(--makr-night);
    border: 1px solid var(--makr-frame-line);
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.75);
  }
}

/* ------------------------------------------------- wordmark + words */
.auth-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.auth-wordmark img {
  width: 30px;
  height: auto;
}
.auth-wordmark-tld {
  font-weight: 500;
  color: rgba(244, 238, 227, 0.6);
}

.auth-heading {
  margin-top: 24px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
}
.auth-lead {
  max-width: 21rem;
  margin: 8px auto 0;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  color: var(--makr-cream-2);
}

.auth-actions {
  margin-top: 28px;
}

/* ---------------------------------------------------------- buttons */
.auth-btn {
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 0.2s, border-color 0.2s;
}
/* The box's main button: cream on night, white on hover. */
.auth-btn-primary {
  background: var(--makr-cream);
  color: var(--makr-night);
}
.auth-btn-primary:hover:not(:disabled) {
  background: #fff;
}
/* The landing's glass button. */
.auth-btn-glass {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--makr-cream);
}
.auth-btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}
.auth-btn-glass:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -------------------------------------------------------- OR divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 238, 227, 0.6);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(244, 238, 227, 0.14);
}

/* ------------------------------------------------------------ input */
/* 16px text so iOS does not zoom on focus. The border keeps 3:1 against
   the night background so the field reads as a field. */
.auth-input {
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgba(244, 238, 227, 0.4);
  border-radius: 999px;
  background: rgba(244, 238, 227, 0.04);
  color: var(--makr-cream);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.auth-input::placeholder {
  color: rgba(244, 238, 227, 0.6);
  opacity: 1;
}
.auth-input:hover {
  border-color: rgba(244, 238, 227, 0.55);
}
.auth-input:focus {
  border-color: var(--makr-gold);
}
.auth-input:-webkit-autofill {
  -webkit-text-fill-color: var(--makr-cream);
  caret-color: var(--makr-cream);
  box-shadow: 0 0 0 100px #111218 inset;
}

/* ---------------------------------------------- after email is sent */
/* Styled by container, not by classes in its markup: the email-code
   sign-in (a separate branch) rewrites this block, and this keeps the two
   changes apart. Its old utility colour classes are overridden here. */
#verificationMessage p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--makr-cream-2);
}
#verificationMessage #sentEmailAddress {
  font-weight: 600;
  color: var(--makr-cream);
}
#emailErrorMessage {
  font-size: 14px;
  color: var(--makr-ember);
}

/* ---------------------------------------------------- terms + links */
.auth-fine {
  margin-top: 24px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--makr-cream-2);
}
.auth-link,
#verificationMessage a {
  color: var(--makr-cream);
  text-decoration: underline;
  text-decoration-color: rgba(244, 238, 227, 0.45);
  text-underline-offset: 3px;
}
.auth-link:hover,
#verificationMessage a:hover {
  text-decoration-color: currentColor;
}

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