:root {
  --auth-cyan: #00d7ef;
  --auth-blue: #2686ff;
  --auth-violet: #8e28ff;
  --auth-pink: #ec0870;
  --auth-green: #19e2a3;
}

body:not(.is-authenticated) {
  overflow: hidden;
}

body:not(.is-authenticated) > .skip-link {
  display: none;
}

.app-shell[aria-hidden="true"] {
  height: 100vh;
  overflow: hidden;
  visibility: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  min-width: 280px;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(22px, 5vw, 56px);
  background:
    linear-gradient(145deg, rgba(2, 5, 12, .88), rgba(5, 8, 20, .96)),
    radial-gradient(circle at 12% 12%, rgba(236, 8, 112, .28), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(0, 215, 239, .22), transparent 34%),
    #03050b;
  isolation: isolate;
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.auth-ambient {
  position: fixed;
  z-index: -1;
  width: min(52vw, 650px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .18;
  pointer-events: none;
}

.auth-ambient-one {
  top: -28%;
  left: -16%;
  background: linear-gradient(120deg, var(--auth-pink), var(--auth-violet));
}

.auth-ambient-two {
  right: -18%;
  bottom: -35%;
  background: linear-gradient(120deg, var(--auth-blue), var(--auth-green));
}

.auth-card {
  position: relative;
  width: min(100%, 510px);
  overflow: hidden;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(17, 23, 40, .9), rgba(5, 8, 17, .82));
  box-shadow: 0 38px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(30px) saturate(145%);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ffab16, var(--auth-pink), var(--auth-violet), var(--auth-cyan), var(--auth-green));
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-brand img {
  width: 184px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .42));
}

.auth-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #bdf8e5;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-green);
  box-shadow: 0 0 0 5px rgba(25,226,163,.1), 0 0 16px var(--auth-green);
}

.auth-card h1 {
  margin: 13px 0 0;
  font-size: clamp(1.8rem, 6vw, 2.65rem);
  line-height: 1.06;
  letter-spacing: -.045em;
  text-align: center;
}

.auth-card > p {
  max-width: 390px;
  margin: 15px auto 28px;
  color: #aab4c8;
  line-height: 1.6;
  text-align: center;
}

.auth-field {
  display: grid;
  gap: 9px;
  margin-top: 17px;
  color: #dce3f1;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .035em;
}

.auth-input-wrap {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-input-wrap:focus-within {
  border-color: rgba(0,215,239,.55);
  background: rgba(0,215,239,.055);
  box-shadow: 0 0 0 5px rgba(0,215,239,.08);
}

.auth-input-wrap > svg {
  flex: 0 0 auto;
  width: 21px;
  fill: none;
  stroke: #8190a9;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-input-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
}

.auth-show-password {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b98ae;
  cursor: pointer;
}

.auth-show-password:hover,
.auth-show-password:focus-visible {
  background: rgba(255,255,255,.08);
  color: #fff;
  outline: 0;
}

.auth-show-password svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-error {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255,73,106,.28);
  border-radius: 12px;
  background: rgba(255,73,106,.09);
  color: #ffc2ce;
  font-size: .8rem;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(110deg, #ffab16 0%, var(--auth-pink) 31%, var(--auth-violet) 57%, var(--auth-blue) 78%, var(--auth-green) 100%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(92, 31, 235, .3);
  font-weight: 850;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.09);
}

.auth-submit:focus-visible {
  outline: 3px solid rgba(0,215,239,.95);
  outline-offset: 4px;
}

.auth-submit:disabled {
  opacity: .64;
  cursor: wait;
  transform: none;
}

.auth-submit svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
  color: #748198;
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}

.auth-security svg {
  flex: 0 0 auto;
  width: 18px;
  fill: none;
  stroke: var(--auth-cyan);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-privacy {
  position: fixed;
  right: 24px;
  bottom: 20px;
  color: #7f8ca2;
  font-size: .76rem;
  text-decoration: none;
}

.auth-privacy:hover,
.auth-privacy:focus-visible {
  color: #bff8ff;
}

@media (max-width: 560px) {
  .auth-gate {
    align-items: center;
    padding: 18px;
  }

  .auth-card {
    padding: 27px 20px 24px;
    border-radius: 24px;
  }

  .auth-brand {
    margin-bottom: 16px;
  }

  .auth-brand img {
    width: 150px;
    height: 84px;
  }

  .auth-card > p {
    margin-bottom: 22px;
    font-size: .9rem;
  }

  .auth-input-wrap,
  .auth-submit {
    min-height: 53px;
  }

  .auth-privacy {
    position: static;
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit {
    transition: none;
  }
}
