:root {
  --auth-ivory: #f7f1ea;
  --auth-petal: #f5d8e2;
  --auth-rose: #d24d73;
  --auth-mauve: #99647d;
  --auth-wine: #5b3045;
  --auth-ink: #563f3a;
}

* { box-sizing: border-box; }

.auth-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--auth-ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 20%, rgba(210, 77, 115, .11), transparent 25rem),
    radial-gradient(circle at 88% 78%, rgba(153, 100, 125, .13), transparent 27rem),
    var(--auth-ivory);
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 18px;
  animation: auth-header-enter .65s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-header .back-link {
  min-width: 160px;
  color: var(--auth-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  opacity: .7;
  transition: opacity .2s ease, transform .2s ease;
}
.auth-header .back-link:hover { opacity: 1; transform: translateX(-3px); }
.auth-header .logo-block { text-align: center; }
.auth-header .logo-block .name {
  color: var(--auth-ink);
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: .12em;
  line-height: 1;
}
.auth-header .logo-block .sub {
  margin-top: 5px;
  color: var(--auth-mauve);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .34em;
}
.auth-header .spacer { min-width: 160px; }

.auth-main { display: flex; justify-content: center; padding: 18px 24px 64px; }

.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(1040px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(91, 48, 69, .08);
  border-radius: 30px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 30px 80px rgba(91, 48, 69, .15), 0 3px 12px rgba(91, 48, 69, .06);
  animation: auth-shell-enter .82s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-form-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 44px 56px;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  transition:
    opacity .34s ease .34s,
    transform .58s cubic-bezier(.22, 1, .36, 1) .24s,
    filter .34s ease .24s,
    visibility 0s linear .34s;
}
.auth-login-panel { grid-column: 1; }
.auth-signup-panel { grid-column: 2; }
.auth-form-content { width: 100%; max-width: 400px; margin: auto; }

.auth-shell:not(.is-signup) .auth-signup-panel,
.auth-shell.is-signup .auth-login-panel {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  filter: blur(3px);
  transition-delay: 0s;
}
.auth-shell:not(.is-signup) .auth-signup-panel { transform: translate3d(28px, 0, 0); }
.auth-shell.is-signup .auth-login-panel { transform: translate3d(-28px, 0, 0); }

.auth-shell:not(.is-signup) .auth-login-panel .auth-form-content,
.auth-shell.is-signup .auth-signup-panel .auth-form-content {
  animation: auth-content-enter .7s cubic-bezier(.22, 1, .36, 1) .16s both;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--auth-rose);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .24em;
}
.auth-form-panel h1 {
  margin: 0;
  color: var(--auth-ink);
  font-family: var(--font-display);
  font-size: clamp(31px, 3vw, 42px);
  font-weight: 400;
  line-height: 1.04;
}
.auth-intro {
  max-width: 34ch;
  margin: 13px 0 24px;
  color: #8a746d;
  font-size: 12px;
  line-height: 1.65;
}

