/* Login / register only. Matches the lobby: logo on the street, paper form, green start. */

body.auth .shade {
  height: 46%;
  background: linear-gradient(180deg, transparent 0%, rgba(48, 36, 22, .16) 55%, rgba(36, 26, 16, .28) 100%);
}

body.auth .frame {
  justify-content: center;
  justify-content: safe center;
  align-items: center;
  gap: clamp(10px, 2.4vh, 28px);
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 6vw, 40px) max(16px, env(safe-area-inset-bottom));
}

body.auth .logo {
  position: static;
  width: min(78%, 22rem);
  margin: 0;
  transform: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .32));
}

body.auth .version {
  position: absolute;
  top: 1.6%;
  right: 4.2%;
  margin: 0;
  text-align: right;
  line-height: 1.35;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}

body.auth .panel {
  width: min(100%, 24rem);
  margin: 0 auto;
  padding: 12px 14px 12px;
  border-radius: 8px;
  background: rgba(255, 248, 236, .94);
  border: 1px solid rgba(186, 159, 109, .72);
  box-shadow: 0 10px 28px rgba(36, 24, 12, .22);
  backdrop-filter: none;
}

body.auth .tabs {
  gap: 0;
  margin: 0 0 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid #eadcc4;
}

body.auth .tab {
  height: 34px;
  border-radius: 0;
  color: #8d7358;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
}

body.auth .tab.active {
  background: transparent;
  color: #c4543c;
  box-shadow: inset 0 -2px 0 #c4543c;
}

body.auth #reset-title {
  margin: 2px 0 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #5c4030;
}

body.auth #reset-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

body.auth .field.hidden,
body.auth .captcha.hidden {
  display: none;
}

body.auth .field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-bottom: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid #e4d2b6;
  border-radius: 6px;
  background: rgba(255, 255, 255, .78);
}

body.auth .field span {
  flex: 0 0 4.5em;
  margin: 0;
  font-size: 13px;
  color: #8a6d52;
}

body.auth .field input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}

body.auth .field input:focus {
  outline: none;
  border: 0;
}

/* Keep the form scrollable inside Safari's visible area when the keyboard opens. */
body.auth .stage { height: var(--browser-height, 100%); }
body.auth .panel { flex-shrink: 0; }

body.auth .field:focus-within {
  border-color: #c4543c;
  background: #fff;
}

body.auth .field .captcha-row {
  flex: 1;
  min-width: 0;
  gap: 8px;
}

body.auth .captcha-img {
  flex: 0 0 108px;
  width: 108px;
  height: 32px;
  border: 1px solid #e4d2b6;
  border-radius: 4px;
  background: #fffaf3;
}

body.auth .captcha-img img {
  width: 108px;
  height: 32px;
  object-fit: fill;
}

body.auth .remember {
  margin: 2px 2px 10px;
  font-size: 12px;
  color: #8a6d52;
}

body.auth .remember input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #6aa24c;
}

body.auth .forgot {
  color: #8a5a32;
  font-size: 12px;
}

body.auth .forgot:hover { color: #c4543c; }

body.auth .start {
  height: 46px;
  border: 2px solid #5f8d45;
  border-radius: 6px;
  background: linear-gradient(#b6dc86, #7eae59 55%, #6aa24c);
  box-shadow: inset 0 0 0 2px #f3ffe0, 0 2px 0 #4f7a38;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 1px 1px #3e6b2c;
}

body.auth .start:hover { filter: brightness(1.04); }

body.auth .start:active {
  transform: translateY(1px);
  box-shadow: inset 0 0 0 2px #f3ffe0, 0 1px 0 #4f7a38;
}

body.auth .linkish {
  margin-top: 8px;
  color: #8a6d52;
  font-size: 12px;
}

body.auth .message {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 12px;
}

body.auth[data-page="register"] .logo,
body.auth[data-page="reset"] .logo {
  width: min(62%, 16.5rem);
}

body.auth[data-page="register"] .field,
body.auth[data-page="reset"] .field,
body.auth[data-page="register"] .captcha-field,
body.auth[data-page="reset"] .captcha-field {
  margin-bottom: 7px;
}

body.auth[data-page="register"] #channel-wrap input::placeholder {
  font-size: 11px;
}

@media (max-width: 520px) {
  body.auth .frame { padding-left: 18px; padding-right: 18px; }
  body.auth .panel { width: 100%; }
  body.auth .logo { width: min(84%, 18rem); }
}

@media (min-width: 900px) {
  body.auth .logo { width: min(70%, 20rem); }
  body.auth .panel { width: min(100%, 26rem); }
  body.auth .field { height: 44px; }
  body.auth .start { height: 50px; font-size: 20px; }
}

@media (max-height: 740px) {
  body.auth .logo,
  body.auth[data-page="register"] .logo,
  body.auth[data-page="reset"] .logo { width: min(58%, 15rem); }
  body.auth .frame { gap: 8px; }
  body.auth .field { height: 36px; margin-bottom: 6px; }
  body.auth .start { height: 42px; font-size: 17px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  body.auth .frame {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 4%;
  }
  body.auth .logo,
  body.auth[data-page="register"] .logo,
  body.auth[data-page="reset"] .logo {
    position: static;
    transform: none;
    width: min(30%, 13rem);
  }
  body.auth .panel {
    width: min(420px, 48%);
    max-height: 94dvh;
    overflow: auto;
  }
}

@media (max-width: 520px) {
  /* A short keyboard viewport must not squeeze the form into a narrow 9:16 strip. */
  body.auth .stage { max-width: none; }
}
