@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

.auth-page,
.error-page {
  --visual-ink: #07120f;
  --visual-panel: rgba(8, 21, 17, .82);
  --visual-line: rgba(208, 255, 237, .14);
  --visual-mint: #a7f3d0;
  --visual-green: #35bd8b;
  --visual-cyan: #7cebd0;
  --visual-text: #f3fbf7;
  --visual-muted: rgba(224, 242, 234, .68);
  isolation: isolate;
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--visual-text);
  font-family: 'DM Sans', 'Manrope', 'Inter', sans-serif;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(32, 164, 116, .24), transparent 34%),
    radial-gradient(ellipse at 92% 78%, rgba(25, 115, 105, .22), transparent 35%),
    radial-gradient(ellipse at 50% 110%, rgba(26, 82, 65, .34), transparent 50%),
    linear-gradient(145deg, #06110e 0%, #091913 48%, #07120f 100%) !important;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 100svh;
  padding: clamp(72px, 10vh, 108px) 20px 52px !important;
  overflow-y: auto;
}

.auth-page::before,
.auth-page::after,
.error-page::before,
.error-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.auth-page::before,
.error-page::before {
  width: min(72vw, 820px);
  aspect-ratio: 1;
  top: -34%;
  left: -28%;
  border: 1px solid rgba(167, 243, 208, .13);
  border-radius: 50%;
  box-shadow:
    0 0 0 22px rgba(167, 243, 208, .025),
    0 0 0 64px rgba(167, 243, 208, .018),
    inset 0 0 90px rgba(42, 189, 139, .08);
  animation: visualOrbit 34s linear infinite;
}

.auth-page::after,
.error-page::after {
  width: clamp(180px, 30vw, 390px);
  aspect-ratio: 1;
  right: -9%;
  bottom: -16%;
  border: 1px solid rgba(124, 235, 208, .18);
  border-radius: 42% 58% 64% 36% / 44% 34% 66% 56%;
  background:
    radial-gradient(circle at 34% 32%, rgba(167, 243, 208, .42), transparent 4%),
    radial-gradient(circle at 58% 58%, rgba(53, 189, 139, .23), transparent 65%);
  box-shadow: 0 0 100px rgba(42, 189, 139, .16), inset 0 0 70px rgba(124, 235, 208, .09);
  animation: visualBlob 11s ease-in-out infinite alternate;
}

.auth-page.page-loaded,
.error-page.page-loaded {
  opacity: 1;
}

.auth-page .card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: none;
  overflow: visible;
  padding: clamp(28px, 5vw, 46px);
  color: var(--visual-text);
  border: 1px solid var(--visual-line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), transparent 42%),
    var(--visual-panel);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, .58),
    0 0 0 1px rgba(255, 255, 255, .025),
    inset 0 1px 0 rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  backdrop-filter: blur(26px) saturate(135%);
  animation: visualCardIn .85s cubic-bezier(.18,.8,.2,1) both;
}

