.auth-panel {
  width: min(calc(100vw - 40px), 540px);
  min-height: 440px;
  aspect-ratio: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.54), 0 0 48px var(--shadow);
}

.auth-panel::before {
  content: none;
  background: none;
}

.auth-mark {
  display: none;
}

.auth-provider-view,
.auth-email-view,
.auth-code-view {
  box-sizing: border-box;
  min-height: 440px;
  padding: 64px 56px 48px;
}

.auth-provider-view[hidden],
.auth-email-view[hidden],
.auth-code-view[hidden] {
  display: none;
}

.auth-provider-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 44px;
}

.auth-mascot {
  width: 112px;
  height: 112px;
  margin-bottom: 16px;
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
}

.auth-provider-view h2,
.auth-email-view h2,
.auth-code-view h2 {
  position: static;
  max-width: 420px;
  margin: 0 0 34px;
  transform: none;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.16;
  letter-spacing: 0;
  text-shadow: none;
}

.auth-actions {
  position: static;
  order: 1;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  height: auto;
  gap: 12px;
}

.auth-button,
.auth-email-open {
  box-sizing: border-box;
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: none;
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.auth-button > span {
  transform: none;
}

.auth-button:hover,
.auth-email-open:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(24, 116, 217, 0.15);
  transform: translateY(-1px);
}

.auth-provider-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 0;
  background: transparent;
}

.auth-provider-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.google-auth-icon,
.yandex-auth-icon {
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
}

.auth-panel .auth-provider-divider {
  position: static;
  order: 2;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  transform: none;
  color: var(--soft);
  font-size: 13px;
  line-height: 1;
}

.auth-provider-divider::before,
.auth-provider-divider::after {
  width: 100%;
  height: 1px;
  content: "";
  background: var(--line);
}

.auth-email-open {
  position: static;
  order: 3;
  padding: 0 18px;
  transform: none;
}

.auth-email-icon {
  width: 18px;
  height: 18px;
  fill: none;
}

.auth-email-icon path {
  fill: none;
  stroke: currentColor;
}

.auth-back svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-email-view,
.auth-code-view {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: transparent;
  text-align: center;
}

.auth-email-view h2,
.auth-code-view h2 {
  margin-bottom: 12px;
  align-self: center;
}

.auth-panel .auth-email-copy,
.auth-panel .auth-code-copy {
  position: static;
  width: auto;
  margin: 0 0 24px;
  transform: none;
  align-self: center;
  max-width: 16rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: balance;
}

.auth-back {
  position: absolute;
  top: 22px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.auth-email-form,
.auth-code-form {
  position: static;
  display: grid;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.auth-email-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.auth-email-field input,
.auth-code-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 15px;
  color: var(--ink);
  outline: none;
  background: var(--bg-soft);
  font: inherit;
}

.auth-email-field input {
  text-align: center;
}

.auth-code-input {
  text-align: center;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.auth-email-field input:focus,
.auth-code-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(86, 167, 255, 0.16);
}

.auth-email-submit,
.auth-code-submit {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blue), var(--blue-strong));
  box-shadow: 0 12px 28px var(--shadow);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-email-submit:disabled,
.auth-code-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(255, 134, 134, 0.42);
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffc0c0;
  background: rgba(130, 38, 50, 0.28);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

.auth-form-error::before {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #d84c5d;
  content: "!";
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.auth-form-error[hidden] {
  display: none;
}

.auth-code-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.auth-code-actions button {
  border: 0;
  padding: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.auth-code-actions button:disabled {
  color: #6f6a78;
  cursor: default;
}

@media (max-width: 600px) {
  .auth-panel {
    width: min(calc(100vw - 28px), 420px);
    max-width: calc(100vw - 28px);
    min-height: 430px;
    border-radius: 16px;
  }

  .auth-provider-view,
  .auth-email-view,
  .auth-code-view {
    min-height: 430px;
    padding: 56px 24px 36px;
  }

  .auth-provider-view {
    padding-top: 40px;
  }

  .auth-mascot {
    width: 92px;
    height: 92px;
    margin-bottom: 12px;
  }

  .auth-provider-view h2,
  .auth-email-view h2,
  .auth-code-view h2 {
    max-width: 300px;
    margin-bottom: 30px;
    font-size: 23px;
    text-align: center;
  }

  .auth-button,
  .auth-email-open {
    min-height: 50px;
    font-size: 15px;
  }

  .auth-panel .auth-provider-divider {
    margin: 16px 0;
  }

  .auth-panel .auth-email-copy,
  .auth-panel .auth-code-copy {
    width: 100%;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
  }

  .auth-email-view,
  .auth-code-view {
    text-align: center;
  }

  .auth-email-field {
    text-align: left;
  }

  .auth-email-field input,
  .auth-code-input,
  .auth-email-submit,
  .auth-code-submit {
    min-height: 48px;
  }

  .auth-code-input {
    font-size: 20px;
  }

  .auth-form-error {
    gap: 7px;
    padding: 9px 10px;
    font-size: 12px;
  }
}
