:root {
  --auth-coal: #151411;
  --auth-panel: #201e19;
  --auth-paper: #ffffff;
  --auth-rule: #75633c;
  --auth-gold: #ffd700;
  --auth-gold-button: #ffcd39;
  --auth-muted: #766c5b;
  --auth-error: #9e3d32;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.auth-page {
  margin: 0;
  color: #201d18;
  background: var(--auth-coal);
  font-family: Georgia, "Times New Roman", serif;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, .92fr) minmax(480px, 1.08fr);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: #f5ead5;
  background-color: #201d18;
  background-image: var(--auth-art);
  background-position: center;
  background-size: cover;
}
.auth-story::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(12, 11, 9, .42), rgba(12, 11, 9, .86));
}
.auth-story > * { position: relative; z-index: 1; }
.auth-logo { width: clamp(110px, 12vw, 170px); height: auto; }
.auth-story-copy { max-width: 570px; }
.auth-eyebrow {
  margin: 0 0 .8rem;
  color: #d5bd78;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-story h1 {
  margin: 0;
  color: #fff3db;
  font-family: 'MedievalSharp', cursive;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
}
.auth-story-copy > p:last-child { max-width: 520px; margin: 1.2rem 0 0; color: #d0c3ad; font-size: 1.03rem; line-height: 1.65; }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  color: var(--auth-gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}
.auth-back:hover { color: #ffe76a; }

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  background-color: var(--auth-paper);
  background-image:
    linear-gradient(rgba(72, 60, 40, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 60, 40, .035) 1px, transparent 1px);
  background-size: 24px 24px;
}
.auth-form-wrap { width: 100%; max-width: 470px; }
.auth-form-label-top {
  margin-bottom: .6rem;
  color: #876b22;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.auth-form-wrap h2 {
  margin: 0;
  color: #201d18;
  font-family: 'MedievalSharp', cursive;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
}
.auth-intro { margin: .7rem 0 2rem; color: var(--auth-muted); line-height: 1.55; }
.auth-alert {
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  color: #73261e;
  background: #ead0c7;
  border-left: 3px solid var(--auth-error);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .82rem;
}
.auth-field { margin-bottom: 1rem; }
.auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.auth-field label {
  display: block;
  margin-bottom: .4rem;
  color: #4e4639;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.auth-field input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: .72rem .8rem;
  color: #201d18;
  background: #ffffff;
  border: 1px solid #aa9d85;
  border-radius: 2px;
  outline: 0;
  font: 1rem Georgia, "Times New Roman", serif;
}
.auth-field input:focus { border-color: #c9a227; box-shadow: 0 0 0 3px rgba(201, 162, 39, .14); }
.auth-field-help { display: block; margin-top: .35rem; color: #847866; font: .72rem/1.4 Arial, Helvetica, sans-serif; }
.auth-between { display: flex; justify-content: flex-end; margin-top: -.35rem; margin-bottom: 1.1rem; }
.auth-inline-link { color: #705713; font: .76rem Arial, Helvetica, sans-serif; text-underline-offset: .2rem; }
.auth-submit {
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #ffcd39;
  --bs-btn-active-border-color: #ffc720;
  width: 100%;
  min-height: 48px;
  color: var(--bs-btn-active-color);
  background: var(--bs-btn-active-bg);
  border: 1px solid var(--bs-btn-active-border-color);
  border-radius: 2px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-switch {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  color: #6f6555;
  border-top: 1px solid #b8ac96;
  font: .83rem Arial, Helvetica, sans-serif;
  text-align: center;
}
.auth-switch a { color: #6f5510; font-weight: 800; }
.auth-legal { margin: 1rem 0 0; color: #8a7f6e; font: .7rem/1.5 Arial, Helvetica, sans-serif; text-align: center; }
.auth-legal a { color: #665019; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 320px; padding: 2rem; }
  .auth-story h1 { font-size: clamp(2.4rem, 8vw, 4rem); }
  .auth-form-side { padding: 3rem 1.5rem 4rem; }
}
@media (max-width: 520px) {
  .auth-story { min-height: 270px; }
  .auth-field-row { grid-template-columns: 1fr; gap: 0; }
}

/* Immersive auth composition: preserves the original full-image character. */
body.auth-page { color: #f0e5cf; }
.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
  overflow: hidden;
  place-items: start center;
}
.auth-story {
  position: absolute;
  inset: 0;
  min-height: 100%;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  background-position: center;
}
.auth-story::before { background: linear-gradient(to bottom, rgba(10, 9, 7, .48), rgba(10, 9, 7, .76)); }
.auth-story > a:first-child { align-self: center; }
.auth-logo { width: clamp(120px, 12vw, 185px); }
.auth-story-copy {
  align-self: center;
  margin: 2rem auto auto;
  text-align: center;
}
.auth-story h1 { color: var(--auth-gold); font-size: clamp(2.4rem, 4.5vw, 4.4rem); }
.auth-story-copy > p:last-child { margin-right: auto; margin-left: auto; color: #e0d5c1; }
.auth-back { position: absolute; bottom: 1.75rem; left: clamp(1.5rem, 5vw, 4rem); }

.auth-form-side {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  align-items: flex-start;
  padding: clamp(24rem, 45vh, 28rem) 1.25rem 5rem;
  background: transparent;
}
.auth-page-signup .auth-story-copy { display: none; }
.auth-page-signup .auth-form-side { padding-top: clamp(10rem, 20vh, 13rem); }
.auth-form-wrap {
  pointer-events: auto;
  max-width: 380px;
  padding: 1.5rem 1.6rem 1.4rem;
  color: #eee3ce;
  background: rgba(24, 23, 20, .96);
  border: 1px solid rgba(212, 175, 55, .34);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48);
}
.auth-page-signup .auth-form-wrap { max-width: 640px; }
.auth-form-label-top { color: #bda45f; }
.auth-form-wrap h2 { color: var(--auth-gold); font-size: clamp(1.7rem, 3vw, 2.35rem); }
.auth-intro { margin-bottom: 1.25rem; color: #aaa08e; font-size: .88rem; }
.auth-field { margin-bottom: .85rem; }
.auth-field label { color: #d9c991; font-size: .66rem; }
.auth-field input {
  min-height: 43px;
  color: #f5ead6;
  background: rgba(255, 255, 255, .055);
  border-color: #5d5548;
}
.auth-field input:focus { border-color: #d0aa31; box-shadow: 0 0 0 3px rgba(208, 170, 49, .13); }
.auth-field input::placeholder { color: #777064; }
.auth-field-help { color: #8f8779; }
.auth-inline-link { color: #d7bd6e; }
.auth-switch { color: #aaa08e; border-color: #4d473c; }
.auth-switch a,
.auth-legal a { color: var(--auth-gold); }
.auth-legal { color: #827a6d; }
.auth-alert { color: #ffd9d3; background: rgba(158, 61, 50, .26); }

@media (max-width: 900px) {
  .auth-shell { display: grid; }
  .auth-story { min-height: 100%; padding: 1.5rem; }
  .auth-story h1 { font-size: clamp(2.2rem, 8vw, 3.8rem); }
  .auth-form-side { padding: 21rem 1rem 4.5rem; }
  .auth-page-signup .auth-form-side { padding-top: 8rem; }
  .auth-back { right: 1.5rem; bottom: 1.25rem; left: auto; }
}

@media (max-width: 520px) {
  .auth-page-login .auth-story-copy > p:last-child { display: none; }
  .auth-page-login .auth-form-side { padding-top: 13.5rem; }
  .auth-form-wrap { padding: 1.25rem; }
  .auth-field-row { grid-template-columns: 1fr; gap: 0; }
}
