/* Aulama ID sign in and sign up, November 2026 layout.
   One real photograph behind one glass card. Replaces auth-layout-20260930.css,
   v5/journey.css and login-readability-20261011.css; loads after aulama.css and
   app.css, which still style the form controls. Scoped to body.auth-v3. */

/* ------------------------------------------------------------------ type */
.auth-v3 { --auth-rounded-font: "Aulama Round Latin", "Aulama Round HK", "PingFang TC", sans-serif; }
html[lang^="zh"] .auth-v3 { --auth-rounded-font: "Aulama Round HK", "Aulama Round Latin", "PingFang TC", sans-serif; }
html:is([lang="zh-CN"], [lang="zh-Hans"]) .auth-v3 { --auth-rounded-font: "Aulama Round CN", "Aulama Round Latin", "PingFang SC", sans-serif; }
.auth-v3, .auth-v3 :is(button, input, select, textarea) { font-family: var(--auth-rounded-font); }
.auth-v3 { font-weight: 500; }

/* ------------------------------------------------------------------ page */
.auth-v3 {
  --auth-gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --auth-card-bg: rgba(255, 255, 255, .8);
  --auth-foot-ink: #fff;
  --auth-foot-shadow: 0 1px 8px rgba(0, 0, 0, .45);
  --auth-veil: rgba(4, 8, 16, .08);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #0b1220;
}
:root[data-theme="dark"] .auth-v3 { --auth-card-bg: rgba(12, 16, 24, .72); --auth-veil: rgba(2, 4, 10, .22); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-v3 { --auth-card-bg: rgba(12, 16, 24, .72); --auth-veil: rgba(2, 4, 10, .22); }
}
/* photos with a pale foot get dark small print */
:root[data-auth-photo-ink="dark"] .auth-v3 { --auth-foot-ink: #12202e; --auth-foot-shadow: 0 1px 8px rgba(255, 255, 255, .55); }

/* ------------------------------------------------------------------ photo */
.auth-photo {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--photo-tone, #1a2433);
  transition: background-color .6s var(--ease);
}
.auth-photo picture {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .9s var(--ease), transform 2.4s var(--ease);
}
.auth-photo picture.is-ready { opacity: 1; transform: none; }
.auth-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--photo-pos, 50% 50%);
}
.auth-photo::after { content: ""; position: absolute; inset: 0; background: var(--auth-veil); }
@media (prefers-reduced-motion: reduce) {
  .auth-photo picture { transform: none; transition: opacity .4s linear; }
}

