/*
 * Sign-in page (login.html) in grid v3: one plate on the hairline ground, the brand, a wide title, the choice between
 * creating an account and signing in as a switch (its thumb placed by space/space-seg.js), the e-mail code, Google and
 * the wallet; the main action is the one blue key. The language is the space's flag and menu (lang-flags.js). Tokens of v3.css;
 * [hidden] always wins (style.css); hover only under (hover: hover). Google's button keeps Google's own four colours.
 */
.page-login { background-color: var(--bg); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 84px 16px 32px; }
.login-card { width: 100%; max-width: 460px; padding: 30px 28px 28px; display: grid; gap: 14px; border: 0; }
.login-card h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.2rem); font-weight: 660; font-stretch: 118%; letter-spacing: -0.035em; line-height: 1.02; color: var(--ink); }
.login-card .lead { font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); }
.login-card label { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.login-card label.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.login-card .btn.primary { min-height: 52px; font-size: 1rem; margin: 4px 6px 9px; }
.brand-login { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-login .brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand-login .brand-name { display: inline; font-size: 1.15rem; font-weight: 660; font-stretch: 116%; letter-spacing: -0.015em; }
.already { display: grid; gap: 12px; }
.already .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.already .btn.primary { margin: 4px 6px 9px; }
.offline-box { display: grid; gap: 10px; padding: 14px 16px; border: 0; border-radius: 12px; color: var(--mood-watch); background: color-mix(in srgb, var(--mood-watch) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mood-watch) 32%, transparent); }
.offline-box .btn { color: var(--ink); }
.foot-login { justify-content: center; text-align: center; color: var(--ink-3); font-size: var(--t-xs); }

/* the language: the space's control (space/space-menus.js, put in place by lang-flags.js) where the space's top bar has it,
   at the end of the bar: the flag of the current language, its menu of the five languages under it */
.lang-float { position: absolute; top: 12px; inset-inline-end: calc(max(0px, (100% - var(--wrap-wide)) / 2) + var(--gutter)); z-index: 5; }
.lang-float .sp-round {
  appearance: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ink-2); cursor: pointer;
  background: transparent; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair-2); transition: box-shadow 0.2s;
}
.lang-float .sp-round[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--ring); }
.lang-float .sp-flag { flex: 0 0 auto; border-radius: 2px; box-shadow: 0 0 0 1px var(--hair-3); }
.lang-float .sp-lang-btn .sp-flag { width: 24px; height: 16px; }
.lang-float .sp-pop {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; display: grid; min-width: 240px; max-width: calc(100vw - 32px);
  padding: 6px; border-radius: 4px; background: var(--plate-bg), var(--bg); box-shadow: var(--plate-shadow);
}
.lang-float .sp-lang-list { display: grid; gap: 2px; }
.lang-float .sp-lang-row {
  appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; text-align: start;
  font: 560 var(--t-sm)/1.2 var(--f-sans); color: var(--ink); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.lang-float .sp-lang-name { flex: 1; min-width: 0; }
.lang-float .sp-lang-row .sp-icon { flex: 0 0 auto; color: var(--link); }
.lang-float .sp-lang-row[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ring); }

/* create an account / sign in: a switch */
.auth-mode { margin-bottom: 2px; }
.auth-intro { margin: -4px 0 4px; color: var(--ink-2); }
.auth-box { display: grid; gap: 10px; }
.auth-main { gap: 12px; }
.login-card .auth-connect { width: calc(100% - 12px); }
.auth-pick { display: grid; gap: 8px; }
.auth-wallets { display: grid; gap: 8px; }
.auth-wallet { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 48px; text-align: start; white-space: normal; }
.auth-wallet img { width: 20px; height: 20px; border-radius: 4px; flex: 0 0 auto; }
.auth-hint { display: grid; gap: 10px; justify-items: start; padding: 14px 16px; border: 0; border-radius: 12px; color: var(--ink-2); font-size: var(--t-sm); background: var(--cell); box-shadow: inset 0 0 0 1px var(--hair-2); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; color: var(--ink-3); font-size: var(--t-xs); font-weight: 560; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--hair-2); }
.auth-demo .eyebrow { margin: 0; font-size: var(--t-xs); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }

/* the e-mail code */
.auth-form { display: grid; gap: 8px; }
.auth-form .btn.primary { width: calc(100% - 12px); }
.auth-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-field { display: grid; gap: 8px; min-width: 0; }
.page-login :is(.text-input, select) {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; color: var(--ink); font: 500 15px var(--f-sans);
  background: linear-gradient(180deg, var(--well-top), var(--well-bottom)); box-shadow: inset 0 0 0 1px var(--hair-2), inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.page-login :is(.text-input, select):focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--ring), 0 0 0 3px var(--tint); }
.auth-form [aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--down); }
.auth-sent { margin: 0; }
.auth-sent b { color: var(--ink); word-break: break-all; }
.page-login .auth-code { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 22px; letter-spacing: 0.32em; text-align: center; min-height: 54px; direction: ltr; }
.auth-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.auth-terms { display: grid; }
.auth-terms a { color: var(--link); }
.auth-terms .note { margin: 0; color: var(--ink-3); line-height: 1.5; }
.auth-terms { gap: 10px; }
.login-card .auth-age { color: var(--ink); line-height: 1.45; }
.login-card .auth-age input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--link); }
.auth-restricted { margin: 6px 0 0; line-height: 1.5; }
.auth-restricted a { color: var(--link); }
.link-btn { justify-self: center; min-height: 44px; padding: 6px 4px; border: 0; background: none; color: var(--link); font: inherit; font-size: var(--t-sm); font-weight: 560; text-decoration: none; cursor: pointer; }
.link-btn:focus-visible, .gsi-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* "Sign in with Google", dark theme of Google's branding guidelines (developers.google.com/identity/branding-guidelines):
 * fill #131314, 1 px stroke #8E918F inside, text #E3E3E3, the standard-colour G (local file), 12 px before the G,
 * 10 px between the G and the text, 12 px after the text. These four colours are Google's, not the brand's. */
.gsi-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px;
  padding: 0 12px; border: 1px solid #8e918f; border-radius: 4px; background: #131314; color: #e3e3e3;
  font-family: "Google Sans", Roboto, var(--f-sans); font-size: 14px; line-height: 20px; font-weight: 500; cursor: pointer;
}
.gsi-btn:disabled { opacity: 0.6; cursor: progress; }
.gsi-g { width: 18px; height: 18px; flex: 0 0 auto; }

@media (hover: hover) {
  .gsi-btn:not(:disabled):hover { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08); }
  .link-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
  .lang-float .sp-round:not([aria-expanded="true"]):hover { box-shadow: inset 0 0 0 1px var(--hair-3); }
  .lang-float .sp-lang-row:hover { background: var(--surface-2); }
  .auth-wallet:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--ring); }
}
@media (max-width: 560px) {
  .lang-float { top: 8px; }                     /* the space's bar is 60px high there */
  .login { place-items: start center; }         /* from the top: the card grows downward as its keys arrive, it no longer jumps (CLS 0.35, stress test 2026-11-08) */
}
@media (max-width: 420px) {
  .login { padding-top: 76px; }
  .login-card { padding: 24px 18px 22px; }
  .auth-names { grid-template-columns: 1fr; }
}
/* a phone (audit 2026-11-20): no field under 16 px, else iOS Safari zooms the page when it takes the focus */
@media (pointer: coarse) {
  .page-login :is(.text-input, select):not(.auth-code) { font-size: 16px; }
}
