:root {
  color-scheme: dark;
  --auth-gold: #e5bd63;
  --auth-text: #f8f2e6;
  --auth-muted: #bbb8ca;
  --auth-surface: rgba(8, 13, 38, 0.74);
  --auth-field: rgba(8, 12, 31, 0.7);
  --auth-line: rgba(229, 189, 99, 0.25);
}

body.auth-page {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  overflow-x: hidden;
  color: var(--auth-text);
}

.auth-page [hidden] { display: none !important; }

.auth-page__header {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  align-items: center;
  justify-content: space-between;
}

.auth-page__brand {
  color: #f3c36b;
  font-family: "Cinzel", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.5);
}

.auth-page__languages {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(5, 9, 28, 0.58);
  backdrop-filter: blur(10px);
}

.auth-page__language {
  display: grid;
  min-width: 42px;
  min-height: 38px;
  place-items: center;
  border-radius: 999px;
  color: var(--auth-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.auth-page__language.is-active {
  color: #fff;
  background: rgba(95, 50, 186, 0.72);
}

.auth-main {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 28px 20px 64px;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.auth-panel {
  width: 100%;
  max-width: 470px;
  padding: clamp(28px, 6vw, 48px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0, rgba(125, 90, 240, 0.18), transparent 42%),
    var(--auth-surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.auth-panel__eyebrow {
  margin-bottom: 8px;
  color: var(--auth-gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.08;
}

.auth-panel__intro {
  margin-top: 12px;
  color: #c9cae1;
  line-height: 1.55;
}

.auth-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 30px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-mode {
  padding: 10px;
  border: 0;
  border-radius: 12px;
  color: var(--auth-muted);
  background: transparent;
  font: 700 0.82rem/1.2 "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.auth-mode:hover,
.auth-mode:focus-visible,
.auth-mode.is-active {
  color: #fff3cf;
  background: rgba(229, 189, 99, 0.09);
  outline: none;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span {
  color: #deddec;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  outline: 0;
  color: #fff;
  background: var(--auth-field);
  font: 400 1rem/1.2 "Space Grotesk", sans-serif;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus {
  border-color: rgba(229, 189, 99, 0.62);
  box-shadow: 0 0 0 4px rgba(229, 189, 99, 0.09);
}

.auth-forgot {
  justify-self: end;
  margin-top: -8px;
  padding: 2px 0;
  color: var(--auth-muted);
  background: transparent;
  border: 0;
  font: 600 0.8rem/1.3 "Space Grotesk", sans-serif;
  cursor: pointer;
}

.auth-forgot:hover,
.auth-forgot:focus-visible { color: #fff1bd; outline: none; }

.auth-submit,
.auth-session__action {
  display: inline-flex;
  min-height: 52px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 15px;
  color: #fff8e5;
  background: linear-gradient(135deg, #6845d0, #3f72cc);
  box-shadow: 0 13px 28px rgba(26, 22, 76, 0.36);
  font: 700 0.9rem/1.2 "Space Grotesk", sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.auth-submit:hover,
.auth-submit:focus-visible,
.auth-session__action:hover,
.auth-session__action:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.auth-submit:disabled,
.auth-session__action:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.auth-status {
  margin-top: 17px;
  color: #ffd1d8;
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-status[data-type="success"] { color: #bce8cd; }

.auth-session {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.auth-session__email {
  color: #fff0be;
  overflow-wrap: anywhere;
}

.auth-session__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-session__action--quiet {
  color: #ddd8e7;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.auth-page__back {
  display: block;
  margin-top: 22px;
  color: var(--auth-muted);
  font-size: 0.82rem;
  text-align: center;
}

.auth-page__back:hover,
.auth-page__back:focus-visible { color: #fff1bd; }

@media (max-width: 520px) {
  .auth-page__header { width: calc(100% - 28px); padding-top: 16px; }
  .auth-main { padding: 12px 14px 36px; align-items: start; }
  .auth-panel { padding: 28px 20px; border-radius: 22px; }
  .auth-session__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-mode,
  .auth-field input,
  .auth-submit,
  .auth-session__action { transition: none; }
}