/* ------------------------------------------------------------------ header */
.auth-v3 .auth-header {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  padding: max(16px, env(safe-area-inset-top, 0px)) var(--auth-gutter) 0;
  animation: none;
}
.auth-v3 .auth-header::before { content: none; }
.auth-v3 .auth-header .brand { display: block; line-height: 0; }
.auth-v3 .auth-header .brand img {
  width: 132px;
  max-width: none;
  height: auto;
  margin: -4px 0;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)) drop-shadow(0 1px 10px rgba(255, 255, 255, .55));
}
:root[data-theme="dark"] .auth-v3 .auth-header .brand img { filter: drop-shadow(0 1px 10px rgba(0, 0, 0, .35)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-v3 .auth-header .brand img { filter: drop-shadow(0 1px 10px rgba(0, 0, 0, .35)); }
}
/* the site hides this under 480px (it lives in the menu there); here it stays */
.auth-v3 .auth-header .theme-button { display: inline-grid; width: 40px; height: 40px; }

/* ------------------------------------------------------------------ stage */
.auth-v3 .auth-stage {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 24px var(--auth-gutter);
  gap: 0;
}
.auth-v3 .auth-card {
  width: min(100%, 400px);
  margin-block: auto;
  gap: 24px;
  padding: 32px;
  border-radius: 24px;
  --lg-blur: 28px;
  background: var(--auth-card-bg);
  animation: rise-in .8s var(--ease) .05s backwards;
}

/* heading */
.auth-v3 :is(.login-message, .register-copy) { gap: 4px; }
.auth-v3 .register-kicker { display: none; }
.auth-v3 :is(.login-heading, .register-title) {
  gap: 4px 12px;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -.01em;
  font-weight: 700;
}
.auth-v3 :is(.login-heading-logo, .register-title img) { height: 24px; }
.auth-v3 :is(.login-tagline, .register-tagline) { font-size: 14px; line-height: 20px; min-height: 20px; }

/* form */
.auth-v3 :is(.login-panel, .register-panel) { gap: 16px; }
.auth-v3 .panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.auth-v3 :is(.login-options, .register-options) { gap: 12px; }
.auth-v3 .login-options label:not(.remember-login-choice),
.auth-v3 .register-options label:not(.agreement-line) { gap: 4px; }
.auth-v3 .login-options label > span:first-child,
.auth-v3 .register-options label > span:first-child { font-size: 14px; line-height: 20px; }
.auth-v3.auth-page :is(input[type="email"], input[type="password"], input[type="text"]) {
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 16px;
}
.auth-v3 .auth-password-field input { padding-right: 48px; }
.auth-v3 .auth-password-toggle { right: 4px; bottom: 4px; width: 40px; height: 40px; border-radius: 8px; }

/* keep me signed in, then one full width primary button */
.auth-v3 :is(.login-commit-row, .register-commit-row) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.auth-v3 .remember-login-copy strong { font-size: 14px; line-height: 20px; }
.auth-v3 .remember-login-copy small { font-size: 12px; line-height: 16px; }
.auth-v3 .agreement-line { font-size: 14px; line-height: 20px; }
.auth-v3 :is(.email-login-button, .register-submit) {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 650;
}
.auth-v3 :is(.email-login-button, .register-submit):active { transform: scale(.98); }
.auth-v3 :is(.login-divider, .register-divider) { font-size: 12px; line-height: 16px; }

/* Passkey and Google side by side when both labels fit, otherwise stacked;
   Google alone fills the row */
.auth-v3 .auth-alt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-v3 .auth-alt-row > button { flex: 1 1 auto; width: auto; min-width: 0; }
.auth-v3 .auth-alt-row > button > span:first-child { flex: none; }
.auth-v3 :is(.passkey-login-button, .google-login-button, .google-register-button) {
  height: 48px;
  gap: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.auth-v3 :is(.passkey-login-button, .google-login-button, .google-register-button):active { transform: scale(.98); }
.auth-v3 .login-secondary-actions { align-items: center; }
.auth-v3 :is(.login-inline-link, .register-footer a) { font-size: 14px; line-height: 20px; padding: 4px 0; }
.auth-v3 :is(.login-error, .register-error) { font-size: 14px; line-height: 20px; }
.auth-v3 :is(.login-error, .register-error):empty { display: none; }

/* human check */
.auth-v3 .turnstile-zone { gap: 12px; padding: 0; }
.auth-v3 .turnstile-copy { font-size: 14px; line-height: 20px; }

/* the image overlays its initial; it must not create a second grid row */
.auth-v3 .device-account-avatar { position: relative; }
.auth-v3 .device-account-avatar > span { grid-area: 1 / 1; }
.auth-v3 .device-account-avatar > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ footer */
.auth-v3 .auth-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  margin: 0;
  padding: 0 var(--auth-gutter) max(16px, env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--auth-foot-ink);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  text-shadow: var(--auth-foot-shadow);
}
.auth-v3 .auth-foot a { color: inherit; text-decoration: none; }
.auth-v3 .auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-v3 .auth-foot a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }
.auth-photo-credit { display: inline-flex; align-items: center; gap: 4px; }
.auth-photo-credit:empty { display: none; }
.auth-photo-credit svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ sizes */
/* phones */
@media (max-width: 480px) {
  .auth-v3 .auth-header .brand img { width: 112px; }
  .auth-v3 .auth-stage { padding-top: 16px; padding-bottom: 16px; }
  .auth-v3 .auth-card { gap: 16px; padding: 24px 20px; }
}
@media (max-width: 379px) {
  .auth-v3 .auth-card { padding: 20px 16px; }
  .auth-v3 .turnstile-shell { width: 100%; height: 60px; min-height: 60px; }
  .auth-v3 #turnstile-widget { width: 300px; transform: scale(.9); transform-origin: top center; }
  .auth-v3 .remember-login-copy small { display: none; }
}
/* short screens: phones on their side, short laptop windows. The card turns
   wide and shallow: paired fields, so the whole form fits without scrolling. */
