/*
 * Yeja Studios — Auth Surface Stylesheet (login, signup, reset-password)
 * Rebuilt 2026-07-18 on the shared apps/shared/design-tokens.css layer,
 * replacing the prior bespoke system (hardcoded hex, Plus Jakarta Sans
 * link, brutalist uppercase/letter-spaced type) — matches the same
 * consolidation done for apps/landing/public/landing.css. Keeps the
 * split-screen layout (dark story panel + light form panel) — a
 * deliberate, distinctive choice for this surface, restyled rather than
 * replaced with a generic centered card.
 */

@import url("/apps/shared/design-tokens.css");

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: var(--yeja-canvas);
  color: var(--yeja-text-primary);
  font-family: var(--font-family-base);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 24px;
}

a {
  color: inherit;
}

.auth-shell {
  width: min(100%, 1040px);
  display: grid;
  /* 2026-08-01: was 0.85fr story / minmax(340px, 0.55fr) panel — the
   * 10-field waitlist form got ~300px of content width while the story
   * panel was mostly empty, and the panel's intrinsically-wide selects
   * overflowed into .auth-shell's overflow:hidden clip (State/Province
   * select, theme toggle and submit button were cut off on the live
   * page). Rebalanced toward the form; minmax(0, …) on both tracks so
   * wide content can never widen a track past its share. */
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.7fr);
  min-height: 640px;
  border: 1px solid var(--yeja-border);
  border-radius: var(--radius-menu);
  background: var(--yeja-canvas-paper);
  overflow: hidden;
}

.auth-story {
  display: grid;
  align-content: space-between;
  gap: 24px;
  background: var(--yeja-gray-1000);
  color: var(--yeja-gray-0);
  padding: clamp(28px, 5vw, 64px);
}

html[data-theme="dark"] .auth-story {
  background: var(--yeja-gray-975);
}

/* Waitlist page (2026-08-02): the story copy sits directly under the
 * brand mark instead of space-between's stretch-to-fill layout, so it
 * reads top-left rather than vertically centered in the panel. */
.auth-story-top {
  align-content: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  text-decoration: none;
}

/* Real Yeja brand mark — ported verbatim from apps/platform/styles.css's
 * .brand-mark (the canonical implementation): a Crimson-bordered circle
 * with three color blobs faked via offset box-shadows, not a gradient disc. */
.brand-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--yeja-crimson);
  border-radius: 50%;
  box-shadow:
    4px 0 0 -1.4px var(--yeja-cobalt),
    -2.6px 3.3px 0 -1.4px var(--yeja-amber),
    1.3px -3.3px 0 -1.4px var(--yeja-mint);
}

.auth-story h1 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--font-family-base);
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-wrap: balance;
}

.auth-story p,
.muted {
  color: var(--yeja-text-muted);
}

.auth-story p {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(28px, 5vw, 54px);
}

.auth-panel-head {
  display: flex;
  /* wrap: the theme control is max-content and can't shrink — without
   * wrapping it forces the heading onto two lines (desktop) and widens
   * the whole card past the viewport (mobile). */
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--yeja-text-muted);
}

h2 {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

form {
  display: grid;
  gap: 14px;
}

/* display:grid above beats the UA's [hidden]{display:none}; waitlist.js
 * hides the form via the hidden attribute for the confirmation view. */
form[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--yeja-text-primary);
  font-size: 13.5px;
  font-weight: 500;
}

.label-text {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.required-asterisk {
  color: var(--yeja-crimson);
}

.field-row {
  display: grid;
  /* minmax(0, …), not bare 1fr: 1fr mins at auto, so a select sized to
   * its longest <option> (country names) widens the track and overflows
   * the clipped shell instead of shrinking. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.required-legend {
  margin: -4px 0 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--yeja-border-strong);
  border-radius: var(--radius-control);
  background: var(--yeja-canvas);
  color: var(--yeja-text-primary);
  padding: 0 14px;
  font: inherit;
  font-size: 15.5px;
  transition: border-color 0.15s ease-in-out;
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.field-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--yeja-text-muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: var(--yeja-text-muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--yeja-cobalt);
  outline-offset: 1px;
  border-color: var(--yeja-cobalt);
}

.password-row {
  position: relative;
  display: grid;
}

.password-row input {
  width: 100%;
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  min-height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--yeja-text-muted);
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 0 14px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--yeja-cobalt);
  background: transparent;
}

.forgot-link {
  margin: -6px 0 0;
  text-align: right;
  font-size: 13px;
}

.forgot-link a {
  color: var(--yeja-cobalt);
  font-weight: 500;
  text-decoration: none;
}

.forgot-link a:hover {
  text-decoration: underline;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--yeja-text-primary);
  font-size: 14px;
  font-weight: 400;
}

.check-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.button,
button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--yeja-text-primary);
  color: var(--yeja-canvas);
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  padding: 0 20px;
  text-decoration: none;
  transition: opacity 0.15s ease-in-out;
}

.button:hover,
button:hover {
  opacity: 0.85;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--yeja-text-primary);
  border: 1px solid var(--yeja-border-strong);
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] button.secondary {
  border-color: var(--yeja-text-muted);
}

.button.secondary:hover,
button.secondary:hover {
  background: var(--yeja-hover-tertiary);
  opacity: 1;
}

.yeja-theme-control.auth-theme-control {
  min-height: 42px;
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--yeja-border);
  border-radius: var(--radius-control);
  background: var(--yeja-canvas);
  padding: 3px;
}

.yeja-theme-label,
.yeja-theme-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-theme-control button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--yeja-text-muted);
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 0 0.75rem;
}

.auth-theme-control button:hover,
.auth-theme-control button:focus-visible,
.auth-theme-control button.is-active {
  border-color: var(--yeja-cobalt);
  background: var(--yeja-cobalt);
  color: #ffffff;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Waitlist post-submit / email-verified confirmation view (waitlist.js
 * swaps the form for this). */
.confirm-panel {
  display: grid;
  gap: 10px;
}

.confirm-panel[hidden] {
  display: none;
}

.status {
  min-height: 22px;
  color: var(--yeja-cobalt);
  font-size: 13.5px;
}

/* Username live-availability check (Username Addendum, 2026-07-26) —
 * same --yeja-crimson/--yeja-mint tokens apps/profile/styles.css's
 * .prof-form-error already uses for error state elsewhere. */
.status.is-error {
  color: var(--yeja-crimson);
}

.status.is-success {
  color: var(--yeja-mint);
}

@media (max-width: 800px) {
  .auth-shell {
    /* minmax(0, 1fr), not 1fr: bare 1fr mins at auto, so any
     * non-shrinking child (theme control) widens the card past the
     * viewport and clips at the screen edge. */
    grid-template-columns: minmax(0, 1fr);
    border-radius: var(--radius-card);
  }

  /* Compact story header on small screens (was min-height: 320px, which
   * pushed the form headline below the fold on phones). */
  .auth-story {
    min-height: 0;
    padding: 24px;
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
