/* =========================================================
 * Auth pages (register / login) - dark fire theme
 * Scoped to .auth-* classes so the rest of the site is untouched.
 * ======================================================= */

.auth-page {
  --auth-bg-1: #2a0c06;
  --auth-bg-2: #120100;
  --auth-line: #4a1a08;
  --auth-line-hot: #d9883d;
  --auth-gold: #ffd36b;
  --auth-ember: #ff7a1a;
  --auth-ink: #f3e6d8;
  --auth-muted: #a8907c;
  --auth-field: rgba(0, 0, 0, .38);
  --auth-danger: #ff6b5b;
  --auth-radius: 18px;

  position: relative;
  padding: clamp(24px, 5vw, 56px) 16px;
}

/* soft ember glow behind the card */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 320px at 50% 18%, rgba(255, 122, 26, .16), transparent 70%),
    radial-gradient(500px 260px at 50% 100%, rgba(156, 17, 17, .22), transparent 70%);
  pointer-events: none;
}

/* ---------- card ---------- */

.auth-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border-radius: var(--auth-radius);
  background: linear-gradient(160deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 100%);
  border: 1px solid var(--auth-line);
  box-shadow:
    0 0 0 1px rgba(255, 211, 107, .06) inset,
    0 24px 60px rgba(0, 0, 0, .55),
    0 0 40px rgba(255, 122, 26, .10);
  color: var(--auth-ink);
  overflow: hidden;
}

/* login: fewer fields, so a narrower card */
.auth-card--narrow {
  max-width: 460px;
}

/* gold rim along the top edge */
.auth-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--auth-line-hot), var(--auth-gold), var(--auth-line-hot), transparent);
}

.auth-card__head {
  text-align: center;
  padding: 30px 28px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: radial-gradient(420px 140px at 50% 0%, rgba(255, 140, 40, .14), transparent 75%);
}

.auth-card__logo {
  width: min(190px, 52%);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6));
  margin-bottom: 6px;
}

.auth-card__title {
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 600;
  margin: 0;
  background: linear-gradient(180deg, #fff3cf 0%, var(--auth-gold) 45%, var(--auth-line-hot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .01em;
}

.auth-card__sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-card__body {
  padding: 24px 28px 28px;
}

/* ---------- fields ---------- */

.auth-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #d9b48f;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.auth-field {
  display: flex;
  align-items: center;
  background: var(--auth-field);
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.auth-field:hover {
  border-color: #6b2a0e;
}

.auth-field:focus-within {
  border-color: var(--auth-line-hot);
  background: rgba(0, 0, 0, .5);
  box-shadow: 0 0 0 3px rgba(217, 136, 61, .22), 0 0 18px rgba(255, 122, 26, .18);
}

.auth-field__icon {
  flex: none;
  width: 44px;
  text-align: center;
  color: var(--auth-line-hot);
  font-size: 15px;
}

.auth-field input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--auth-ink);
  font-size: 15px;
  font-family: inherit;
  color-scheme: dark; /* dark calendar popup */
}

.auth-field input::placeholder {
  color: #7d6656;
}

/* browser autofill would paint the field white/blue */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-ink);
  -webkit-box-shadow: 0 0 0 1000px #1d0603 inset;
  caret-color: var(--auth-ink);
  transition: background-color 9999s ease-out;
}

.auth-field__toggle {
  flex: none;
  width: 44px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  transition: color .15s ease;
}

.auth-field__toggle:hover,
.auth-field__toggle:focus-visible {
  color: var(--auth-gold);
  outline: none;
}

.auth-hint {
  margin: 6px 2px 0;
  font-size: 12px;
  color: var(--auth-muted);
}

@media (max-width: 575.98px) {
  .auth-card__head {
    padding: 24px 18px 14px;
  }

  .auth-card__body {
    padding: 20px 18px 22px;
  }
}

/* ---------- terms switch ---------- */

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
}

.auth-terms .form-check-input {
  flex: none;
  margin: 2px 0 0;
  width: 2.4em;
  height: 1.3em;
  cursor: pointer;
  background-color: #2b0e06;
  border-color: #6b2a0e;
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a8907c'/%3e%3c/svg%3e");
}

.auth-terms .form-check-input:checked {
  background-color: var(--auth-line-hot);
  border-color: var(--auth-line-hot);
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.auth-terms .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(217, 136, 61, .25);
  border-color: var(--auth-line-hot);
}

.auth-terms label {
  font-size: 14px;
  line-height: 1.5;
  color: #d8c4b2;
  cursor: pointer;
}

/* ---------- captcha + button ---------- */

.auth-captcha {
  margin-bottom: 18px;
  min-height: 65px;
}

.btn-auth {
  position: relative;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  color: #2a0a02;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #ffe08a 0%, #f5a547 48%, #e07325 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .55) inset,
    0 -2px 0 rgba(120, 40, 0, .35) inset,
    0 8px 22px rgba(224, 115, 37, .35);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}

/* moving shine */
.btn-auth::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}

.btn-auth:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .55) inset,
    0 -2px 0 rgba(120, 40, 0, .35) inset,
    0 12px 28px rgba(255, 122, 26, .45);
}

.btn-auth:hover:not(:disabled)::after {
  left: 120%;
}

.btn-auth:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-auth:focus-visible {
  outline: 2px solid var(--auth-gold);
  outline-offset: 3px;
}

.btn-auth:disabled {
  cursor: not-allowed;
  color: #8a6a55;
  background: linear-gradient(180deg, #3a1a0e 0%, #2a1008 100%);
  box-shadow: 0 0 0 1px var(--auth-line) inset;
}

.auth-alt {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-alt a {
  color: var(--auth-gold);
  font-weight: 500;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* ---------- registration closed notice ---------- */
.auth-closed {
  position: relative;
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 18px 20px;
  border-radius: var(--auth-radius);
  border: 1px solid var(--auth-danger);
  background: rgba(156, 17, 17, .35);
  color: #fff3cf;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 0 24px rgba(255, 107, 91, .25);
}

.auth-closed i {
  margin-right: 10px;
  color: var(--auth-gold);
}

@media (prefers-reduced-motion: reduce) {
  .auth-field,
  .btn-auth,
  .btn-auth::after {
    transition: none;
  }
}
