@font-face {
  font-family: "Winky Sans";
  src: url("font/WinkySans.ttf");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --dark1: #36342f;
  --dark2: #444138;
  --light1: #94886b;
  --light2: #ecdeb7;
  --accent: #ffe15e;
  --danger: #e25c4c;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--dark1);
}

body.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  color: var(--light2);
  background:
    linear-gradient(rgba(54, 52, 47, .88), rgba(54, 52, 47, .96)),
    url("img/bg/main-bg.png") center / auto 100%;
  font-family: "Winky Sans", sans-serif;
  letter-spacing: .04em;
}

body.auth-page::before {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: min(34vh, 19rem);
  z-index: 0;
  pointer-events: none;
  opacity: .42;
  background: url("img/bg/empty.jpg") center bottom / cover no-repeat;
  image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 38%);
  mask-image: linear-gradient(to bottom, transparent, #000 38%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(62rem, 100%);
  min-width: 0;
  max-width: 100%;
  margin-block: auto;
}

.auth-brand {
  position: relative;
  margin-bottom: 1rem;
  padding: 1.2rem 1rem 1rem;
  overflow: hidden;
  border: 2px solid var(--light1);
  border-radius: .65rem;
  background:
    linear-gradient(rgba(54, 52, 47, .2), rgba(54, 52, 47, .86)),
    url("img/bg/forest.png") center 62% / cover;
  box-shadow:
    0 .4rem 0 rgba(0, 0, 0, .2),
    inset 0 0 0 .35rem rgba(54, 52, 47, .5);
  text-align: center;
  image-rendering: pixelated;
  min-width: 0;
  max-width: 100%;
}

.auth-brand img {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto .25rem;
  object-fit: contain;
  filter: drop-shadow(0 .2rem .15rem rgba(0, 0, 0, .35));
}

.auth-kicker {
  display: inline-block;
  max-width: 100%;
  padding: .2rem .55rem;
  border-radius: .3rem;
  background: var(--dark1);
  color: var(--light1);
  font-size: .74rem;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.auth-brand h1 {
  margin: .15rem 0 0;
  color: var(--light2);
  font-size: clamp(2.3rem, 7vw, 4rem);
  line-height: 1;
  text-shadow: 0 .2rem var(--dark1);
}

.auth-brand p {
  margin: .45rem 0 0;
  color: var(--light2);
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 32rem);
  justify-content: center;
  gap: 1rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.auth-card {
  position: relative;
  padding: 1.25rem;
  border: 2px solid var(--light1);
  border-radius: .55rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='white' fill-opacity='.025'%3E%3Cpolygon points='8 4 12 6 8 8 6 12 4 8 0 6 4 4 6 0'/%3E%3C/g%3E%3C/svg%3E"),
    var(--dark1);
  box-shadow:
    0 .45rem 0 rgba(0, 0, 0, .22),
    inset 0 1px rgba(255, 255, 255, .06);
  min-width: 0;
  max-width: 100%;
}

.auth-card h2 {
  margin: 0;
  color: var(--light2);
  font-size: 1.55rem;
  text-align: center;
}

.auth-card-subtitle {
  margin: .1rem 0 .85rem;
  color: var(--light1);
  font-size: .86rem;
  text-align: center;
}

.auth-card label {
  display: block;
  margin: .75rem 0 .3rem;
  color: var(--light2);
  font-size: .88rem;
}

.auth-card input {
  width: 100%;
  min-height: 2.8rem;
  border: 2px solid var(--light1);
  border-radius: .35rem;
  outline: 0;
  padding: .65rem .75rem;
  background: var(--light2);
  color: var(--dark1);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 .18rem rgba(0, 0, 0, .12);
  user-select: text;
  min-width: 0;
  max-width: 100%;
}

.auth-card input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 .2rem rgba(255, 225, 94, .18),
    inset 0 .18rem rgba(0, 0, 0, .12);
}

.auth-card button {
  width: 100%;
  margin-top: 1rem;
  border: 2px solid var(--light1);
  border-radius: .4rem;
  padding: .7rem;
  cursor: pointer;
  background: var(--light2);
  color: var(--dark1);
  font: inherit;
  font-weight: 800;
  box-shadow: inset 0 -.2rem rgba(0, 0, 0, .2);
  transition: filter .12s, transform .12s;
}

.auth-card button:hover {
  filter: brightness(1.08);
}

.auth-card button:active {
  transform: translateY(.1rem);
  box-shadow: none;
}

.auth-note {
  margin-top: .8rem;
  padding: .6rem;
  border-radius: .35rem;
  background: var(--dark2);
  color: var(--light1);
  font-size: .78rem;
  line-height: 1.4;
}

.auth-switch {
  margin-top: .9rem;
  color: var(--light1);
  font-size: .86rem;
  text-align: center;
}

.auth-switch a {
  display: inline-block;
  margin-left: .2rem;
  color: var(--light2);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .18rem;
}

.auth-switch a:hover,
.auth-switch a:focus-visible {
  color: var(--accent);
}

.auth-flash {
  max-width: 45rem;
  margin: 0 auto 1rem;
  padding: .7rem 1rem;
  border: 2px solid var(--light1);
  border-radius: .45rem;
  background: var(--dark2);
  color: var(--light2);
  text-align: center;
  box-shadow: 0 .3rem rgba(0, 0, 0, .2);
}

.auth-flash.error {
  border-color: var(--danger);
}

.auth-flash.success {
  border-color: var(--accent);
}

@media (max-width: 720px) {
  body.auth-page {
    padding-top: max(.75rem, env(safe-area-inset-top));
  }

  .auth-brand {
    padding: .8rem .75rem;
  }

  .auth-brand img {
    width: 4.25rem;
    height: 4.25rem;
  }

  .auth-brand h1 {
    font-size: 2.4rem;
  }

  .auth-brand p {
    font-size: .82rem;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1rem;
  }
}

@media (max-width: 380px) {
  .auth-kicker {
    display: none;
  }

  .auth-brand img {
    width: 3.6rem;
    height: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card button {
    transition: none;
  }
}