.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: #806d67;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.auth-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(91, 48, 69, .15);
  border-radius: 11px;
  outline: none;
  background: #fbf8f5;
  color: var(--auth-ink);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 12px 13px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-form input::placeholder { color: #b8a8a2; }
.auth-form input:focus {
  border-color: var(--auth-rose);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(210, 77, 115, .1);
}

.forgot-link {
  align-self: flex-end;
  margin-top: -5px;
  border: 0;
  background: none;
  color: var(--auth-mauve);
  cursor: pointer;
  font: 600 11px var(--font-body);
  padding: 0;
}
.forgot-link:hover { color: var(--auth-rose); }
.auth-message { color: var(--auth-mauve); font-size: 12px; line-height: 1.5; }
.auth-message:empty { display: none; }
.auth-message.error { color: var(--auth-rose); }
.auth-message.success { color: #4f7456; }

.auth-submit,
.auth-google,
.auth-visual-button {
  min-height: 44px;
  border-radius: 11px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}
.auth-submit {
  border: 0;
  background: linear-gradient(105deg, var(--auth-rose), #bd3d66);
  box-shadow: 0 12px 24px rgba(210, 77, 115, .2);
  color: #fff;
  cursor: pointer;
  padding: 13px 16px;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(210, 77, 115, .27); }
.auth-submit:disabled { cursor: default; opacity: .55; transform: none; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #ae9d97;
  font-size: 10px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(91, 48, 69, .1); }

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 1px solid rgba(91, 48, 69, .15);
  background: #fff;
  color: var(--auth-ink);
  cursor: pointer;
  padding: 11px 14px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.auth-google:hover { border-color: var(--auth-mauve); box-shadow: 0 8px 20px rgba(91, 48, 69, .09); transform: translateY(-1px); }
.auth-google svg { width: 16px; height: 16px; }
.auth-switch { margin: 18px 0 0; color: #98857e; font-size: 12px; text-align: center; }
.auth-switch a { color: var(--auth-rose); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-hint {
  margin: 11px auto 0;
  max-width: 42ch;
  color: #aa9993;
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.auth-visual {
  position: absolute;
  z-index: 5;
  top: 10px;
  bottom: 10px;
  left: calc(50% + 5px);
  width: calc(50% - 15px);
  overflow: hidden;
  border-radius: 23px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 239, 245, .85), transparent 25%),
    radial-gradient(circle at 86% 18%, rgba(244, 199, 218, .72), transparent 26%),
    radial-gradient(ellipse at 44% 64%, rgba(91, 48, 69, .72), transparent 48%),
    linear-gradient(145deg, #e26c91 0%, #b4668a 45%, #69364f 100%);
  background-repeat: no-repeat;
  background-size: 145% 145%, 155% 155%, 165% 165%, 210% 210%;
  background-position: 0% 0%, 100% 4%, 44% 70%, 20% 30%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 18px 38px rgba(91, 48, 69, .23);
  transform: translate3d(0, 0, 0);
  will-change: transform, background-position;
  transition: transform .92s cubic-bezier(.22, 1, .36, 1), border-radius .4s ease;
  animation: auth-gradient-flow 11s ease-in-out infinite alternate;
}
.auth-shell.is-signup .auth-visual { transform: translate3d(calc(-100% - 10px), 0, 0); }
.auth-visual-video,
.auth-visual-tint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.auth-visual-video {
  z-index: 0;
  display: block;
  border: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.auth-visual-tint {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(64, 28, 48, .06) 0%, rgba(75, 31, 54, .22) 48%, rgba(55, 22, 41, .58) 100%),
    linear-gradient(115deg, rgba(210, 77, 115, .13), rgba(91, 48, 69, .16));
  pointer-events: none;
}
.auth-visual::before,
.auth-visual::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  transform: rotate(-18deg);
  z-index: 2;
}
.auth-visual::before {
  width: 420px;
  height: 180px;
  right: -170px;
  top: 50px;
  animation: auth-orbit-one 8s ease-in-out infinite alternate;
}
.auth-visual::after {
  width: 390px;
  height: 160px;
  left: -160px;
  bottom: 45px;
  animation: auth-orbit-two 10s ease-in-out infinite alternate;
}
.auth-visual-mark {
  position: absolute;
  z-index: 3;
  top: 31px;
  left: 34px;
  font: italic 34px var(--font-tagline);
  opacity: .9;
}
.auth-visual-mark::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  margin-top: 2px;
  background: rgba(255, 255, 255, .7);
}
.auth-visual-copy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 56px 48px;
  transition: opacity .3s ease .28s, transform .45s ease .2s, visibility 0s linear .28s;
}
.auth-visual-kicker { font-size: 9px; font-weight: 700; letter-spacing: .24em; opacity: .78; }
.auth-visual h2 {
  max-width: 9ch;
  margin: 12px 0 13px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(33px, 4vw, 50px);
  font-weight: 400;
  line-height: .98;
}
.auth-visual p { max-width: 31ch; margin: 0 0 24px; font-size: 11px; line-height: 1.65; opacity: .78; }
.auth-visual-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  border: 1px solid rgba(255, 255, 255, .72);
  color: #fff;
  padding: 11px 18px;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.auth-visual-button:hover { background: #fff; color: var(--auth-wine); transform: translateY(-2px); }
.auth-shell:not(.is-signup) .auth-visual-member,
.auth-shell.is-signup .auth-visual-new {
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition-delay: 0s;
}

.auth-shell:not(.is-signup) .auth-visual-new > *,
.auth-shell.is-signup .auth-visual-member > * {
  animation: auth-copy-enter .68s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-shell:not(.is-signup) .auth-visual-new > *:nth-child(2),
.auth-shell.is-signup .auth-visual-member > *:nth-child(2) { animation-delay: .08s; }
.auth-shell:not(.is-signup) .auth-visual-new > *:nth-child(3),
.auth-shell.is-signup .auth-visual-member > *:nth-child(3) { animation-delay: .14s; }
.auth-shell:not(.is-signup) .auth-visual-new > *:nth-child(4),
.auth-shell.is-signup .auth-visual-member > *:nth-child(4) { animation-delay: .2s; }

@keyframes auth-header-enter {
  from { opacity: 0; transform: translate3d(0, -12px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes auth-shell-enter {
  from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes auth-content-enter {
  from { opacity: 0; transform: translate3d(0, 15px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes auth-copy-enter {
  from { opacity: 0; transform: translate3d(0, 13px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes auth-gradient-flow {
  0% { background-position: 0% 0%, 100% 4%, 44% 70%, 20% 30%; }
  50% { background-position: 18% 16%, 78% 28%, 58% 46%, 72% 58%; }
  100% { background-position: 8% 30%, 94% 8%, 35% 58%, 35% 78%; }
}

@keyframes auth-orbit-one {
  from { transform: translate3d(0, 0, 0) rotate(-18deg); }
  to { transform: translate3d(-22px, 18px, 0) rotate(-12deg); }
}

@keyframes auth-orbit-two {
  from { transform: translate3d(0, 0, 0) rotate(-18deg); }
  to { transform: translate3d(24px, -14px, 0) rotate(-24deg); }
}

button:focus-visible,
a:focus-visible,
input:focus-visible { outline: 3px solid rgba(210, 77, 115, .26); outline-offset: 3px; }

@media (max-width: 820px) {
  .auth-header { width: min(100% - 32px, 680px); padding-top: 20px; }
  .auth-header .back-link { min-width: 36px; font-size: 0; }
  .auth-header .back-link::before { content: '‹'; font-size: 24px; }
  .auth-header .spacer { min-width: 36px; }
  .auth-main { padding: 10px 14px 42px; }
  .auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 0;
    border-radius: 25px;
  }
  .auth-visual,
  .auth-shell.is-signup .auth-visual {
    position: relative;
    display: grid;
    grid-column: 1;
    grid-row: 1;
    top: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: 190px;
    margin: 9px;
    border-radius: 19px;
    transform: none;
  }
  .auth-visual-copy {
    position: static;
    grid-area: 1 / 1;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
    transform: none;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .auth-shell:not(.is-signup) .auth-visual-member,
  .auth-shell.is-signup .auth-visual-new { transform: none; }
  .auth-visual h2 { max-width: 15ch; margin: 7px 0; font-size: 30px; }
  .auth-visual p { display: none; }
  .auth-visual-button { min-height: 38px; margin-top: 10px; }
  .auth-visual-mark { top: 20px; left: 24px; font-size: 25px; }
  .auth-form-panel {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    padding: 33px 28px 38px;
  }
  .auth-shell:not(.is-signup) .auth-signup-panel,
  .auth-shell.is-signup .auth-login-panel {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }
  .auth-form-panel h1 { font-size: 34px; }
}

@media (max-width: 470px) {
  .auth-header .logo-block .name { font-size: 22px; }
  .auth-header .logo-block .sub { letter-spacing: .28em; }
  .auth-visual { height: 168px; }
  .auth-visual h2 { font-size: 27px; }
  .auth-form-panel { padding: 29px 21px 34px; }
  .auth-field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .auth-header,
  .auth-shell,
  .auth-form-content,
  .auth-visual-copy > * {
    animation-duration: .38s !important;
    animation-iteration-count: 1 !important;
  }

  .auth-form-panel {
    transition-duration: .28s, .5s, .28s, 0s;
  }

  .auth-visual {
    transition-duration: .72s, .32s;
    animation-duration: 16s;
    animation-iteration-count: infinite;
  }

  .auth-visual::before,
  .auth-visual::after {
    animation-duration: 20s;
    animation-iteration-count: infinite;
  }
}
