/* Sign-in dialog refinement v1 (2026-10-21). Loaded last; every rule is scoped to #authGate so the id outranks the older
   class layers in home-v529.css. Same visual language as the Home page: Geist text, mono labels, one neutral palette,
   10px controls, a quiet focus ring, solid primary actions. */

html body #authGate {
  --auth-text: #f1f3f1;
  --auth-text-2: rgba(241, 243, 241, 0.74);
  --auth-text-3: rgba(241, 243, 241, 0.56);
  --auth-line: rgba(241, 243, 241, 0.13);
  --auth-field: rgba(241, 243, 241, 0.035);
  --auth-solid: #eef1ee;
  --auth-on-solid: #0a0b0b;
  --auth-sans: "Geist Local", "Geist", Arial, sans-serif;
  --auth-mono: "Departure Mono Local", ui-monospace, monospace;
  font-family: var(--auth-sans);
}

/* ---- Frame ---- */
html body #authGate .auth-shell {
  border-color: var(--auth-line) !important;
  overflow: hidden !important;
}
@media (min-width: 881px) {
  html body #authGate .auth-shell {
    width: min(1080px, calc(100% - 48px)) !important;
    grid-template-columns: minmax(0, 1fr) 448px !important;
    border-radius: 20px !important;
  }
}

/* ---- Brand side: the Home showcase still behind the copy instead of an empty panel ---- */
html body #authGate .auth-brand-panel {
  position: relative !important;
  isolation: isolate;
  align-content: stretch !important;
  grid-template-rows: auto 1fr auto !important;
  gap: 24px !important;
  padding: 32px 36px 36px !important;
  border: 0 !important;
  border-right: 1px solid var(--auth-line) !important;
  border-radius: 0 !important;
  background:
    linear-gradient(180deg, rgba(7, 8, 8, 0.55) 0%, rgba(7, 8, 8, 0.12) 32%, rgba(7, 8, 8, 0.6) 62%, rgba(7, 8, 8, 0.94) 100%),
    url("/assets/showcase-hf-third-home.jpg") 58% 40% / cover no-repeat !important;
}
html body #authGate .auth-brand-panel::after { display: none !important; }
html body #authGate .auth-brand-lockup strong { color: var(--auth-text) !important; font: 600 16px/1.2 var(--auth-sans) !important; letter-spacing: 0 !important; }
html body #authGate .auth-brand-copy { align-self: end !important; display: grid !important; gap: 12px !important; max-width: 440px; }
html body #authGate .auth-brand-copy .eyebrow,
html body #authGate .auth-card-head .eyebrow {
  margin: 0 !important;
  color: var(--auth-text-3) !important;
  font: 400 11px/1.2 var(--auth-mono) !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}
html body #authGate .auth-brand-copy h2 {
  margin: 0 !important;
  color: var(--auth-text) !important;
  font: 500 36px/1.06 var(--auth-sans) !important;
  letter-spacing: -0.025em !important;
  text-wrap: balance;
}
html body #authGate .auth-brand-copy p:not(.eyebrow) {
  margin: 0 !important;
  color: var(--auth-text-2) !important;
  font: 400 15px/1.55 var(--auth-sans) !important;
  text-wrap: pretty;
}
html body #authGate .auth-feature-list { gap: 8px !important; }
html body #authGate .auth-feature-list span {
  padding: 6px 12px !important;
  border: 1px solid rgba(241, 243, 241, 0.2) !important;
  border-radius: 999px !important;
  background: rgba(7, 8, 8, 0.4) !important;
  color: var(--auth-text) !important;
  font: 500 12px/1.3 var(--auth-sans) !important;
  letter-spacing: 0 !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---- Form side ---- */
