:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --auth-scale: 1.35;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  background: #6dcdf8;
}

button,
input {
  font: inherit;
}

button {
  border: none;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(16px * var(--auth-scale));
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2) 34%, transparent 60%),
    url("./assets/background.png") center / cover no-repeat,
    #6dcdf8;
  isolation: isolate;
  overflow: hidden;
}

.auth-page::before {
  content: none;
}

.auth-stage {
  width: min(100%, 1672px);
  min-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.auth-card {
  position: relative;
  width: min(48vw, calc(420px * var(--auth-scale)));
  margin: 0;
  padding: calc(96px * var(--auth-scale)) calc(18px * var(--auth-scale)) calc(22px * var(--auth-scale));
  border-radius: calc(28px * var(--auth-scale));
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), rgba(255, 251, 241, 0.98) 58%),
    linear-gradient(180deg, #fffdf8, #f4ebdd);
  border: 3px solid #f2c25a;
  box-shadow:
    0 18px 36px rgba(103, 73, 18, 0.18),
    inset 0 0 0 4px rgba(255, 248, 230, 0.95),
    inset 0 -10px 24px rgba(232, 207, 164, 0.2);
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: auto calc(12px * var(--auth-scale)) calc(-12px * var(--auth-scale));
  height: calc(18px * var(--auth-scale));
  border-radius: 999px;
  background: linear-gradient(180deg, #b68956, #8b6035);
  box-shadow: 0 8px 18px rgba(80, 54, 25, 0.2);
  z-index: -1;
}

.auth-card.login-card {
  max-width: calc(420px * var(--auth-scale));
}

.auth-card.register-card {
  max-width: calc(400px * var(--auth-scale));
  padding-top: calc(84px * var(--auth-scale));
}

.auth-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  user-select: none;
  pointer-events: none;
}

.auth-logo.login-logo {
  top: calc(-42px * var(--auth-scale));
  width: min(calc(210px * var(--auth-scale)), 30vw);
}

.auth-logo.register-logo {
  top: calc(-42px * var(--auth-scale));
  width: min(calc(178px * var(--auth-scale)), 24vw);
}

.auth-card-content {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--auth-scale));
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--auth-scale));
}

.auth-fields.register-fields {
  gap: calc(8px * var(--auth-scale));
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: calc(6px * var(--auth-scale));
}

.auth-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(52px * var(--auth-scale));
  padding: calc(6px * var(--auth-scale)) calc(10px * var(--auth-scale)) calc(6px * var(--auth-scale)) calc(54px * var(--auth-scale));
  border-radius: calc(14px * var(--auth-scale));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 241, 233, 0.98));
  border: 1.5px solid #dfc49f;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.88),
    0 4px 10px rgba(179, 145, 93, 0.12);
}

.auth-input-shell input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #8c8179;
  font-size: calc(15px * var(--auth-scale));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-input-shell input::placeholder {
  color: #a9a09a;
}

.auth-input-icon {
  position: absolute;
  left: calc(12px * var(--auth-scale));
  top: 50%;
  transform: translateY(-50%);
  width: calc(24px * var(--auth-scale));
  height: calc(24px * var(--auth-scale));
  color: #5f9cf5;
}

.auth-input-icon svg {
  width: 100%;
  height: 100%;
}

.auth-square-icon {
  width: calc(30px * var(--auth-scale));
  height: calc(30px * var(--auth-scale));
  border-radius: calc(7px * var(--auth-scale));
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 4px 8px rgba(78, 65, 29, 0.12);
}

.auth-square-icon svg {
  width: calc(17px * var(--auth-scale));
  height: calc(17px * var(--auth-scale));
}