.auth-page .card::before {
  top: -20px;
  right: 28px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #042017;
  border: 1px solid rgba(220, 255, 239, .72);
  border-radius: 18px 50% 50%;
  background: linear-gradient(145deg, #d0ffe5, #55d7a4 62%, #20a879);
  box-shadow: 0 8px 26px rgba(38, 207, 142, .36), 4px 5px 0 rgba(124, 235, 208, .26);
  animation: visualCharm 5s ease-in-out infinite;
}

.auth-page .brand {
  margin-bottom: 30px;
}

.auth-page .brand-logo {
  filter: drop-shadow(0 0 16px rgba(89, 231, 173, .35));
}

.auth-page .brand-name {
  color: var(--visual-mint);
  letter-spacing: .14em;
}

.auth-page h1 {
  color: #f4fff9;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.auth-page .subtitle {
  color: var(--visual-muted);
  line-height: 1.7;
}

.auth-page .field label {
  color: rgba(197, 232, 214, .77);
  letter-spacing: .11em;
}

.auth-page .field input,
.auth-page input:not([type="hidden"]) {
  color: #f5fff9;
  border: 1px solid rgba(207, 255, 230, .16);
  border-radius: 14px;
  background: rgba(1, 10, 7, .42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease, transform .25s ease;
}

.auth-page .field input::placeholder,
.auth-page input:not([type="hidden"])::placeholder {
  color: rgba(216, 238, 226, .35);
}

.auth-page .field input:focus,
.auth-page input:not([type="hidden"]):focus {
  border-color: rgba(124, 235, 208, .8);
  outline: 0;
  background: rgba(4, 23, 16, .78);
  box-shadow: 0 0 0 4px rgba(53, 189, 139, .15), 0 0 28px rgba(53, 189, 139, .09);
  transform: translateY(-1px);
}

.auth-page .email-chip {
  color: var(--visual-mint);
  border-color: rgba(124, 235, 208, .24);
  background: rgba(53, 189, 139, .09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.auth-page .btn-primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(211, 255, 235, .26);
  border-radius: 14px;
  color: #052318;
  background: linear-gradient(110deg, #a9f4d0 0%, #57dca7 44%, #28b77f 100%);
  box-shadow: 0 10px 28px rgba(36, 190, 129, .23), inset 0 1px 0 rgba(255,255,255,.55);
  font-weight: 800;
  transition: transform .2s ease, box-shadow .25s ease, filter .25s ease;
}

.auth-page .btn-primary::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -60%;
  left: -45%;
  width: 35%;
  height: 220%;
  background: rgba(255,255,255,.5);
  filter: blur(9px);
  transform: rotate(20deg);
  transition: left .65s cubic-bezier(.2,.7,.2,1);
}

.auth-page .btn-primary:hover {
  opacity: 1;
  transform: translateY(-2px);
  filter: saturate(1.12);
  box-shadow: 0 14px 36px rgba(36, 190, 129, .36), inset 0 1px 0 rgba(255,255,255,.62);
}

.auth-page .btn-primary:hover::after {
  left: 125%;
}

.auth-page .btn-primary:active {
  transform: translateY(0) scale(.99);
}

.auth-page .forgot-link,
.auth-page .signin-row a,
.auth-page .register-row a,
.auth-page .login-row a {
  color: var(--visual-mint);
  text-decoration-color: rgba(167, 243, 208, .3);
  text-underline-offset: 4px;
  transition: color .2s ease, text-shadow .2s ease;
}

.auth-page .forgot-link:hover,
.auth-page .signin-row a:hover,
.auth-page .register-row a:hover,
.auth-page .login-row a:hover {
  color: #fff;
  text-shadow: 0 0 18px rgba(124, 235, 208, .45);
}

.auth-page .divider {
  border-color: rgba(207, 255, 230, .12);
}

.auth-page .back-btn {
  z-index: 2;
  color: rgba(236, 255, 245, .86);
  border: 1px solid rgba(207, 255, 230, .16);
  border-radius: 999px;
  background: rgba(6, 20, 14, .64);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.auth-page .back-btn:hover {
  border-color: rgba(124, 235, 208, .45);
  background: rgba(23, 73, 52, .75);
  transform: translateY(-2px);
}

.auth-page .eye-btn {
  color: rgba(216, 244, 229, .65);
}

.auth-page .eye-btn:hover {
  color: var(--visual-mint);
}

.auth-page .error-box {
  border: 1px solid rgba(255, 133, 147, .3);
  border-radius: 14px;
  color: #ffdce0;
  background: rgba(111, 24, 43, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.auth-page .card .field,
.auth-page .card .email-chip,
.auth-page .card .signin-row,
.auth-page .card .login-row,
.auth-page .card .register-row {
  animation: visualRise .55s both;
  animation-delay: .16s;
}

.auth-page .card .field:nth-of-type(2) { animation-delay: .22s; }
.auth-page .card .field:nth-of-type(3) { animation-delay: .28s; }
.auth-page .card .field:nth-of-type(4) { animation-delay: .34s; }

.error-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  height: auto;
  padding: 0;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(32, 164, 116, .2), transparent 34%),
    radial-gradient(ellipse at 92% 78%, rgba(25, 115, 105, .18), transparent 35%),
    linear-gradient(145deg, #06110e 0%, #091913 48%, #07120f 100%) !important;
}

.error-page > header,
.error-page > nav {
  z-index: 5;
}

.error-page .error-section {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(780px, calc(100% - 40px));
  align-self: center;
  margin: clamp(108px, 16vh, 160px) auto 48px;
  padding: clamp(42px, 8vw, 84px) 28px;
  overflow: hidden;
  border: 1px solid rgba(207, 255, 230, .15);
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(44, 178, 126, .14), transparent 54%),
    linear-gradient(145deg, rgba(255,255,255,.045), transparent 46%),
    rgba(8, 21, 17, .75);
  box-shadow: 0 34px 100px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  animation: visualCardIn .9s cubic-bezier(.18,.8,.2,1) both;
}

.error-page .error-section::before {
  content: "";
  position: absolute;
  top: -110px;
  left: 50%;
  width: min(60vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(167, 243, 208, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(167, 243, 208, .025), 0 0 80px rgba(53,189,139,.12);
  transform: translateX(-50%);
  animation: visualOrbit 28s linear infinite;
  pointer-events: none;
}

.error-page .error-code {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  color: transparent;
  background: linear-gradient(125deg, #e1fff0 4%, #87edc0 34%, #39c68d 66%, #bdffe2 96%);
  background-clip: text;
  -webkit-background-clip: text;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: clamp(88px, 20vw, 176px);
  font-style: normal;
  font-weight: 800;
  letter-spacing: -.105em;
  line-height: .9;
  text-shadow: 0 18px 70px rgba(41, 204, 139, .22);
  transform-origin: center;
  animation: visualCode 4.8s ease-in-out infinite;
}

.error-page .error-section h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  color: var(--visual-text);
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: clamp(28px, 6vw, 46px);
  font-style: normal;
  font-weight: 800;
  letter-spacing: -.055em;
  text-shadow: none;
}

.error-page .error-section p {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin: 0 auto 30px;
  color: var(--visual-muted);
  font-size: 15px;
  line-height: 1.8;
}

.error-page .error-section > div[style] {
  position: relative;
  z-index: 1;
  gap: 12px !important;
}

.error-page .btn-primary,
.error-page .btn-ghost {
  min-width: 140px;
  border: 1px solid rgba(207, 255, 230, .18);
  border-radius: 14px;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
}

.error-page .btn-primary {
  color: #052318;
  background: linear-gradient(110deg, #a9f4d0, #57dca7 55%, #28b77f);
  box-shadow: 0 10px 28px rgba(36, 190, 129, .23), inset 0 1px 0 rgba(255,255,255,.45);
}

.error-page .btn-ghost {
  color: var(--visual-text);
  background: rgba(255,255,255,.055);
}

.error-page .btn-primary:hover,
.error-page .btn-ghost:hover {
  transform: translateY(-3px);
}

.error-page .btn-primary:hover {
  box-shadow: 0 14px 36px rgba(36, 190, 129, .36);
}

.error-page .btn-ghost:hover {
  background: rgba(53,189,139,.13);
}

.error-page footer,
.error-page .site-chrome-footer {
  position: relative;
  z-index: 2;
  color: rgba(224, 242, 234, .58);
}

.error-page .error-nav-links a,
.error-page .error-menu-toggle {
  border-color: rgba(207, 255, 230, .15);
  background: rgba(8, 21, 17, .68);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.error-page .error-nav-links a:hover,
.error-page .error-menu-toggle:hover {
  border-color: rgba(124, 235, 208, .42);
  background: rgba(35, 122, 85, .42);
  transform: translateY(-1px);
}

@keyframes visualOrbit {
  to { transform: rotate(360deg); }
}

@keyframes visualBlob {
  0% { transform: translate3d(0, 0, 0) rotate(-12deg); }
  100% { transform: translate3d(-28px, -24px, 0) rotate(18deg); }
}

@keyframes visualCardIn {
  from { opacity: 0; transform: translate3d(0, 28px, 0) scale(.97); filter: blur(10px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes visualRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes visualCharm {
  0%, 100% { transform: rotate(10deg) translateY(0); }
  50% { transform: rotate(17deg) translateY(-5px); }
}

@keyframes visualCode {
  0%, 100% { transform: translateY(0) rotate(-2deg) scale(1); }
  50% { transform: translateY(-9px) rotate(2deg) scale(1.025); }
}

@media (max-width: 540px) {
  .auth-page {
    align-items: flex-start;
    padding: 82px 16px 38px !important;
  }

  .auth-page .card {
    width: 100%;
    padding: 34px 24px 28px;
    border-radius: 23px;
  }

  .auth-page .back-btn {
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
  }

  .error-page .error-section {
    width: calc(100% - 32px);
    margin: 104px auto 28px;
    padding: 54px 20px;
    border-radius: 24px;
  }

  .error-page .btn-primary,
  .error-page .btn-ghost {
    min-width: 128px;
    padding: 12px 20px;
  }
}

.auth-flow-page {
  height: auto !important;
  min-height: 100%;
  overflow-x: clip !important;
  overflow-y: auto !important;
}

.auth-flow-page body.auth-page {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 460px);
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 7vw, 104px);
  width: 100%;
  height: auto !important;
  min-height: 100svh;
  padding: clamp(84px, 10vh, 108px) clamp(28px, 7vw, 96px) 52px !important;
  overflow: visible !important;
}

.auth-flow-page .auth-sidebar {
  position: relative;
  z-index: 1;
  justify-self: end;
  width: min(100%, 520px);
  animation: visualRise .8s .08s both;
}

.auth-flow-page .auth-sidebar-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--visual-mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-flow-page .auth-sidebar-kicker > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #71edb7;
  box-shadow: 0 0 18px rgba(113, 237, 183, .8);
}

.auth-flow-page .auth-sidebar h2 {
  max-width: 560px;
  margin-bottom: 20px;
  color: #f4fff9;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: 1.04;
  text-wrap: balance;
}

.auth-flow-page .auth-sidebar > p {
  max-width: 430px;
  color: var(--visual-muted);
  font-size: 16px;
  line-height: 1.8;
}

.auth-flow-page .auth-sidebar-benefits {
  display: grid;
  gap: 14px;
  margin: 30px 0 0;
  padding: 0;
  color: rgba(235, 250, 241, .88);
  list-style: none;
}

.auth-flow-page .auth-sidebar-benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.auth-flow-page .auth-sidebar-benefits li > span {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(167, 243, 208, .28);
  border-radius: 50%;
  color: var(--visual-mint);
  background: rgba(53, 189, 139, .12);
  font-size: 13px;
}

.auth-flow-page .auth-sidebar-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  color: rgba(215, 244, 229, .62);
  font-size: 13px;
}

.auth-flow-page .auth-sidebar-note > span {
  color: var(--visual-mint);
  font-size: 18px;
}

.auth-flow-page .card {
  justify-self: start;
  width: 100%;
  max-width: 460px;
}

@media (max-width: 820px) {
  .auth-flow-page body.auth-page {
    grid-template-columns: minmax(0, 460px);
    align-content: start;
    justify-items: center;
    gap: 28px;
    padding: 92px 20px 44px !important;
  }

  .auth-flow-page .auth-sidebar {
    justify-self: center;
    width: min(100%, 460px);
  }

  .auth-flow-page .auth-sidebar-kicker {
    margin-bottom: 14px;
  }

  .auth-flow-page .auth-sidebar h2 {
    margin-bottom: 12px;
    font-size: clamp(30px, 7vw, 44px);
  }

  .auth-flow-page .auth-sidebar > p {
    font-size: 14px;
    line-height: 1.65;
  }

  .auth-flow-page .auth-sidebar-benefits {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
    margin-top: 20px;
  }

  .auth-flow-page .auth-sidebar-benefits li {
    font-size: 12px;
  }

  .auth-flow-page .auth-sidebar-note {
    display: none;
  }

  .auth-flow-page .card {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after,
  .error-page *,
  .error-page *::before,
  .error-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
