/* Login Screen (/login/) — built on the shared theme (Shared/theme.css):
 * a title-screen hero on the left, the account panel on the right. */

.login-page {
  overflow-x: hidden;
}

.login-sound {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-nav);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  width: min(1280px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding: clamp(28px, 6vh, 72px) clamp(20px, 5vw, 72px);
}

/* ================================================================ hero === */

.login-hero {
  position: relative;
  min-width: 0;
}
/* An electric halo behind the title and the cards. */
.login-hero::before {
  content: '';
  position: absolute;
  inset: -18% -12% -22% -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 46% at 72% 74%, rgb(0 174 255 / 0.17), transparent 70%),
    radial-gradient(46% 38% at 22% 30%, rgb(200 150 62 / 0.09), transparent 70%);
}

.login-eyebrow {
  margin: 0;
}

.login-title {
  margin: 14px 0 18px;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: 0.98;
  letter-spacing: 0.02em;
}

.login-lead {
  max-width: 46ch;
  margin: 0 0 clamp(20px, 4vh, 36px);
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--text-dim);
}

.login-hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-muted);
}
.login-feature strong {
  display: block;
  margin-bottom: 1px;
  font: 700 var(--fs-md) / 1.3 var(--font-heading);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--brass-light);
}

/* Riveted brass disc with a neon glyph (mask) inside. */
.login-feature-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgb(200 150 62 / 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1d3a45, #0a171c 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 0 14px rgb(0 174 255 / 0.18);
}
.login-feature-icon::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--neon-light);
  filter: drop-shadow(0 0 4px rgb(0 174 255 / 0.8));
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.login-feature-icon--pack {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M5 3h14v18H5z'/%3E%3Cpath d='M5 8l3-2 3 2 3-2 3 2 2-1.3'/%3E%3Cpath d='M12 11.5l1.4 2.9 3.1.4-2.3 2.1.6 3.1-2.8-1.6-2.8 1.6.6-3.1-2.3-2.1 3.1-.4z' fill='%23000' stroke-width='1'/%3E%3C/svg%3E");
}
.login-feature-icon--deck {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='8' y='3' width='12' height='16' rx='2'/%3E%3Cpath d='M5 6.5v12.5a2 2 0 0 0 2 2h9'/%3E%3C/svg%3E");
}
.login-feature-icon--bolt {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 1.5L4 14h6.5L9 22.5 20 9.5h-6.8z' fill='%23000'/%3E%3C/svg%3E");
}

/* A hand of three cards, fanned. */
.login-fan {
  --fan-w: clamp(118px, 10.5vw, 158px);
  position: relative;
  width: calc(var(--fan-w) * 2.15);
  height: calc(var(--fan-w) * 1.62);
}
/* A slowly turning brass turbine ring with a neon rim behind the hand. */
.login-fan::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 52%;
  width: calc(var(--fan-w) * 2.3);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 0 84%, rgb(0 174 255 / 0.6) 85% 86.2%, transparent 87.5% 100%),
    repeating-conic-gradient(rgb(200 150 62 / 0.2) 0 4deg, transparent 4deg 12deg);
  -webkit-mask: radial-gradient(closest-side, transparent 0 84%, #000 84.5% 99%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 0 84%, #000 84.5% 99%, transparent 100%);
  filter: drop-shadow(0 0 12px rgb(0 174 255 / 0.35));
  transform: translate(-50%, -50%);
  animation: login-turbine 60s linear infinite;
}
@keyframes login-turbine {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.login-fan-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--fan-w);
  margin-left: calc(var(--fan-w) / -2);
  transform-origin: 50% 120%;
  transition: transform var(--dur-slow) var(--ease-snap);
  animation: login-deal 520ms var(--ease-out) backwards;
}
.login-fan-card > .card {
  box-shadow: 0 22px 44px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(0 0 0 / 0.5);
}
.login-fan-card:nth-child(1) {
  --fan-t: rotate(-15deg) translateX(-8%);
  transform: var(--fan-t);
}
.login-fan-card:nth-child(2) {
  --fan-t: translateY(-10%);
  z-index: 1;
  transform: var(--fan-t);
  animation-delay: 90ms;
}
.login-fan-card:nth-child(2) > .card {
  box-shadow: 0 26px 54px rgb(0 0 0 / 0.6), 0 0 36px rgb(0 174 255 / 0.28);
}
.login-fan-card:nth-child(3) {
  --fan-t: rotate(15deg) translateX(8%);
  transform: var(--fan-t);
  animation-delay: 180ms;
}
.login-fan-card:hover {
  z-index: 2;
  transform: var(--fan-t) translateY(-8%) scale(1.04);
}
@keyframes login-deal {
  from {
    opacity: 0;
    transform: translateY(30%) rotate(0deg) scale(0.9);
  }
}

