/* Sign-up, log-in, forgotten password and every message the auth routes send
   back (views/modals/register.jsx, login.jsx, forgotPassword.jsx and the
   `auth-hall` cards in routes/auth/controller.js), in the trophy-hall look:
   wood frame, stone inside, iron brackets, gold for the main action, wood for
   the rest. Same in light and dark theme. Linked after style.css in
   views/layout.jsx and views/modals/loginPage.jsx. */

.auth-hall {
  --text: #f6e9cc;
  --papyrus-text: #ffe9b0;
  --ah-gold: #ffd23a;
  --ah-ink-dim: #d4c39f;
  --ah-edge: rgba(255, 220, 160, 0.16);
  --ah-panel: rgba(18, 14, 10, 0.62);
  color: var(--text);
  font-family: "Comfortaa", sans-serif;
}

/* ── Frame ── */
#modal > .modal-content.auth-hall,
.modal-content.auth-hall {
  position: relative;
  overflow: visible;
  padding: 0;
  max-width: 520px;
  border: 12px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(rgba(14, 12, 10, 0.72), rgba(14, 12, 10, 0.82)) padding-box,
    url("/gui/backgroundwalltexture.webp") center top / 260px auto repeat padding-box,
    url("/gui/wooden_texture.png") center / 300px auto repeat border-box;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.65),
    inset 0 0 0 2px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(0, 0, 0, 0.6);
}
/* The server's one-off cards (no inner scroller) keep their own padding. */
.modal-content.auth-hall:not(:has(> .auth-scroll)) {
  overflow: auto;
  padding: 24px 20px;
}
.auth-hall .ach-hall-bracket {
  position: absolute;
  top: -22px;
  height: 56px;
  width: auto;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}
.auth-hall .ach-hall-bracket-l { left: -24px; }
.auth-hall .ach-hall-bracket-r { right: -24px; transform: scaleX(-1); }
.auth-scroll {
  max-height: calc(80vh - 24px);
  overflow-y: auto;
  padding: 20px 20px 18px;
}

/* ── Header ── */
.auth-head { text-align: center; margin-bottom: 14px; }
.auth-head > i {
  display: block;
  font-size: 1.6rem;
  color: var(--ah-gold);
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6));
}
.auth-title,
.auth-hall h2,
.auth-hall h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.auth-title { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem); }
.auth-sub { margin: 6px 0 0; color: var(--ah-ink-dim); font-size: 0.9rem; line-height: 1.4; }
.auth-hall .text { color: var(--text); }

/* ── What you keep ── */
.auth-keeps {
  list-style: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  border-radius: 12px;
  background: var(--ah-panel);
  border: 1px solid var(--ah-edge);
  font-size: 0.88rem;
}
.auth-keeps li { display: flex; gap: 10px; align-items: baseline; }
.auth-keeps i { width: 1.1em; text-align: center; color: var(--ah-gold); flex: none; }

/* ── Fields ── */
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-ink-dim);
}
.auth-hall input[type="email"],
.auth-hall input[type="password"],
.auth-hall input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--ah-edge);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  font-size: 1rem;
}
.auth-hall input::placeholder { color: rgba(212, 195, 159, 0.6); }
.auth-hall input:focus { outline: none; border-color: rgba(255, 210, 58, 0.75); box-shadow: 0 0 0 3px rgba(255, 210, 58, 0.15); }
.auth-hint { color: var(--ah-ink-dim); font-size: 0.76rem; }
.auth-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 4px solid var(--ah-gold);
  background: var(--ah-panel);
  font-size: 0.84rem;
}
.auth-note i { color: var(--ah-gold); }

.auth-choice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ah-edge);
  background: var(--ah-panel);
  font-size: 0.84rem;
  display: grid;
  gap: 6px;
}
.auth-choice legend { padding: 0 4px; color: var(--ah-ink-dim); }
.auth-choice label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.auth-choice small { opacity: 0.75; }
.auth-choice input { accent-color: #f0b52e; }

/* ── Buttons ── */
.auth-actions { display: flex; gap: 10px; margin-top: 4px; }
.auth-actions > * { flex: 1; }
.auth-btn,
.auth-hall .btn,
.auth-hall .profile-btn-save,
.auth-hall .profile-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font: 800 0.9rem/1.1 "Cinzel", serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
}
.auth-btn-gold,
.auth-hall .btn-primary,
.auth-hall .profile-btn-save {
  border: 2px solid #7a5310;
  background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%);
  color: #3d2000;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 #6b4410;
}
.auth-btn-gold i,
.auth-hall .btn-primary i { color: #3d2000; }
.auth-btn-gold:hover,
.auth-hall .btn-primary:hover,
.auth-hall .profile-btn-save:hover { filter: brightness(1.06); color: #3d2000; }
.auth-btn-wood,
.auth-hall .btn-secondary,
.auth-hall .profile-btn-close {
  border: 1px solid rgba(200, 150, 12, 0.55);
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: var(--text);
  box-shadow: none;
}
.auth-btn-wood i { color: var(--ah-gold); }
.auth-btn-wood:hover,
.auth-hall .btn-secondary:hover,
.auth-hall .profile-btn-close:hover { border-color: rgba(230, 206, 106, 0.9); color: #fff; }
.auth-btn-wide { width: 100%; margin-top: 12px; }

.auth-foot { margin: 10px 0 0; text-align: center; font-size: 0.82rem; color: var(--ah-ink-dim); }
.auth-hall a:not([class]) { color: #ffe27a; text-decoration: none; border-bottom: 1px dotted rgba(255, 226, 122, 0.6); }
.auth-hall a:not([class]):hover { color: #fff; }

.auth-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--ah-panel);
  border: 1px solid var(--ah-edge);
  text-align: center;
  font-size: 0.86rem;
}
.auth-panel p { margin: 0 0 8px; }

/* Not yet allowed to register. */
.auth-locked { text-align: center; }
.auth-locked-icon { font-size: 2.2rem; color: var(--ah-gold); margin-bottom: 8px; }
.auth-locked p { color: var(--ah-ink-dim); font-size: 0.9rem; }

/* Older markup inside the server's cards: their inline panels read dark. */
.auth-hall [style*="cloud-bg2"] { background: var(--ah-panel) !important; border: 1px solid var(--ah-edge); }
.auth-hall [style*="color: #666"] { color: var(--ah-ink-dim) !important; }

@media (max-width: 480px) {
  #modal > .modal-content.auth-hall,
  .modal-content.auth-hall { width: calc(100% - 28px); border-width: 10px; }
  .auth-scroll { padding: 16px 12px 14px; }
  .auth-hall .ach-hall-bracket { top: -18px; height: 44px; }
  .auth-hall .ach-hall-bracket-l { left: -18px; }
  .auth-hall .ach-hall-bracket-r { right: -18px; }
  .auth-actions { gap: 8px; }
  .auth-btn { padding: 11px 10px; font-size: 0.84rem; }
}

/* The standalone /login page (public/login-page.css) frames its panel with a
   thin gold border; the hall frame wins there too. */
body.login-standalone #modal > .modal-content.auth-hall {
  border: 12px solid transparent;
  background-color: transparent;
  border-radius: 10px;
  max-width: 460px;
}

.modal-content.auth-hall,
.auth-btn { box-sizing: border-box; }
/* The standalone page scrolls as a page: no inner scroller to clip it. */
body.login-standalone .auth-scroll { max-height: none; overflow: visible; }