.auth-square-blue {
  background: linear-gradient(180deg, #57a6ff, #2d72ef);
  color: #fff;
}

.auth-square-green {
  background: linear-gradient(180deg, #7de66a, #41bf34);
  color: #fff;
}

.auth-square-gold {
  background: linear-gradient(180deg, #ffd458, #f5ad12);
  color: #fff;
}

.auth-square-violet {
  background: linear-gradient(180deg, #c88af9, #8e4ed9);
  color: #fff;
}

.auth-input-trailing {
  position: absolute;
  top: 50%;
  right: calc(18px * var(--auth-scale));
  transform: translateY(-50%);
}

.auth-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(10px * var(--auth-scale));
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: calc(8px * var(--auth-scale));
  color: #5e5752;
  font-size: calc(13px * var(--auth-scale));
  font-weight: 700;
}

.auth-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-check-mark,
.auth-check-box {
  position: relative;
  flex: 0 0 auto;
}

.auth-check-login .auth-check-mark {
  width: calc(20px * var(--auth-scale));
  height: calc(20px * var(--auth-scale));
  border-radius: calc(6px * var(--auth-scale));
  border: 1.5px solid #7cc01f;
  background: linear-gradient(180deg, #b8f451, #7cc710);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.auth-check-login .auth-check-mark::after {
  content: "";
  position: absolute;
  left: calc(5px * var(--auth-scale));
  top: calc(2px * var(--auth-scale));
  width: calc(5px * var(--auth-scale));
  height: calc(9px * var(--auth-scale));
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(40deg);
}

.auth-check-login input:not(:checked) + .auth-check-mark {
  background: linear-gradient(180deg, #ffffff, #dbe4ea);
  border-color: #cbd6df;
}

.auth-check-login input:not(:checked) + .auth-check-mark::after {
  opacity: 0;
}

.auth-link,
.auth-inline-link,
.auth-footer-link {
  background: none;
  padding: 0;
  color: #2066db;
  font-size: calc(13px * var(--auth-scale));
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.auth-link {
  white-space: nowrap;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8px * var(--auth-scale));
}

.auth-actions.register-actions {
  margin-top: calc(4px * var(--auth-scale));
}

.auth-image-button {
  background: none;
  padding: 0;
  cursor: pointer;
}

.auth-main-button {
  width: min(636px, 100%);
}

.auth-sub-button {
  width: min(calc(260px * var(--auth-scale)), 88%);
}

.auth-back-button {
  width: min(calc(235px * var(--auth-scale)), 70%);
}

.auth-guest-button {
  width: min(calc(190px * var(--auth-scale)), 62%);
  margin-top: calc(2px * var(--auth-scale));
}

.auth-image-button img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.auth-image-button:hover img {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.auth-image-button:active img {
  transform: translateY(0);
}

.auth-eye-button {
  width: calc(24px * var(--auth-scale));
  height: calc(24px * var(--auth-scale));
  display: grid;
  place-items: center;
  background: none;
  color: #b9afa8;
  cursor: pointer;
}

.auth-eye-button svg {
  width: calc(18px * var(--auth-scale));
  height: calc(18px * var(--auth-scale));
}

.auth-message {
  display: none;
  width: 100%;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: calc(10px * var(--auth-scale)) calc(12px * var(--auth-scale));
  border-radius: calc(12px * var(--auth-scale));
  font-size: calc(12px * var(--auth-scale));
}

.auth-message.is-visible {
  display: block;
}

.auth-message ul {
  margin: 0;
  padding-left: 18px;
}

.auth-message li + li {
  margin-top: 4px;
}

.auth-message .validation-summary-errors {
  margin: 0;
}

.auth-message .validation-summary-errors ul {
  padding-left: 18px;
}

.auth-validation {
  color: #8b1e1e;
  font-size: calc(12px * var(--auth-scale));
  font-weight: 700;
  min-height: 1em;
  padding-left: calc(12px * var(--auth-scale));
}

.auth-check-register {
  justify-content: center;
  color: #57514b;
  margin-top: -2px;
}

.auth-check-register .auth-check-box {
  width: calc(20px * var(--auth-scale));
  height: calc(20px * var(--auth-scale));
  border-radius: calc(5px * var(--auth-scale));
  border: 1.5px solid #ccbca8;
  background: linear-gradient(180deg, #fffefb, #f4ece1);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.auth-check-register input:checked + .auth-check-box::after {
  content: "";
  position: absolute;
  left: calc(5px * var(--auth-scale));
  top: calc(2px * var(--auth-scale));
  width: calc(5px * var(--auth-scale));
  height: calc(10px * var(--auth-scale));
  border-right: 3px solid #76bd19;
  border-bottom: 3px solid #76bd19;
  transform: rotate(40deg);
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--auth-scale));
  margin-top: calc(2px * var(--auth-scale));
  color: #5c5650;
  font-size: calc(13px * var(--auth-scale));
  font-weight: 700;
}

.auth-star {
  position: absolute;
  top: calc(20px * var(--auth-scale));
  width: calc(12px * var(--auth-scale));
  height: calc(12px * var(--auth-scale));
  background: #ffd53c;
  clip-path: polygon(50% 0%, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0% 50%, 38% 36%);
  box-shadow: 0 0 0 2px rgba(255, 238, 175, 0.55);
}

.auth-star-left {
  left: calc(20px * var(--auth-scale));
}

.auth-star-right {
  right: calc(20px * var(--auth-scale));
}

@media (max-width: 920px) {
  :root {
    --auth-scale: 1;
  }

  .auth-page {
    padding: 0;
  }

  .auth-stage {
    width: 100%;
    min-height: 100vh;
    padding: 18px 12px 28px;
  }

  .auth-card {
    width: min(100%, 760px);
    padding: 118px 18px 28px;
    border-radius: 30px;
  }

  .auth-card.register-card {
    padding-top: 110px;
  }

  .auth-logo.login-logo {
    top: -34px;
    width: min(52vw, 210px);
  }

  .auth-logo.register-logo {
    top: -30px;
    width: min(46vw, 178px);
  }

  .auth-input-shell {
    min-height: 72px;
    padding-left: 76px;
    padding-right: 14px;
    border-radius: 18px;
  }

  .auth-input-shell input {
    font-size: clamp(16px, 3.9vw, 24px);
  }

  .auth-login-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    text-align: center;
  }

  .auth-check,
  .auth-link,
  .auth-inline-link,
  .auth-footer-note,
  .auth-footer-link {
    font-size: clamp(14px, 3vw, 20px);
  }

  .auth-main-button,
  .auth-sub-button,
  .auth-back-button,
  .auth-guest-button {
    width: 100%;
  }
}