html body #authGate .auth-card {
  align-content: start !important;
  gap: 12px !important;
  padding: 28px 36px 24px !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-family: var(--auth-sans) !important;
}
/* Language menu and close button share the top row; the heading starts below it with room to breathe. */
html body #authGate .auth-card-head { gap: 8px !important; padding: 0 !important; }
html body #authGate .auth-card-head select {
  height: 36px !important;
  margin: 0 0 22px !important;
  border: 1px solid var(--auth-line) !important;
  border-radius: 10px !important;
  background-color: transparent !important;
  color: var(--auth-text) !important;
  font: 500 13px/1 var(--auth-sans) !important;
}
html body #authGate .auth-close-button {
  top: 28px !important;
  right: 36px !important;
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--auth-line) !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--auth-text) !important;
}
html body #authGate .auth-close-button svg { width: 18px !important; height: 18px !important; color: var(--auth-text) !important; stroke: currentColor !important; opacity: 1 !important; }
html body #authGate .auth-close-button:hover { border-color: rgba(241, 243, 241, 0.4) !important; background: rgba(241, 243, 241, 0.06) !important; }
html body #authGate .auth-card h2 {
  margin: 0 !important;
  color: var(--auth-text) !important;
  font: 600 26px/1.15 var(--auth-sans) !important;
  letter-spacing: -0.015em !important;
}
html body #authGate .auth-copy {
  margin: 2px 0 6px !important;
  color: var(--auth-text-2) !important;
  font: 400 14px/1.5 var(--auth-sans) !important;
  text-wrap: pretty;
}

/* Log in / Create account: one segmented control. */
html body #authGate .auth-tabs {
  gap: 4px !important;
  padding: 4px !important;
  border: 1px solid var(--auth-line) !important;
  border-radius: 12px !important;
  background: rgba(241, 243, 241, 0.03) !important;
}
html body #authGate .auth-tabs .segment {
  height: 34px !important;
  min-height: 34px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--auth-text-2) !important;
  font: 500 13px/1 var(--auth-sans) !important;
}
html body #authGate .auth-tabs .segment:not(.active):hover { color: var(--auth-text) !important; background: rgba(241, 243, 241, 0.05) !important; }
html body #authGate .auth-tabs .segment.active,
html body #authGate .auth-tabs .segment.active:hover,
html body #authGate .auth-tabs .segment.active:focus-visible {
  background: var(--auth-solid) !important;
  color: var(--auth-on-solid) !important;
}

html body #authGate #googleAuthButton {
  height: 44px !important;
  min-height: 44px !important;
  border: 1px solid var(--auth-line) !important;
  border-radius: 10px !important;
  background: var(--auth-field) !important;
  box-shadow: none !important;
  color: var(--auth-text) !important;
  font: 500 14px/1 var(--auth-sans) !important;
}
html body #authGate #googleAuthButton:not(:disabled):hover { border-color: rgba(241, 243, 241, 0.32) !important; background: rgba(241, 243, 241, 0.07) !important; }
html body #authGate .auth-divider span { color: var(--auth-text-3) !important; font: 400 12px/1 var(--auth-sans) !important; }

/* Fields */
html body #authGate .auth-card .label {
  margin: 6px 0 -4px !important;
  color: var(--auth-text-2) !important;
  font: 500 13px/1.3 var(--auth-sans) !important;
  letter-spacing: 0 !important;
}
html body #authGate .auth-card :is(input[type="text"], input[type="password"], input[type="email"]) {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(241, 243, 241, 0.16) !important;
  border-radius: 10px !important;
  background: var(--auth-field) !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--auth-text) !important;
  font: 400 14px/1 var(--auth-sans) !important;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
html body #authGate .auth-card :is(input[type="text"], input[type="password"], input[type="email"])::placeholder { color: var(--auth-text-3) !important; }
html body #authGate .auth-card :is(input[type="text"], input[type="password"], input[type="email"]):hover { border-color: rgba(241, 243, 241, 0.28) !important; }
html body #authGate .auth-card :is(input[type="text"], input[type="password"], input[type="email"]):focus {
  border-color: rgba(241, 243, 241, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(241, 243, 241, 0.1) !important;
  outline: none !important;
}
html body #authGate .auth-field-hint { color: var(--auth-text-2) !important; font: 400 12px/1.45 var(--auth-sans) !important; }

