.auth-portal {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 72px);
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px) 24px;
  background:
    radial-gradient(circle at 11% 10%, rgba(255, 255, 255, 0.94), transparent 20%),
    radial-gradient(circle at 84% 15%, rgba(130, 228, 255, 0.56), transparent 28%),
    radial-gradient(circle at 72% 86%, rgba(196, 92, 196, 0.42), transparent 30%),
    linear-gradient(136deg, #ece9f4 0%, #d9e8f4 30%, #c5b6dd 64%, #9d6cb4 100%);
}

.auth-portal::before {
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    conic-gradient(from 130deg at 34% 44%, transparent, rgba(102, 204, 237, 0.3), transparent 23%),
    conic-gradient(from 305deg at 69% 52%, transparent, rgba(134, 78, 190, 0.24), transparent 24%);
  filter: blur(46px);
  content: "";
  transform: rotate(-8deg);
}

.auth-portal::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.17) 1px, transparent 1px);
  background-size: 100% 96px;
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  opacity: 0.34;
  content: "";
}

.auth-portal__aurora {
  position: absolute;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 44% 56% 62% 38%;
  filter: blur(1px);
  opacity: 0.52;
}

.auth-portal__aurora--one {
  top: -25vw;
  right: -8vw;
  background: radial-gradient(circle at 35% 65%, rgba(255, 255, 255, 0.46), transparent 50%);
  transform: rotate(24deg);
}

.auth-portal__aurora--two {
  bottom: -34vw;
  left: -12vw;
  background: radial-gradient(circle at 70% 30%, rgba(118, 78, 192, 0.2), transparent 54%);
  transform: rotate(-20deg);
}

.auth-portal__grid {
  display: grid;
  width: min(570px, 100%);
  min-height: min(690px, calc(100svh - 150px));
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 38px;
  background: rgba(250, 250, 255, 0.38);
  box-shadow:
    0 42px 110px rgba(65, 51, 105, 0.25),
    inset 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(30px) saturate(140%);
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 46px;
  background:
    radial-gradient(circle at 72% 18%, rgba(103, 221, 246, 0.22), transparent 30%),
    linear-gradient(152deg, rgba(45, 45, 105, 0.96), rgba(82, 54, 138, 0.91) 52%, rgba(160, 73, 146, 0.83));
  color: #fff;
}

.auth-story::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 48%, rgba(255, 255, 255, 0.1) 49%, transparent 51%),
    radial-gradient(circle at 25% 92%, rgba(108, 217, 240, 0.25), transparent 32%);
  content: "";
}

.auth-story > img {
  position: relative;
  width: min(310px, 84%);
  height: auto;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(21, 21, 60, 0.18);
  backdrop-filter: blur(16px);
}

.auth-story__copy {
  position: relative;
  z-index: 1;
  margin-top: clamp(64px, 9vh, 106px);
}

.auth-story__copy span {
  color: #8feeff;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-story__copy h2 {
  max-width: 12ch;
  margin: 15px 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-story__copy p {
  max-width: 35ch;
  margin: 0;
  color: rgba(245, 244, 255, 0.74);
  font-size: 0.78rem;
  line-height: 1.65;
}

.auth-bond {
  position: relative;
  display: grid;
  width: 285px;
  margin: auto auto 30px;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  transform: perspective(620px) rotateX(58deg) rotateZ(-18deg);
}

.auth-bond::after {
  position: absolute;
  inset: -25%;
  z-index: -1;
  background: radial-gradient(circle, rgba(102, 226, 255, 0.28), transparent 65%);
  filter: blur(22px);
  content: "";
}

.auth-bond span {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(123, 215, 240, 0.07));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.32), 0 12px 24px rgba(25, 24, 74, 0.2);
}

.auth-bond span:nth-child(5),
.auth-bond span:nth-child(9) {
  margin-left: 36px;
}

.auth-bond span:nth-child(8),
.auth-bond span:nth-child(11) {
  margin-right: -36px;
}

.auth-story__status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.63rem;
  font-weight: 720;
}

.auth-story__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78f3de;
  box-shadow: 0 0 14px #78f3de;
}

.auth-card-wrap {
  display: grid;
  place-items: center;
  padding: clamp(30px, 5vw, 68px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(249, 247, 255, 0.62));
}

.auth-card {
  width: min(100%, 410px);
}

.auth-card__logo {
  display: block;
  width: min(250px, 76%);
  height: auto;
  margin: 0 auto 34px;
}

.auth-card header {
  margin-bottom: 26px;
}

.auth-card__eyebrow {
  margin: 0 0 9px;
  color: #7356c5 !important;
  font-size: 0.63rem !important;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  color: #292440;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 630;
  line-height: 1;
  letter-spacing: -0.055em;
}

