:root {
  --auth-brown: #5a2d0c;
  --auth-orange: #f36b16;
  --auth-orange-dark: #cf4d08;
  --auth-cream: #fff7e9;
  --auth-peach: #ffe5bd;
  --auth-border: #efbd7b;
  --auth-muted: #8a6644;
  --auth-danger: #c73535;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 174, 66, .28), transparent 32%),
    linear-gradient(145deg, #ffb056, #7b3b0b);
  color: var(--auth-brown);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body.auth-popup-mode {
  min-height: 0;
  background: transparent;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-popup-mode .auth-shell {
  min-height: 0;
  padding: 2px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border: 1px solid rgba(239, 189, 123, .9);
  border-radius: 18px;
  background: rgba(255, 247, 233, .97);
  box-shadow: 0 22px 55px rgba(75, 32, 2, .26);
}

.auth-popup-mode .auth-card {
  max-width: none;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}

.auth-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 104px;
  padding: 17px 22px;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(81, 34, 2, .96), rgba(160, 70, 7, .92)),
    linear-gradient(135deg, var(--auth-orange), var(--auth-orange-dark));
  color: #fff;
}

.auth-hero::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: -88px;
  right: -35px;
  border: 22px solid rgba(255, 187, 89, .16);
  border-radius: 50%;
}

.auth-logo-wrap {
  position: relative;
  z-index: 1;
  flex: 0 0 118px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
}

.auth-logo-wrap img {
  display: block;
  width: 100%;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .3));
}

.auth-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.auth-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #ffd49b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.auth-hero h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1.15;
}

.auth-hero p {
  margin: 5px 0 0;
  color: #ffe7c7;
  font-size: 12px;
}

.auth-form {
  padding: 21px 24px 23px;
}

.auth-field {
  margin-bottom: 15px;
}

.auth-field label,
.auth-captcha-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--auth-brown);
  font-size: 13px;
  font-weight: 800;
}

.auth-field label i,
.auth-captcha-label i {
  width: 16px;
  color: var(--auth-orange);
  text-align: center;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: #bd7d40;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--auth-border);
  border-radius: 11px;
  outline: 0;
  background: #fffdfa;
  color: #3e210c;
  font: inherit;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-input::placeholder {
  color: #aa8e72;
}

.auth-input:focus {
  border-color: var(--auth-orange);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(243, 107, 22, .13);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9b6d45;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  background: #fff0db;
  color: var(--auth-orange-dark);
}

.auth-turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin: 2px 0 14px;
  overflow-x: auto;
}

.auth-turnstile iframe {
  max-width: 100%;
}

.auth-captcha-label strong {
  padding: 3px 8px;
  border-radius: 6px;
  background: #5a2d0c;
  color: #ffd39a;
  font-family: Consolas, monospace;
  letter-spacing: .5px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 3px 0 16px;
  color: #6d4b2d;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.auth-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--auth-orange);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-alert-danger {
  border: 1px solid #efaaaa;
  background: #fff0f0;
  color: #a12626;
}

.auth-alert-success {
  border: 1px solid #91d7af;
  background: #ecfff4;
  color: #16723d;
}

.auth-submit {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(110deg, #f36b16, #d54a08);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(211, 72, 7, .25);
  transition: transform .2s, box-shadow .2s, filter .2s;
}

.auth-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(211, 72, 7, .34);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-alternate {
  margin: 16px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  text-align: center;
}

.auth-alternate a {
  color: var(--auth-orange-dark);
  font-weight: 800;
  text-decoration: none;
}

.auth-alternate a:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .auth-shell { padding: 12px; }
  .auth-popup-mode .auth-shell { padding: 0; }
  .auth-hero { min-height: 88px; padding: 13px 16px; gap: 11px; }
  .auth-logo-wrap { flex-basis: 96px; }
  .auth-logo-wrap img { height: 42px; }
  .auth-hero h1 { font-size: 21px; }
  .auth-hero p { font-size: 11px; }
  .auth-form { padding: 17px 16px 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
