/* Login-only composition; the supplied background is bundled for offline use. */
/* Conceal the scrollbar, not the scrollable page: touch, wheel, keyboard and
   focus scrolling still reach long sign-up forms. Wallet pages stay unchanged. */
:root:has(#app > .token-auth),
body:has(#app > .token-auth) {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
:root:has(#app > .token-auth)::-webkit-scrollbar,
body:has(#app > .token-auth)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.token-auth {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color:#fff;
  overflow: clip;
}
.token-auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}
.token-auth-scene {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.auth-wave-drift {
  animation: auth-wave-drift-x 10s ease-in-out infinite;
}
@keyframes auth-wave-drift-x {
  0%, 100% { transform: translateX(-4.5px); }
  50% { transform: translateX(4.5px); }
}
.auth-wave-layer {
  transform-origin: 50% 100%;
  animation: auth-wave-sway 10s ease-in-out infinite;
  animation-delay: -2.5s;
}
@keyframes auth-wave-sway {
  0%, 100% { transform: translateY(10.5px) rotate(-.42deg) scale(1.022); }
  50% { transform: translateY(-10.5px) rotate(.42deg) scale(1.022); }
}
.auth-shield-rim {
  stroke-dasharray: 95 405;
  animation: auth-shield-outline-shine 4s linear infinite;
}
.auth-shield-rim-glow { opacity: .85; }
.auth-shield-rim-core { opacity: .8; }
.auth-shield-rim-highlight { opacity: .95; stroke-dasharray: 42 458; }
@keyframes auth-shield-outline-shine {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1000; }
}
.token-auth[data-motion="paused"] .auth-scene-animated { animation-play-state: paused; }
.token-auth .token-auth-motion-toggle {
  padding: 6px 9px;
  background: transparent;
  border: 1px solid #ffffff26;
  border-radius: 6px;
  color:#fff;
  font-size: 11px;
}
.token-auth .token-auth-motion-toggle:hover { border-color: var(--accent); color:#fff; }
.token-auth .token-auth-motion-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  /* The requested preview stays animated, at a gentler pace, with a pause control. */
  .auth-wave-drift, .auth-wave-layer { animation-duration: 14s; }
  .auth-wave-layer { animation-delay: -3.5s; }
  .auth-shield-rim { animation-duration: 6s; }
}
.token-auth-header,
.token-auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 48px;
}
.token-auth-header { justify-content: flex-end; }
.token-auth-brand { display: flex; align-items: center; gap: 18px; }
.token-auth-wordmark { font-size: 25px; font-weight: 750; letter-spacing: 3px; }
.token-auth-brand > span:last-child {
  padding-left: 18px;
  border-left: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  color:#fff;
  font-size: 11px;
  letter-spacing: .7px;
}
.token-auth-environment { display: none; align-items: center; gap: 8px; color:#fff; font-size: 11px; }
.token-auth-environment i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50.2%, transparent); }
.token-auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(32px, 5vw, 96px);
  padding: 30px clamp(32px, 5vw, 96px) 45px;
}
.token-auth .token-auth-hero-brand { justify-self: stretch; align-items: center; justify-content: center; text-align: center; }
.token-auth .token-auth-hero-brand .egety-lockup { --auth-brand-width: clamp(190px, 22vw, 320px); flex-direction: column; gap: 24px; }
.token-auth .token-auth-hero-brand .egety-logo { width: var(--auth-brand-width); }
.token-auth .token-auth-hero-brand .egety-lockup-copy { width: var(--auth-brand-width); align-items: center; gap: 12px; }
/* Match the emblem artwork width inside its original SVG viewbox. */
.token-auth .token-auth-hero-brand .egety-auth-wordmark { display: block; width: 94%; height: auto; overflow: visible; }
.token-auth .token-auth-hero-brand .egety-auth-wordmark text { fill: #fff; font-family: inherit; font-size: 250px; font-weight: 750; letter-spacing: 22px; }
.token-auth .token-auth-hero-brand .egety-lockup-copy strong { font-size: clamp(36px, 3.5vw, 50px); letter-spacing: 7px; color:#fff; }
.token-auth .token-auth-hero-brand .egety-lockup-copy small { font-size: 16px; letter-spacing: 1.5px; color:#fff; }
.token-auth .login-panel {
  position: relative;
  width: 100%;
  max-width: 448px;
  padding: 36px;
  gap: 20px;
  background: var(--bg);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 28.24%, transparent), 0 0 80px color-mix(in srgb, var(--accent) 16.08%, transparent), 0 24px 64px #00000040;
}
/* Only clip while resizing; return to natural height for validation and reflow. */
.token-auth .login-panel[data-resizing="true"] {
  min-height: 0;
  overflow: clip;
  align-content: start;
  will-change: height;
}
/* A short, fading edge reflection catches the background's upper-left light. */
.token-auth .login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #ffffffb3 0%, color-mix(in srgb, var(--accent) 60%, #fff) 12%, color-mix(in srgb, var(--accent) 35%, transparent) 28%, transparent 48%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
/* Frosted login panel, with the opaque surface above as a browser fallback. */
@supports ((backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px))) {
  .token-auth .login-panel {
    background: radial-gradient(ellipse at top left, #ffffff14, #ffffff00 58%), linear-gradient(135deg, #ffffff0a, #ffffff00), color-mix(in srgb, var(--bg) 58%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    backdrop-filter: blur(18px) saturate(125%);
  }
}
.token-auth-intro { margin-bottom: 4px; text-align: center; }
.token-auth .auth-name-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 16px;
  min-width: 0;
}
.token-auth-eyebrow { display: block; margin-bottom: 18px; font-size: 9px; letter-spacing: 1.8px; font-weight: 600; color: var(--accent); }
.token-auth .login-panel h1 { font-family: 'Bahnschrift', 'Segoe UI', sans-serif; font-size: 32px; font-weight: 500; line-height: 1.25; letter-spacing: -.6px; color:#fff; text-wrap: balance; }
.token-auth .login-panel p { color:#fff; font-size: 12px; }
.token-auth .login-panel .token-auth-intro p { margin: 12px auto 0; max-width: 320px; font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 1.65; letter-spacing: .1px; text-wrap: balance; }
.token-auth .login-panel label { font-size: 12px; color:#fff; gap: 9px; }
.token-auth .login-panel input {
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--accent) 18.04%, transparent);
  border-radius: 10px;
  min-height: 48px;
  padding: 13px 14px;
  color:#fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.token-auth .login-panel input::placeholder { color:#fff; }
.token-auth .login-panel input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9.41%, transparent); }
.token-auth .login-panel input:autofill { box-shadow: 0 0 0 50px var(--bg) inset; -webkit-text-fill-color: #edf4ff; }
.token-auth .auth-switch { text-align: center; margin: 0!important; color:#fff!important; font-size: 12px!important; }
.token-auth .auth-switch .text-button { font-size: 12px; color: var(--accent); }
.token-auth .login-panel .token-auth-local { border-top: 1px solid color-mix(in srgb, var(--accent) 9.8%, transparent); padding-top: 18px; text-align: center; font-size: 10px; color:#fff; }
.token-auth .form-error:empty { display: none; }
.token-auth .login-panel[hidden] { display: none!important; }
/* Cleared secrets must not look like a validation failure while awaiting auth. */
:root body .token-auth .login-panel[data-submitting="true"] .wallet-field-outline { border-color: var(--accent); }
.token-auth .login-panel .form-error:not(:empty) { color: #ffd1cb; background: #492822; border-color: #c8776c; }
/* Both authentication modes share one type scale and the same control styling. */
:root body .token-auth .token-auth-intro h1 {
  font-family: 'Bahnschrift', 'Segoe UI', sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.6px;
}
:root body .token-auth .token-auth-intro p {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .1px;
}
.token-auth .auth-mode-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 4px 0 2px;
}
:root body .token-auth .auth-mode-switch .button {
  min-height: 42px;
  padding: 9px 21px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
:root body .token-auth .auth-mode-switch .button[aria-pressed="true"] {
  background: var(--accent);
  box-shadow: none;
  animation: none;
}
:root body .token-auth .auth-mode-switch .button[aria-pressed="true"]:hover:not(:active) {
  background: var(--accent);
  box-shadow: none;
  animation: none;
}
:root body .token-auth .login-panel > .button[type="submit"] { margin-top: 12px; }
:root body .token-auth .login-panel:has(input[name="confirm"]) > .button[type="submit"] { margin-top: 6px; }
.token-auth .auth-password-checklist { margin: 2px 0 0; }
.token-auth .login-panel .auth-password-checklist > p {
  margin: 0 0 7px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}
.token-auth .auth-password-checklist ul {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.token-auth .auth-password-checklist li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
}
.token-auth .password-rule-indicator { width: 10px; flex: 0 0 10px; font-weight: 700; }
.token-auth .auth-password-checklist li[data-state="met"] { color: var(--accent); }
.token-auth .auth-password-checklist li[data-state="unmet"] { color: #ff7b92; }
/* Authentication helpers retain the existing floating fields and glass panel. */
:root body .token-auth .auth-password-shell .wallet-field-input { padding-right: 52px; }
:root body .token-auth .auth-password-shell .wallet-field-label { max-width: calc(100% - 100px); }
:root body .token-auth .auth-password-eye {
 position: absolute; z-index: 3; right: 5px; top: 50%; transform: translateY(-50%);
 display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
 color: var(--accent); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.token-auth .auth-password-eye svg { width: 21px; height: 21px; pointer-events: none; }
.token-auth .auth-password-eye .password-eye-slash { display: none; }
.token-auth .auth-password-eye[aria-pressed="true"] .password-eye-slash { display: inline; }
.token-auth .auth-password-eye:focus-visible,
.token-auth .auth-password-options button:focus-visible,
.token-auth .auth-signin-options button:focus-visible,
.token-auth .auth-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.token-auth .auth-password-options,
.token-auth .auth-signin-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.token-auth .auth-password-options { margin-top: -5px; }
.token-auth .auth-password-options .text-button,
.token-auth .auth-signin-options .text-button,
.token-auth .auth-back { color: var(--accent); font-size: 12px; padding: 4px 0; }
.token-auth .login-panel .auth-remember { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.token-auth .login-panel .auth-remember input { width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.token-auth .login-panel .auth-remember-help { font-size: 11px; line-height: 1.5; margin: -10px 0 0; opacity: .8; }
.token-auth .login-panel .auth-password-suggestion { font-size: 11px; line-height: 1.5; margin: -10px 0 0; }
.token-auth .login-panel .auth-message { color: var(--accent); margin: 0; font-size: 12px; line-height: 1.5; }
.token-auth .auth-password-suggestion:empty,
.token-auth .auth-message:empty { display: none; }
.token-auth .auth-back { justify-self: center; }
/* The later shared button sheet must not turn these text actions into pills. */
:root body .token-auth #auth-form button.text-button {
 min-height: 32px; padding: 4px 0; border: 0; border-radius: 0;
 background: transparent; box-shadow: none; color: var(--accent);
 font-size: 12px; line-height: 1.5; animation: none; transform: none;
}
:root body .token-auth #auth-form button.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
:root body .token-auth #auth-form button.auth-back { justify-self: center; }
:root body .token-auth #auth-form button.auth-password-eye {
 background: transparent; border: 0; box-shadow: none; color: var(--accent);
 transform: translateY(-50%); animation: none;
}
@media (max-height: 850px) and (min-width: 801px) {
  :root body .token-auth .token-auth-intro h1 { font-size: 30px; line-height: 1.2; }
}
@media (max-width: 400px) {
  .token-auth .auth-mode-switch { gap: 12px; }
  :root body .token-auth .auth-mode-switch .button { padding-inline: 18px; }
  .token-auth .auth-password-checklist ul { column-gap: 8px; }
  .token-auth .auth-password-checklist li { font-size: 10px; gap: 4px; }
}
.token-auth-footer { font-size: 10px; color:#fff; padding-top: 20px; padding-bottom: 24px; }
/* Keep the longer brand subtitle legible in the existing wallet header. */
.topbar .brand-sub { letter-spacing: 1.5px; font-size: 8px; }
@media (max-width: 800px) {
  .token-auth-content { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 8px 24px 36px; }
  .token-auth .token-auth-hero-brand .egety-lockup { --auth-brand-width: 104px; gap: 14px; }
  .token-auth .token-auth-hero-brand .egety-logo { width: var(--auth-brand-width); }
  .token-auth .token-auth-hero-brand .egety-lockup-copy { gap: 7px; }
  .token-auth .token-auth-hero-brand .egety-lockup-copy strong { font-size: 28px; letter-spacing: 5px; }
  .token-auth .token-auth-hero-brand .egety-lockup-copy small { font-size: 12px; letter-spacing: 1px; }
}
@media (max-width: 600px) {
  :root body .token-auth .token-auth-intro h1 { font-size: 28px; }
  .token-auth-header { padding: 24px; align-items: flex-start; }
  .token-auth-brand { flex-direction: column; align-items: flex-start; gap: 6px; }
  .token-auth-brand > span:last-child { border: 0; padding: 0; font-size: 10px; }
  .token-auth-environment { margin-top: 7px; font-size: 10px; }
  .token-auth-content { padding: 12px 18px 30px; }
  .token-auth .login-panel { padding: 27px 24px; border-radius: 18px; }
  .token-auth .login-panel input { font-size: 16px; }
  .token-auth .login-panel .floating-email-label { font-size: 16px; }
  .token-auth .login-panel h1 { font-size: 28px; }
  .token-auth-footer { padding: 18px 24px 24px; flex-wrap: wrap; gap: 8px; }
  .token-auth-footer > span:last-child { display: none; }
}
/* Mobile starts near the top instead of reserving a full header grid row.
   The compact environment controls retain their place without covering text. */
@media (max-width: 800px) {
  :root body .token-auth { grid-template-rows: 1fr auto; }
  :root body .token-auth .token-auth-header {
    position: absolute;
    inset: 8px 18px auto;
    z-index: 2;
    min-height: 16px;
    padding: 0;
    gap: 8px;
    align-items: center;
  }
  :root body .token-auth .token-auth-environment { margin: 0; }
  :root body .token-auth .token-auth-content {
    padding-top: 36px;
    align-content: start;
  }
}