/* =============================================================== panel === */

.login-card {
  position: relative;
  width: 100%;
  padding: 26px 28px 24px;
}

.login-checking {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 340px;
  color: var(--text-dim);
}

.login-form {
  display: flex;
  flex-direction: column;
}

.login-tabs .tab {
  flex: 1;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-4);
}

.login-intro {
  margin-bottom: -4px;
}
.login-heading {
  margin: 0 0 2px;
  font-size: var(--fs-xl);
  color: var(--brass-pale);
}
.login-subheading {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.login-next {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--neon);
  border-radius: var(--radius-xs);
  font-size: var(--fs-sm);
  color: var(--neon-light);
  background: rgb(0 174 255 / 0.08);
}

.login-form-error {
  animation: login-shake 320ms var(--ease-out);
}
@keyframes login-shake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Password input with the show/hide button inside its right edge. */
.login-password {
  position: relative;
}
.login-password .input {
  padding-right: 46px;
}
.login-reveal {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}
.login-reveal:where(:not(:disabled)):hover,
.login-reveal[aria-pressed='true'] {
  color: var(--neon-light);
}
.login-reveal:focus-visible {
  outline-offset: 0;
}
.login-reveal svg {
  width: 19px;
  height: 19px;
}

.login-caps {
  color: var(--warning);
}

/* An error takes the place of the field's hint. */
.field.has-error .field-hint:not(.login-caps) {
  display: none;
}

.login-submit {
  margin-top: 4px;
}

.login-switch {
  margin: 0;
  font-size: var(--fs-sm);
  text-align: center;
  color: var(--text-muted);
}
.login-switch-btn {
  padding: 2px 4px;
  border: 0;
  border-radius: var(--radius-xs);
  font: inherit;
  font-weight: 700;
  color: var(--neon-light);
  text-decoration: underline;
  text-decoration-color: rgb(127 216 255 / 0.45);
  text-underline-offset: 0.18em;
  background: none;
  cursor: pointer;
}
.login-switch-btn:where(:not(:disabled)):hover {
  color: #b9eaff;
  text-decoration-color: currentColor;
}
.login-switch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-noscript {
  position: fixed;
  inset: auto 16px 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  text-align: center;
  background: var(--bg-2);
}

/* ========================================================== responsive === */

/* Short landscape screens (1280×720 and similar): tighten the hero. */
@media (min-width: 901px) and (max-height: 800px) {
  .login-title {
    margin: 10px 0 12px;
    font-size: clamp(44px, 5vw, 70px);
  }
  .login-lead {
    font-size: var(--fs-md);
  }
  .login-fields {
    gap: var(--space-3);
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: start;
    padding-top: 64px;
  }
  .login-hero {
    text-align: center;
  }
  /* The hero spans the whole width here: a halo reaching past its sides
     would widen the page (sideways scrolling on phones). */
  .login-hero::before {
    inset-inline: 0;
  }
  .login-lead {
    margin-inline: auto;
  }
  .login-hero-lower {
    display: none;
  }
  .login-card {
    max-width: 440px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 20px 18px;
  }
  .login-tabs .tab {
    padding-inline: 8px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
}
