*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.auth-split-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #c8c8c8;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

.auth-book-scene-wrap {
  width: min(1120px, 100%);
  position: relative;
  min-height: min(720px, calc(100vh - 48px));
}

.auth-intro-splash {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: min(720px, calc(100vh - 48px));
}

.auth-intro-splash__card {
  width: 100%;
  min-height: min(720px, calc(100vh - 48px));
  border: 3px solid #121212;
  border-radius: 48px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  animation: authSplashIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-intro-splash__logo-wrap {
  border-radius: 32px;
  overflow: hidden;
  line-height: 0;
}

.auth-intro-splash__logo {
  display: block;
  height: clamp(112px, 20vw, 160px);
  width: auto;
  max-width: min(560px, 85vw);
  object-fit: contain;
  border-radius: 32px;
  animation: authSplashLogo 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes authSplashIn {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes authSplashLogo {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authSplashOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

.auth-book-scene {
  width: 100%;
  perspective: 1800px;
  perspective-origin: 50% 50%;
}

.auth-intro-pending .auth-intro-splash,
.auth-intro-active .auth-intro-splash {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 5;
}

.auth-intro-pending .auth-book-scene,
.auth-intro-active .auth-book-scene {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-intro-pending .auth-book-page--front,
.auth-intro-active .auth-book-page--front,
body.auth-intro-play:not(.auth-book-animate) .auth-book-page--front {
  transform: rotateY(88deg);
  opacity: 0.45;
}

.auth-intro-pending .auth-book-page--back,
.auth-intro-active .auth-book-page--back,
body.auth-intro-play:not(.auth-book-animate) .auth-book-page--back {
  transform: rotateY(-88deg);
  opacity: 0.45;
}

.auth-intro-play .auth-intro-splash {
  display: flex;
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  animation: authSplashOut 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.auth-intro-play .auth-book-scene {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

html.auth-intro-pending .auth-split-frame,
body.auth-intro-active .auth-split-frame,
body.auth-intro-play .auth-split-frame {
  overflow: visible;
}

.auth-intro-skipped .auth-intro-splash,
.auth-intro-skipped-root .auth-intro-splash {
  display: none !important;
}

.auth-intro-skipped .auth-book-page--front,
.auth-intro-skipped .auth-book-page--back,
.auth-intro-skipped-root .auth-book-page--front,
.auth-intro-skipped-root .auth-book-page--back {
  transform: none !important;
  opacity: 1 !important;
}

.auth-intro-skipped .auth-book-page--front,
.auth-intro-skipped .auth-book-page--back,
.auth-intro-skipped .auth-split-form__inner--reveal,
.auth-intro-skipped-root .auth-book-page--front,
.auth-intro-skipped-root .auth-book-page--back,
.auth-intro-skipped-root .auth-split-form__inner--reveal {
  animation: none !important;
}

.auth-split-frame {
  width: 100%;
  min-height: min(720px, calc(100vh - 48px));
  border: 3px solid #121212;
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  direction: ltr;
  transform-style: preserve-3d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  position: relative;
  transform: translateZ(0);
}

.auth-split-frame::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.16) 50%, rgba(0, 0, 0, 0.06));
  z-index: 3;
  pointer-events: none;
}

.auth-book-page {
  backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  min-height: min(720px, calc(100vh - 48px));
}

.auth-book-page--front {
  transform-origin: 100% 50%;
  box-shadow: inset -12px 0 24px rgba(0, 0, 0, 0.04);
  z-index: 2;
}

.auth-book-page--back {
  transform-origin: 0% 50%;
  z-index: 1;
}

body.auth-intro-play.auth-book-animate .auth-book-page--front {
  animation: authBookOpenLeft 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.auth-intro-play.auth-book-animate .auth-book-page--back {
  animation: authBookOpenRight 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.auth-intro-play.auth-book-animate .auth-split-form__inner--reveal {
  animation: authFormReveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes authBookOpenLeft {
  0% {
    transform: rotateY(88deg);
    opacity: 0.45;
  }
  100% {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

@keyframes authBookOpenRight {
  0% {
    transform: rotateY(-88deg);
    opacity: 0.45;
  }
  100% {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

.auth-split-form__inner--reveal {
  opacity: 1;
}

@keyframes authFormReveal {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-split-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
  background: #fff;
  direction: rtl;
}

.auth-split-form__inner {
  width: min(360px, 100%);
  margin: 0 auto;
}

.auth-split-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.auth-split-brand__logo-wrap {
  border-radius: 18px;
  overflow: hidden;
  line-height: 0;
}

.auth-split-brand img {
  display: block;
  height: 68px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  border-radius: 18px;
}

.auth-split-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: #111;
}

.auth-split-subtitle {
  margin: 0 0 32px;
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: center;
  color: #8a8a8a;
}

.auth-split-field {
  margin-bottom: 14px;
}

.auth-split-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 0.9375rem;
  color: #111;
  text-align: right;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-split-input::placeholder {
  color: #b0b0b0;
}

.auth-split-input:focus {
  outline: none;
  border-color: #e86a2a;
  box-shadow: 0 0 0 3px rgba(232, 106, 42, 0.12);
}

.auth-split-error {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: #d92d20;
  text-align: right;
}

.auth-split-submit {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #f07835 0%, #e85a1a 100%);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(232, 90, 26, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-split-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(232, 90, 26, 0.34);
}

.auth-split-visual {
  position: relative;
  background: #1a1410;
  overflow: hidden;
}

.auth-split-visual__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.auth-split-version {
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

@media (max-width: 900px) {
  .auth-split-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-split-frame::before {
    display: none;
  }

  .auth-split-visual,
  .auth-book-page--back {
    display: none;
  }

  .auth-book-page--front {
    min-height: auto;
  }

  .auth-intro-play.auth-book-animate .auth-book-page--front {
    animation: authFormReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .auth-intro-play.auth-book-animate .auth-split-form__inner--reveal {
    animation-delay: 0.15s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-intro-splash__card,
  .auth-intro-splash__logo {
    animation: none !important;
  }

  .auth-intro-pending .auth-intro-splash,
  .auth-intro-active .auth-intro-splash,
  .auth-intro-play .auth-intro-splash {
    animation: none !important;
    display: none !important;
  }

  .auth-intro-pending .auth-book-scene,
  .auth-intro-active .auth-book-scene,
  .auth-intro-play .auth-book-scene {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .auth-intro-pending .auth-book-page--front,
  .auth-intro-active .auth-book-page--front,
  .auth-intro-pending .auth-book-page--back,
  .auth-intro-active .auth-book-page--back {
    transform: none;
    opacity: 1;
  }

  body.auth-intro-play.auth-book-animate .auth-book-page--front,
  body.auth-intro-play.auth-book-animate .auth-book-page--back,
  body.auth-intro-play.auth-book-animate .auth-split-form__inner--reveal,
  .auth-intro-skipped .auth-book-page--front,
  .auth-intro-skipped .auth-book-page--back,
  .auth-intro-skipped .auth-split-form__inner--reveal {
    animation: none !important;
  }
}
