:root {
  --bg: #030303;
  --panel: #080908;
  --text: #f8f2e8;
  --muted: #9c9486;
  --line: rgba(218, 190, 125, 0.28);
  --gold: #c7a45d;
  --gold-bright: #f2d99a;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(199, 164, 93, 0.12), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(126, 199, 230, 0.12), transparent 30%),
    var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, #030303 0 49.8%, rgba(242, 217, 154, 0.72) 49.8% 50.2%, #030303 50.2% 100%);
  animation: openingCurtain 820ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

button,
input {
  font: inherit;
}

.login-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.075), transparent 34%),
    rgba(8, 9, 8, 0.92);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transform-origin: center;
  animation: loginPanelOpen 760ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both;
}

.login-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(115deg, transparent 24%, rgba(242, 217, 154, 0.18), transparent 54%);
  transform: translateX(-120%);
  animation: goldSweep 900ms ease 420ms both;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card img {
  width: 110px;
  max-height: 72px;
  object-fit: contain;
}

.login-card p,
.login-card small {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.login-message {
  display: none;
  min-height: 38px;
  align-items: center;
  padding: 10px 12px;
  color: #f8d7d7;
  border: 1px solid rgba(255, 116, 116, 0.32);
  background: rgba(116, 22, 22, 0.32);
  font-size: 0.78rem;
  font-weight: 800;
}

.login-message.is-visible {
  display: flex;
}

.login-message.is-success {
  color: #d9ffe9;
  border-color: rgba(76, 230, 142, 0.32);
  background: rgba(24, 112, 61, 0.28);
}

.login-card label {
  display: grid;
  gap: 8px;
  color: #dcd2bd;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid rgba(218, 190, 125, 0.22);
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-card input:focus {
  border-color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 0 0 3px rgba(242, 217, 154, 0.1);
}

.login-card button {
  height: 48px;
  margin-top: 2px;
  color: #18130a;
  font-weight: 1000;
  text-transform: uppercase;
  cursor: pointer;
  border: 0;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 14px 30px rgba(199, 164, 93, 0.2);
}

.login-card button:disabled {
  cursor: wait;
  filter: grayscale(0.2);
}

body.is-opening::after {
  animation: closingCurtain 520ms cubic-bezier(0.7, 0, 0.84, 0) both;
}

body.is-opening .login-card {
  animation: loginPanelClose 520ms cubic-bezier(0.7, 0, 0.84, 0) both;
}

@keyframes openingCurtain {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }

  100% {
    clip-path: inset(0 50% 0 50%);
    opacity: 0;
  }
}

@keyframes closingCurtain {
  0% {
    clip-path: inset(0 50% 0 50%);
    opacity: 0;
  }

  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes loginPanelOpen {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(14deg) translateY(22px) scale(0.96);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: perspective(900px) rotateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes loginPanelClose {
  0% {
    opacity: 1;
    transform: perspective(900px) rotateX(0) scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: perspective(900px) rotateX(-10deg) scale(0.96);
    filter: blur(8px);
  }
}

@keyframes goldSweep {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

@media (max-width: 760px) {
  .login-screen {
    padding: 14px;
  }

  .login-card {
    gap: 10px;
    padding: 22px;
  }

  .login-card img {
    width: 82px;
  }

  .login-card h1 {
    font-size: 1.82rem;
  }

  .login-card input,
  .login-card button {
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
