@view-transition {
  navigation: auto;
}

.auth-section {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 80px);
  padding: 48px 16px;
  overflow: hidden;
  background: #f6f7fb;
  color: #1e2330;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

.auth-section::before,
.auth-section::after {
  position: absolute;
  z-index: -1;
  width: 265px;
  height: 265px;
  border-radius: 48% 52% 62% 38% / 45% 55% 45% 55%;
  content: '';
  pointer-events: none;
}

.auth-section::before {
  top: -115px;
  left: -105px;
  background: linear-gradient(145deg, #2b47c9, #5b43d6 65%, #724ce0);
  box-shadow: 0 20px 45px rgba(59, 73, 206, 0.14);
}

.auth-section::after {
  right: -110px;
  bottom: -120px;
  background: linear-gradient(135deg, #4b23b3, #6d28d9 60%, #7c3aed);
  box-shadow: 0 -16px 40px rgba(91, 33, 182, 0.16);
}

.auth-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(920px, 100%);
  view-transition-name: auth-stage;
}

.auth-card {
  view-transition-name: auth-card;
}

.auth-panel {
  view-transition-name: auth-panel;
}

.auth-stage-login {
  flex-direction: row-reverse;
}

.auth-stage-login .auth-panel {
  margin-right: -38px;
  margin-left: 0;
  padding: 48px 66px 48px 36px;
}

.auth-stage-signup .auth-card {
  padding-top: 26px;
  padding-bottom: 28.5px;
}

.auth-stage-signup .auth-card-header {
  margin-bottom: 20px;
}

.auth-stage-signup .auth-form {
  gap: 12px;
}

.auth-stage-signup .auth-input-wrap {
  height: 48px;
}

.auth-stage-signup .auth-panel {
  min-height: 490px;
}

.auth-card {
  position: relative;
  z-index: 2;
  flex: 0 0 440px;
  width: 440px;
  max-width: 100%;
  padding: 38px 40px 40px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.085), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.auth-card-header {
  margin-bottom: 26px;
  text-align: center;
}

.auth-card-eyebrow,
.auth-panel-eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card-eyebrow {
  color: #1649c8;
}

.auth-card-title {
  display: inline-block;
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 1.5px solid #3c4252;
  color: #1f2430;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-card-description {
  margin: 12px 0 0;
  color: #7c8496;
  font-size: 12px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-label {
  color: #687185;
  font-size: 11px;
  font-weight: 600;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 14px 0 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.055), 0 1px 4px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-input-wrap::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3.5px;
  background: #1649c8;
  content: '';
  transition: width 0.2s ease;
}

.auth-input-wrap:focus-within {
  border-color: rgba(22, 73, 200, 0.35);
  box-shadow: 0 10px 26px rgba(22, 73, 200, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.auth-input-wrap:focus-within::before {
  width: 4.5px;
}

.auth-field-icon {
  display: flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: #8a92a6;
}

.auth-input-wrap:focus-within .auth-field-icon {
  color: #1649c8;
}

.auth-input-divider {
  flex: 0 0 1px;
  height: 20px;
  margin: 0 14px;
  background: #dde2ec;
}

.auth-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
}

.auth-input::placeholder {
  color: #9aa1b2;
}

.auth-eye-toggle {
  flex: 0 0 auto;
  padding: 6px;
  border: 0;
  background: transparent;
  color: #8a92a6;
  cursor: pointer;
}

.auth-eye-toggle:hover,
.auth-eye-toggle:focus-visible {
  color: #1649c8;
}

.auth-form-options {
  display: flex;
  justify-content: flex-end;
  margin-top: -3px;
}

.auth-forgot-link {
  padding-bottom: 2px;
  border-bottom: 1px solid #b4bac7;
  color: #7c8496;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.auth-forgot-link:hover {
  border-color: #1649c8;
  color: #1649c8;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 9px;
  margin: 4px auto 0;
  padding: 0 28px;
  border: 0;
  border-radius: 4px;
  background: #0d47d1;
  box-shadow: 0 6px 16px rgba(13, 71, 209, 0.28);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  background: #0a3ab0;
  box-shadow: 0 9px 20px rgba(13, 71, 209, 0.35);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-response {
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 495px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 530px;
  margin-left: -38px;
  padding: 48px 36px 48px 66px;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(145deg, #062b8c 0%, #0b41cc 52%, #0d4de6 100%);
  box-shadow: 0 22px 48px rgba(7, 47, 150, 0.24), 0 6px 16px rgba(7, 47, 150, 0.14);
  color: #fff;
  text-align: center;
}

.auth-panel::before,
.auth-panel::after {
  position: absolute;
  z-index: 0;
  content: '';
  pointer-events: none;
}

.auth-panel::before {
  top: -42px;
  right: -24px;
  width: 76%;
  height: 48%;
  border-radius: 0 0 0 65%;
  background: linear-gradient(145deg, rgba(20, 84, 245, 0.7), rgba(11, 62, 196, 0.12));
  transform: rotate(-7deg);
}

.auth-panel::after {
  right: -25px;
  bottom: -28px;
  left: -20px;
  height: 34%;
  border-radius: 55% 45% 0 0;
  background: linear-gradient(135deg, rgba(15, 84, 245, 0.78), rgba(7, 49, 163, 0.9));
  transform: rotate(-4deg);
}

.auth-panel-content {
  position: relative;
  z-index: 1;
  max-width: 270px;
  margin: auto;
}

.auth-panel-eyebrow {
  color: rgba(219, 234, 254, 0.82);
}

.auth-panel-title {
  margin: 0 0 12px;
  color: #fff;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.3;
}

.auth-panel-copy {
  margin: 0 0 28px;
  color: rgba(219, 234, 254, 0.9);
  font-size: 13px;
  line-height: 1.7;
}

.auth-panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 42px;
  padding: 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 24px rgba(3, 20, 74, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.auth-panel-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 28px rgba(3, 20, 74, 0.34);
  color: #fff;
}

.auth-panel-link:active {
  transform: scale(0.98);
}

@keyframes auth-stage-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-stage-leave {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.995);
  }
}

::view-transition-old(auth-stage) {
  animation: auth-stage-leave 180ms ease both;
}

::view-transition-new(auth-stage) {
  animation: auth-stage-enter 260ms ease both;
}

::view-transition-group(auth-stage),
::view-transition-group(auth-card),
::view-transition-group(auth-panel) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 0.8, 0.2, 1);
}