@media (max-height: 560px) and (orientation: landscape) {
  .auth-v3 .auth-header { padding-top: max(8px, env(safe-area-inset-top, 0px)); }
  .auth-v3 .auth-header .brand img { width: 104px; }
  .auth-v3 .auth-header .theme-button { width: 36px; height: 36px; }
  .auth-v3 .auth-stage { padding-top: 8px; padding-bottom: 8px; }
  .auth-v3 .auth-card { width: min(100%, 640px); gap: 12px; padding: 16px 24px 20px; }
  .auth-v3 :is(.login-message, .register-copy) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
  .auth-v3 :is(.login-heading, .register-title) { font-size: 20px; line-height: 28px; }
  .auth-v3 :is(.login-heading-logo, .register-title img) { height: 20px; }
  .auth-v3 :is(.login-panel, .register-panel) { gap: 12px; }
  .auth-v3 :is(.login-options, .register-options) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; }
  .auth-v3 :is(.login-options, .register-options) > * { grid-column: 1 / -1; }
  .auth-v3.auth-page :is(input[type="email"], input[type="password"], input[type="text"]) { height: 44px; }
  .auth-v3 :is(.email-login-button, .register-submit, .passkey-login-button, .google-login-button, .google-register-button) { height: 44px; }
  .auth-v3 .auth-password-toggle { bottom: 2px; }
  /* sign in: email | password, keep signed in | sign in, passkey | google, links */
  .auth-v3 .login-options > label:has(#email) { grid-column: 1; }
  .auth-v3 .login-options > label:has(#password) { grid-column: 2; }
  .auth-v3 .login-commit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 16px; }
  .auth-v3 .remember-login-copy small { display: none; }
  .auth-v3 :is(.login-divider, .register-divider) { margin-block: 2px; }
  /* sign up: name | email, password | confirm, their notes under each */
  .auth-v3 .register-options > label:has(#display-name) { grid-column: 1; grid-row: 1; }
  .auth-v3 .register-options > label:has(#email) { grid-column: 2; grid-row: 1; }
  .auth-v3 .register-options > label:has(#password) { grid-column: 1; grid-row: 2; }
  .auth-v3 .register-options > label:has(#password-confirm) { grid-column: 2; grid-row: 2; }
  .auth-v3 .register-options > .auth-password-meter { grid-column: 1; grid-row: 3; margin-top: 0; }
  .auth-v3 .register-options > .auth-password-match { grid-column: 2; grid-row: 3; margin: 0; }
  .auth-v3 .register-options > .auth-password-hint,
  .auth-v3 .register-options > .register-divider { display: none; }
  .auth-v3 .register-options { row-gap: 6px; }
  .auth-v3 .register-commit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; margin-top: 4px; }
  .auth-v3 .register-options > .google-register-button { grid-column: 1; }
  .auth-v3 .register-options > .register-footer { grid-column: 2; align-self: center; }
}
/* upright tablets */
@media (min-width: 700px) and (orientation: portrait) {
  .auth-v3 .auth-card { width: min(100%, 440px); padding: 40px; }
  .auth-v3 .auth-header .brand img { width: 148px; }
}
/* large screens: the same card, a little larger */
@media (min-width: 1600px) and (min-height: 900px) {
  .auth-v3 .auth-card { width: min(100%, 440px); padding: 40px; }
  .auth-v3 .auth-header .brand img { width: 148px; }
}
@media (min-width: 2200px) and (min-height: 1200px) {
  .auth-v3 .auth-card { zoom: 1.15; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-v3 .auth-card { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .auth-v3 .auth-card { background: var(--bg); }
}
