:root {
  color-scheme: dark;
  --page-start: #1b2a40;
  --page-end: #0b1221;
  --card: rgba(28, 40, 60, 0.84);
  --card-line: rgba(126, 151, 185, 0.14);
  --input: #39465a;
  --input-line: #657286;
  --text: #ffffff;
  --muted: #c5cce0;
  --lavender: #d9b6ff;
  --pink: #ff2f93;
  --purple: #b145ff;
  --gold: #a77a10;
  --orange: #ff7a00;
  --green: #08d37b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background-color: var(--page-end);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px),
    linear-gradient(115deg, rgba(27, 42, 64, 0.98), rgba(11, 18, 33, 0.98));
  background-position:
    0 0,
    0 0;
  background-size:
    84px 84px,
    cover;
}

button,
input {
  font: inherit;
}

button {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease;
}

.auth-shell,
.thanks-shell,
.not-found {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 12px;
}

.site-header {
  width: min(100%, 520px);
  display: flex;
  justify-content: center;
}

.auth-card,
.thanks-card {
  width: min(100%, 340px);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-card {
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  padding: 18px 22px;
  scrollbar-width: thin;
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.language-button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 24px;
  border: 1px solid rgba(217, 182, 255, 0.28);
  border-radius: 999px;
  color: #e6d1ff;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 850;
  text-decoration: none;
}

.language-button.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  background: linear-gradient(105deg, rgba(177, 69, 255, 0.86), rgba(255, 47, 147, 0.86));
  box-shadow: 0 8px 14px rgba(177, 69, 255, 0.16);
}

.language-suggestion {
  position: fixed;
  inset: 12px 12px auto;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100% - 24px, 680px);
  margin: 0 auto;
  border: 1px solid rgba(217, 182, 255, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(28, 40, 60, 0.96);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  font-weight: 750;
}

.language-suggestion a,
.language-suggestion button {
  border: 1px solid rgba(217, 182, 255, 0.28);
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 850;
}

.language-suggestion[hidden] {
  display: none;
}

.avatar-frame,
.thanks-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(167, 122, 16, 0.18);
  box-shadow:
    0 0 0 4px rgba(167, 122, 16, 0.78),
    0 0 24px 7px rgba(255, 150, 48, 0.22);
}

.avatar-frame img,
.thanks-avatar img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-heading {
  margin-bottom: 18px;
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.28rem, 3vw, 1.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.form {
  display: none;
}

.form.active {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: #eee8ff;
  font-size: 0.72rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--input-line);
  border-radius: 9px;
  padding: 0 12px;
  color: var(--lavender);
  background: var(--input);
  outline: none;
  font-size: 0.75rem;
  font-weight: 800;
}

input::placeholder {
  color: var(--lavender);
  opacity: 1;
}

input:hover {
  border-color: #8290a6;
}

input:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(217, 182, 255, 0.16);
}

.primary-button {
  min-height: 38px;
  margin-top: 4px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(105deg, var(--purple), var(--pink));
  box-shadow: 0 9px 16px rgba(177, 69, 255, 0.22);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
}

.primary-button:hover,
.text-button:hover,
.link-button:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.text-button:focus-visible,
.link-button:focus-visible,
.logout-button:focus-visible,
.language-button:focus-visible,
.help-button:focus-visible {
  outline: 3px solid rgba(217, 182, 255, 0.35);
  outline-offset: 4px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.text-button,
.link-button,
.logout-button {
  width: max-content;
  margin: 0 auto;
  border: 0;
  color: #e6d1ff;
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.text-button {
  font-size: 0.7rem;
}

.switch-copy {
  margin: -1px 0 0;
  color: #e6d1ff;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 750;
}

.link-button {
  padding: 0;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.status {
  min-height: 16px;
  margin: 8px 0 0;
  color: #d7ddea;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.5;
}

.status:empty {
  margin-top: 0;
  min-height: 0;
}

.status[data-type="error"] {
  color: #ff9aaa;
}

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

.thanks-shell {
  align-content: center;
  gap: 32px;
  padding: 64px 18px 42px;
}

.thanks-avatar {
  width: 166px;
  height: 166px;
  margin: 0;
  opacity: 0.9;
  box-shadow:
    0 0 0 7px rgba(167, 122, 16, 0.88),
    0 0 76px 22px rgba(255, 140, 35, 0.24);
}

.thanks-avatar img {
  width: 154px;
  height: 154px;
}

.thanks-card {
  width: min(100%, 820px);
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 70px 64px;
}

.thanks-text {
  display: grid;
  justify-items: center;
  text-align: center;
}

.thanks-text h1 {
  max-width: 12ch;
  font-size: clamp(2.35rem, 5vw, 3.55rem);
  line-height: 1.04;
}

.thanks-rule {
  width: 126px;
  height: 5px;
  margin: 28px 0 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcf00, var(--orange));
}

.thanks-lead,
.thanks-copy {
  max-width: 465px;
  margin: 0;
  color: #d7ddea;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.45;
}

.thanks-copy {
  margin-top: 30px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-top: 80px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 18px 32px rgba(8, 211, 123, 0.34);
}

.success-mark span {
  width: 40px;
  height: 22px;
  border-left: 7px solid #fff;
  border-bottom: 7px solid #fff;
  transform: rotate(-45deg) translate(2px, -2px);
}

.logout-button {
  display: none;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
}

.help-button {
  position: fixed;
  right: 14px;
  bottom: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #1d2431;
  background: #fff;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 850;
}

.not-found {
  text-align: center;
}

.not-found h1 {
  margin: 0 0 24px;
  color: var(--text);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
}

.secondary-button {
  display: inline-grid;
  min-height: 52px;
  place-items: center;
  border-radius: 14px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(105deg, var(--purple), var(--pink));
  text-decoration: none;
  font-weight: 850;
}

@media (max-width: 700px) {
  .auth-shell,
  .thanks-shell,
  .not-found {
    padding: 10px;
  }

  .auth-card,
  .thanks-card {
    border-radius: 16px;
  }

  .auth-card {
    padding: 16px;
  }

  .avatar-frame {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
  }

  .avatar-frame img {
    width: 52px;
    height: 52px;
  }

  .auth-heading {
    margin-bottom: 16px;
  }

  h1 {
    font-size: 1.28rem;
  }

  .auth-heading p,
  .thanks-lead,
  .thanks-copy {
    font-size: 0.72rem;
  }

  .form.active {
    gap: 9px;
  }

  input {
    min-height: 34px;
    border-radius: 9px;
    padding: 0 10px;
  }

  .primary-button {
    min-height: 38px;
  }

  .thanks-shell {
    gap: 24px;
    padding-top: 28px;
  }

  .thanks-avatar {
    width: 110px;
    height: 110px;
  }

  .thanks-avatar img {
    width: 102px;
    height: 102px;
  }

  .thanks-card {
    width: min(100%, 390px);
    min-height: 390px;
    padding: 36px 24px;
  }

  .thanks-text h1 {
    font-size: 2rem;
  }

  .thanks-rule {
    width: 84px;
    margin: 20px 0 22px;
  }

  .thanks-copy {
    margin-top: 18px;
  }

  .success-mark {
    width: 76px;
    height: 76px;
    margin-top: 34px;
  }
}