.auth-transition-exiting .auth-stage {
  pointer-events: none;
  animation: auth-stage-morph-out 320ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

.auth-transition-entering .auth-stage {
  animation: auth-stage-morph-in 480ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

@keyframes auth-stage-morph-out {
  0% {
    clip-path: inset(0 round 6px);
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
  100% {
    clip-path: inset(35% 36% round 44px);
    filter: blur(6px);
    opacity: 0;
    transform: scale(0.78) translateY(18px);
  }
}

@keyframes auth-stage-morph-in {
  0% {
    clip-path: inset(35% 36% round 44px);
    filter: blur(6px);
    opacity: 0;
    transform: scale(0.78) translateY(18px);
  }
  100% {
    clip-path: inset(0 round 6px);
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 820px) {
  .auth-section {
    min-height: auto;
    padding: 44px 16px 52px;
  }

  .auth-stage {
    flex-direction: column;
    max-width: 500px;
  }

  .auth-stage-login .auth-panel {
    margin: -14px 0 0;
    padding: 42px 28px 34px;
  }

  .auth-card {
    flex: 0 1 auto;
    width: 100%;
    padding: 34px 28px 36px;
  }

  .auth-stage-signup .auth-card {
    padding-top: 22px;
    padding-bottom: 24.5px;
  }

  .auth-panel {
    flex: 0 1 auto;
    width: 100%;
    min-height: 270px;
    margin: -14px 0 0;
    padding: 42px 28px 34px;
  }
}

@media (max-width: 420px) {
  .auth-section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .auth-card {
    padding-right: 22px;
    padding-left: 22px;
  }

  .auth-panel {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input-wrap,
  .auth-input-wrap::before,
  .auth-submit,
  .auth-panel-link {
    transition-duration: 0.01ms;
  }

  ::view-transition-old(auth-stage),
  ::view-transition-new(auth-stage) {
    animation-duration: 0.01ms;
  }

  ::view-transition-group(auth-stage),
  ::view-transition-group(auth-card),
  ::view-transition-group(auth-panel) {
    animation-duration: 0.01ms;
  }

  .auth-transition-exiting .auth-stage,
  .auth-transition-entering .auth-stage {
    animation: none;
    clip-path: none;
    filter: none;
    opacity: 1;
    transform: none;
  }
}