.auth-card header > p:last-child {
  max-width: 43ch;
  margin: 13px 0 0;
  color: #6f6980;
  font-size: 0.72rem;
  line-height: 1.58;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form > label {
  display: grid;
  gap: 7px;
}

.auth-form > label > span {
  color: #494257;
  font-size: 0.64rem;
  font-weight: 780;
}

.auth-form input:not([type="checkbox"]) {
  width: 100%;
  height: 51px;
  padding: 0 17px;
  border: 1px solid rgba(83, 73, 115, 0.16);
  border-radius: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.88);
  color: #292440;
  font: inherit;
  font-size: 0.75rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:not([type="checkbox"]):focus {
  border-color: rgba(116, 78, 199, 0.56);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(120, 91, 205, 0.11), 0 10px 30px rgba(71, 56, 115, 0.08);
}

.auth-form input::placeholder {
  color: #aaa4b5;
}

.auth-form label small {
  color: #81798e;
  font-size: 0.59rem;
  line-height: 1.45;
}

.auth-form__hint {
  margin-top: -8px;
  color: #81798e;
  font-size: 0.57rem;
  line-height: 1.45;
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
  font-size: 0.62rem;
}

.auth-form__row a,
.auth-switch a {
  color: #6444ba;
  font-weight: 790;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6c6578;
}

.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: #7654ce;
}

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 3px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  background: linear-gradient(105deg, #5048ac, #7954cf 46%, #c95aa8);
  box-shadow: 0 16px 34px rgba(94, 64, 174, 0.25), inset 0 1px rgba(255, 255, 255, 0.42);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 820;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
  box-shadow: 0 20px 40px rgba(94, 64, 174, 0.34), inset 0 1px rgba(255, 255, 255, 0.48);
  transform: translateY(-2px);
}

.auth-submit span {
  font-size: 1rem;
}

:root[data-theme="dark"] .auth-portal {
  background:
    radial-gradient(circle at 14% 8%, rgba(56, 139, 190, 0.22), transparent 30%),
    radial-gradient(circle at 78% 88%, rgba(130, 67, 154, 0.22), transparent 34%),
    linear-gradient(142deg, #080c13 0%, #101728 45%, #171326 72%, #090b10 100%);
}

:root[data-theme="dark"] .auth-portal::after {
  background-image: linear-gradient(rgba(147, 190, 235, 0.07) 1px, transparent 1px);
}

:root[data-theme="dark"] .auth-portal__grid {
  border-color: rgba(152, 184, 226, 0.14);
  background: rgba(10, 14, 22, 0.6);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.48),
    inset 0 1px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .auth-card-wrap {
  background:
    radial-gradient(circle at 100% 0%, rgba(76, 137, 201, 0.14), transparent 22rem),
    linear-gradient(145deg, rgba(20, 25, 37, 0.98), rgba(13, 16, 25, 0.96));
}

:root[data-theme="dark"] .auth-card h1,
:root[data-theme="dark"] .auth-form > label > span {
  color: var(--text);
}

:root[data-theme="dark"] .auth-card header > p:last-child,
:root[data-theme="dark"] .auth-form label small,
:root[data-theme="dark"] .auth-form__hint,
:root[data-theme="dark"] .auth-check,
:root[data-theme="dark"] .auth-switch,
:root[data-theme="dark"] .auth-price-note {
  color: var(--muted);
}

:root[data-theme="dark"] .auth-form input:not([type="checkbox"]) {
  border-color: rgba(150, 177, 218, 0.17);
  background: var(--field-bg);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  color: var(--text);
}

:root[data-theme="dark"] .auth-form input:not([type="checkbox"]):focus {
  border-color: rgba(117, 170, 239, 0.58);
  background: linear-gradient(145deg, rgba(27, 37, 53, 0.98), rgba(17, 22, 34, 0.98));
  box-shadow: 0 0 0 4px rgba(92, 156, 224, 0.12), 0 14px 38px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .auth-form input::placeholder {
  color: #747e91;
}

:root[data-theme="dark"] .auth-story > img {
  border-color: rgba(161, 206, 235, 0.18);
  background: rgba(13, 19, 29, 0.7);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 15px;
  color: #9992a3;
  font-size: 0.59rem;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: rgba(89, 78, 115, 0.12);
  content: "";
}

.auth-provider {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(80, 71, 107, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.55);
  color: #393346;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 770;
}

.auth-provider--disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-provider__copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.auth-provider__copy strong {
  font-size: 0.68rem;
}

.auth-provider__copy small {
  color: #777080;
  font-size: 0.56rem;
  font-weight: 650;
}

.auth-provider__google {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  box-shadow: inset 0 0 0 6px #fff;
  color: transparent;
}

.auth-switch,
.auth-price-note {
  margin: 22px 0 0;
  color: #777080;
  font-size: 0.63rem;
  text-align: center;
}

.auth-price-note {
  margin-top: 15px;
  line-height: 1.5;
}

.auth-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 13px;
  font-size: 0.64rem;
  line-height: 1.5;
}

.auth-notice--error {
  border-color: rgba(186, 63, 102, 0.2);
  background: rgba(255, 232, 240, 0.72);
  color: #9c3157;
}

.auth-notice--success {
  border-color: rgba(39, 148, 122, 0.2);
  background: rgba(226, 250, 243, 0.72);
  color: #267b67;
}

.auth-code {
  font-size: 1.05rem !important;
  font-weight: 790 !important;
  letter-spacing: 0.18em;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-portal__aurora--one { animation: auth-float 12s ease-in-out infinite alternate; }
  .auth-portal__aurora--two { animation: auth-float 15s ease-in-out infinite alternate-reverse; }
}

@keyframes auth-float {
  to { transform: translate3d(3vw, -2vw, 0) rotate(7deg); }
}

@media (max-width: 840px) {
  .auth-portal__grid { grid-template-columns: minmax(0, 1fr); width: min(560px, 100%); }
  .auth-card-wrap { min-height: 650px; }
}

@media (max-width: 560px) {
  .auth-portal { padding: 18px 14px 32px; }
  .auth-portal__grid { border-radius: 28px; }
  .auth-card-wrap { min-height: 0; padding: 38px 24px 42px; }
  .auth-card__logo { width: min(235px, 80%); margin-bottom: 28px; }
  .auth-form__row { align-items: flex-start; flex-direction: column; gap: 9px; }
}
