/* —— Public Sign up / Login modal —— */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal__scene {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.auth-modal__art {
  position: relative;
  z-index: 3;
  display: block;
  width: min(92%, 360px);
  height: auto;
  max-height: min(34vh, 280px);
  margin: 0 0 -36px;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transform: translateY(14px);
  will-change: transform, opacity;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  padding: clamp(1.75rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2rem) clamp(1.5rem, 3vw, 2rem);
  background: linear-gradient(180deg, #1a1a1a 0%, #131313 100%);
  border-radius: 22px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(52px);
  will-change: transform, opacity;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.auth-modal.auth-modal--visible .auth-modal__backdrop {
  opacity: 1;
}

.auth-modal.auth-modal--visible .auth-card {
  animation: auth-card-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.auth-modal.auth-modal--visible .auth-modal__art {
  animation: auth-art-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.2s;
}

@keyframes auth-card-rise {
  from {
    opacity: 0;
    transform: translateY(52px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-art-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-card__close:hover {
  background: rgba(212, 0, 0, 0.35);
  color: #fff;
}

.auth-card__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 3.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--color-red);
  margin-bottom: 1.35rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-form__error {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fecaca;
  text-align: center;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
}

.auth-form__error[hidden] {
  display: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-field__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
}

.auth-field__input {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: none;
  border-radius: 12px;
  background: #1f1f1f;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: box-shadow 0.15s ease;
}

.auth-field__input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.auth-field__input:focus {
  box-shadow: 0 0 0 2px rgba(212, 0, 0, 0.45);
}

.auth-field--password {
  position: relative;
}

.auth-field--password .auth-field__input {
  padding-right: 2.75rem;
}

.auth-field__toggle {
  position: absolute;
  right: 12px;
  bottom: 10px;
  border: none;
  background: transparent;
  color: var(--color-red);
  cursor: pointer;
  display: flex;
  padding: 0;
}

.auth-field__eye {
  display: block;
}

.auth-field__eye--hide {
  display: none;
}

.auth-field__toggle.is-visible .auth-field__eye--show {
  display: none;
}

.auth-field__toggle.is-visible .auth-field__eye--hide {
  display: block;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  margin: 0.15rem 0 0.35rem;
}

.auth-remember__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auth-remember__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6b6b6b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}

.auth-remember__dot::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  margin-top: -2px;
  transition: transform 0.2s ease;
}

.auth-remember__input:checked + .auth-remember__dot {
  background: #22c55e;
}

.auth-remember__input:checked + .auth-remember__dot::after {
  transform: rotate(45deg) scale(1);
}

.auth-remember__text {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.88);
}

.auth-form__submit {
  margin-top: 0.35rem;
  height: 50px;
  border: none;
  border-radius: 999px;
  background: var(--color-red);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.auth-form__submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-form__switch {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.auth-form__link {
  border: none;
  background: none;
  padding: 0;
  margin-left: 0.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--color-red);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-panel[hidden] {
  display: none;
}

/* Header LOGIN outline (mockup) */
.site-header__actions .btn {
  cursor: pointer;
  font-family: inherit;
}

.site-header__actions .btn--primary {
  border: none;
}

.site-header__actions .btn--secondary {
  border: none;
  background: var(--color-white);
  color: var(--color-red);
}

.site-header__actions .btn--secondary:hover {
  filter: brightness(0.96);
  color: var(--color-red-dark);
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal__art--mobile {
  display: none;
}

@media (min-width: 901px) {
  .auth-modal__scene {
    width: min(1180px, calc(100vw - 32px));
    height: min(78vh, 680px);
  }

  .auth-card {
    z-index: 2;
  }

  .auth-modal__art--left,
  .auth-modal__art--right {
    position: absolute;
    z-index: 1;
    width: auto;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    bottom: 0;
    object-fit: contain;
    opacity: 0;
  }

  .auth-modal__art--left {
    left: auto;
    right: calc(50% + 204px);
    height: 76%;
    bottom: 110px;
    object-position: right bottom;
    transform: translateX(220px);
  }

  .auth-modal__art--right {
    right: auto;
    left: calc(50% + 204px);
    object-position: left bottom;
    transform: translateX(-220px);
  }

  .auth-modal.auth-modal--visible .auth-modal__art--left,
  .auth-modal.auth-modal--visible .auth-modal__art--right {
    animation: auth-art-out-side 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 1.2s;
  }
}

@media (max-width: 900px) {
  .auth-modal__scene {
    overflow: visible;
  }

  .auth-modal__art--left,
  .auth-modal__art--right {
    display: none;
  }

  .auth-card {
    z-index: 2;
  }

  .auth-modal__art--mobile {
    display: block;
    position: relative;
    z-index: 1;
    left: auto;
    bottom: auto;
    width: min(100%, 440px);
    height: auto;
    max-height: none;
    margin: 0 0 -8px;
    object-fit: contain;
    object-position: center bottom;
    transform: translateY(120px);
  }

  .auth-modal.auth-modal--visible .auth-modal__art--mobile {
    animation: auth-art-rise-behind 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.5s;
  }
}

@keyframes auth-art-out-side {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes auth-art-rise-behind {
  from {
    opacity: 0;
    transform: translateY(120px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .auth-card {
    width: 100%;
    border-radius: 18px;
  }

  .auth-modal__art--mobile {
    width: min(100%, 400px);
    max-height: none;
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  .auth-modal__art--mobile {
    width: auto;
    max-width: 100%;
    max-height: 30vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal__backdrop {
    opacity: 1;
    transition: none;
  }

  .auth-card,
  .auth-modal__art {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .auth-modal__art--mobile {
    transform: none;
  }
}