html body #authGate .auth-consent-row {
  gap: 10px !important;
  margin-top: 4px !important;
  color: var(--auth-text-2) !important;
  font: 400 13px/1.5 var(--auth-sans) !important;
}
html body #authGate .auth-consent-row input {
  width: 18px !important;
  height: 18px !important;
  margin: 1px 0 0 !important;
  accent-color: var(--auth-solid);
}
html body #authGate .auth-consent-row a { color: var(--auth-text) !important; font-weight: 500 !important; text-decoration: underline !important; text-decoration-color: rgba(241, 243, 241, 0.3) !important; text-underline-offset: 3px; }
html body #authGate .auth-consent-row a:hover { text-decoration-color: var(--auth-text) !important; }

/* Primary action: solid like the Home buttons; a clearly inactive look until the form can be sent. */
html body #authGate #authSubmit {
  height: 46px !important;
  min-height: 46px !important;
  margin-top: 4px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--auth-solid) !important;
  box-shadow: none !important;
  color: var(--auth-on-solid) !important;
  font: 600 15px/1 var(--auth-sans) !important;
}
html body #authGate #authSubmit:not(:disabled):hover { background: #ffffff !important; }
html body #authGate #authSubmit:disabled {
  background: rgba(241, 243, 241, 0.1) !important;
  color: var(--auth-text-3) !important;
  cursor: not-allowed !important;
}
html body #authGate .auth-message:not(:empty) { color: var(--auth-text-2) !important; font: 400 13px/1.45 var(--auth-sans) !important; }
html body #authGate .auth-legal-links { gap: 18px !important; margin-top: 4px !important; }
html body #authGate .auth-legal-links a { color: var(--auth-text-3) !important; font: 400 12px/1 var(--auth-sans) !important; }
html body #authGate .auth-legal-links a:hover { color: var(--auth-text) !important; }

@media (max-width: 880px) {
  html body #authGate .auth-brand-panel { min-height: 220px !important; border-right: 0 !important; border-bottom: 1px solid var(--auth-line) !important; }
  html body #authGate .auth-brand-copy h2 { font-size: 28px !important; }
}
@media (max-width: 620px) {
  html body #authGate .auth-shell { width: 100% !important; border-radius: 0 !important; }
  html body #authGate .auth-card { padding: 16px 16px 24px !important; }
  html body #authGate .auth-close-button { top: 16px !important; right: 16px !important; }
  html body #authGate .auth-card-head select { margin-bottom: 18px !important; }
  html body #authGate .auth-card h2 { font-size: 24px !important; }
}

/* Busy: the button keeps its solid look, swaps its icon for a spinner and shows what is happening. */
html body #authGate #authSubmit.is-busy,
html body #authGate #authSubmit.is-busy:disabled {
  background: var(--auth-solid) !important;
  color: var(--auth-on-solid) !important;
  cursor: progress !important;
  pointer-events: none;
}
html body #authGate #authSubmit.is-busy svg,
html body #authGate #authSubmit.is-busy i { display: none !important; }
html body #authGate #authSubmit.is-busy::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-busy-spin 700ms linear infinite;
}
@keyframes auth-busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html body #authGate #authSubmit.is-busy::before { animation-duration: 2s; }
}

/* The close icon is drawn by the icon library after load; until then (or if it fails) a plain × keeps the button visible. */
html body #authGate .auth-close-button:not(:has(svg))::before { content: "\00d7"; color: var(--auth-text); font: 400 22px/1 var(--auth-sans); }

/* Chinese, Japanese and Korean headings without the tight Latin tracking. */
html:is([lang^="zh"], [lang="ja"], [lang="ko"]) body #authGate :is(.auth-brand-copy h2, .auth-card h2) { letter-spacing: 0 !important; line-height: 1.25 !important; }
html:is([lang^="zh"], [lang="ja"], [lang="ko"]) body #authGate .auth-brand-copy h2 { font-size: 32px !important; }
