/* Velum Studio account UI (velumstudio.app + velumstudio.dev).
   The "Log in" control and "Apply to test" CTA that sit on top of the
   coming-soon landing, and the standalone /account and /apply pages.
   No frameworks: the same gold-on-dark silk aesthetic as the landing,
   the same tokens (--ink, --cream, --gold) from velum.css. This file is
   loaded in addition to velum.css, never instead of it. */

/* ---- top-right "Log in" control (on the landing) ----------------------- */

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(14px, 2.6vh, 24px) clamp(16px, 2.6vw, 30px);
  /* Visible by default; entrance via backwards-fill so it never vanishes if the
     animation doesn't run (same rule as .auth-card / .apply-cta). */
  opacity: 1;
  animation: fade-in 2s var(--ease, cubic-bezier(.2, .7, .1, 1)) 2.4s backwards;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(244, 233, 216, .74);
  text-decoration: none;
  padding: 8px 15px;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 999px;
  background: rgba(20, 14, 10, .28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color .3s ease, border-color .3s ease, background .3s ease;
  white-space: nowrap;
}

.topbar-link:hover,
.topbar-link:focus-visible {
  color: var(--cream, #f4e9d8);
  border-color: rgba(212, 175, 55, .8);
  background: rgba(212, 175, 55, .12);
}

.topbar-link:focus-visible {
  outline: 1px solid rgba(212, 175, 55, .6);
  outline-offset: 2px;
}

/* When logged in the control shows the account name with a small gold dot. */
.topbar-link.signed-in::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold, #d4af37);
  box-shadow: 0 0 8px rgba(212, 175, 55, .8);
}

/* ---- "Apply to test" CTA (on the landing) ------------------------------- */

.apply-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(10px, 2.4vh, 26px);
  padding: 13px 30px;
  font-size: 15px;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink, #070506);
  text-decoration: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f4d479, var(--gold, #d4af37) 55%, #b4902a);
  box-shadow: 0 10px 30px rgba(212, 175, 55, .25), inset 0 1px 0 rgba(255, 250, 230, .5);
  /* Visible by default; the entrance uses backwards-fill so it still rises in
     but never vanishes if the animation doesn't run (see .auth-card note). */
  opacity: 1;
  animation:
    rise-in 1.8s var(--ease, cubic-bezier(.2, .7, .1, 1)) 2.2s backwards,
    cta-breathe 5.5s ease-in-out 4s infinite;
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
}

.apply-cta:hover,
.apply-cta:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 40px rgba(212, 175, 55, .4), inset 0 1px 0 rgba(255, 250, 230, .6);
}

.apply-cta:focus-visible {
  outline: 2px solid rgba(255, 244, 214, .85);
  outline-offset: 3px;
}

@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 10px 30px rgba(212, 175, 55, .22), inset 0 1px 0 rgba(255, 250, 230, .5); }
  50% { box-shadow: 0 12px 34px rgba(212, 175, 55, .38), inset 0 1px 0 rgba(255, 250, 230, .55); }
}

/* rise-in: the fade-and-rise used by .auth-card and .apply-cta. These elements
   start at opacity:0 and rely on this animation to become visible — if it's
   missing, the card stays invisible and nobody can see the login form (Tee
   caught the account page rendering blank, 2026-10-31). Define it, and make
   the reduced-motion path still land at opacity:1 so the card is ALWAYS shown. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .apply-cta, .topbar { animation: none; opacity: 1; transform: none; }
}

/* ---- the standalone /account and /apply pages --------------------------- */
/* These pages are their own documents: the silk ground still drifts behind
   (from velum.css), but the body scrolls and a centred card holds the form. */

body.auth-page {
  overflow: auto;
  min-height: 100%;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 16px 56px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(16, 11, 9, .62);
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 40px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 245, 220, .06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  /* Base state is VISIBLE. The entrance animation starts it hidden (via the
     'backwards' fill applying the keyframe's `from` during the delay) and rises
     it in — but if the animation never runs for any reason (a browser quirk,
     reduced motion, a stale cache), the card still shows at opacity:1 instead of
     vanishing. Never gate visibility on an animation running. (Tee: blank card
     in Firefox, 2026-10-31.) */
  opacity: 1;
  animation: rise-in 1.2s var(--ease, cubic-bezier(.2, .7, .1, 1)) .15s backwards;
}

.auth-wordmark {
  display: block;
  width: 180px;
  max-width: 62%;
  height: auto;
  margin: 0 auto 22px;
}

.auth-card h1 {
  width: auto;
  line-height: 1.2;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  color: var(--cream, #f4e9d8);
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(244, 233, 216, .62);
  margin-bottom: 24px;
}

/* tabs: Log in / Create account */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  background: rgba(7, 5, 6, .5);
  border: 1px solid rgba(244, 233, 216, .1);
  border-radius: 12px;
}
/* auth.js hides the tab bar on the signed-in ("me") and reset panels by setting
   .hidden. The explicit display:flex above beats the UA [hidden]{display:none},
   so the attribute does nothing without this — Cory saw Log in/Create account
   still showing while signed in (2026-10-31). This makes [hidden] win. */
.auth-tabs[hidden] { display: none; }

.auth-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 13px;
  letter-spacing: .03em;
  font-weight: 600;
  color: rgba(244, 233, 216, .6);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color .25s ease, background .25s ease;
}

.auth-tab[aria-selected="true"] {
  color: var(--ink, #070506);
  background: linear-gradient(135deg, #f4d479, var(--gold, #d4af37) 60%, #c69a2f);
}

.auth-tab:focus-visible {
  outline: 2px solid rgba(212, 175, 55, .7);
  outline-offset: 2px;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(244, 233, 216, .62);
  margin-bottom: 7px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-size: 15px;
  font-family: inherit;
  color: var(--cream, #f4e9d8);
  background: rgba(7, 5, 6, .55);
  border: 1px solid rgba(244, 233, 216, .16);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(212, 175, 55, .75);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .15);
}

.field .hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(244, 233, 216, .45);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .03em;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, filter .25s ease, background .25s ease, border-color .25s ease;
}

.btn:disabled { opacity: .55; cursor: default; }

.btn.primary {
  color: var(--ink, #070506);
  background: linear-gradient(135deg, #f4d479, var(--gold, #d4af37) 58%, #b4902a);
  box-shadow: 0 8px 24px rgba(212, 175, 55, .22), inset 0 1px 0 rgba(255, 250, 230, .5);
}

.btn.primary:not(:disabled):hover,
.btn.primary:not(:disabled):focus-visible { transform: translateY(-1px); filter: brightness(1.06); }

.btn.ghost {
  color: var(--cream, #f4e9d8);
  background: rgba(20, 14, 10, .35);
  border-color: rgba(212, 175, 55, .3);
}

.btn.ghost:not(:disabled):hover,
.btn.ghost:not(:disabled):focus-visible {
  border-color: rgba(212, 175, 55, .7);
  background: rgba(212, 175, 55, .1);
}

.btn:focus-visible { outline: 2px solid rgba(255, 244, 214, .8); outline-offset: 2px; }

.btn-icon { width: 18px; height: 18px; display: block; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: rgba(244, 233, 216, .4);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(244, 233, 216, .14);
}

.auth-links {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: rgba(244, 233, 216, .55);
}

.auth-links a,
.linkbtn {
  color: var(--gold, #d4af37);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.auth-links a:hover,
.linkbtn:hover { text-decoration: underline; }

.auth-msg {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  display: none;
}
.auth-msg.show { display: block; }
.auth-msg.error {
  color: #ffd7cf;
  background: rgba(150, 40, 30, .28);
  border: 1px solid rgba(220, 90, 70, .4);
}
.auth-msg.ok {
  color: #e7f6d8;
  background: rgba(60, 110, 40, .24);
  border: 1px solid rgba(130, 190, 90, .4);
}
.auth-msg.info {
  color: var(--cream, #f4e9d8);
  background: rgba(212, 175, 55, .12);
  border: 1px solid rgba(212, 175, 55, .3);
}

/* signed-in summary (on /account when already logged in) */
.me-box { text-align: center; }
.me-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink, #070506);
  background: linear-gradient(135deg, #f4d479, var(--gold, #d4af37) 60%, #b4902a);
  background-size: cover;
  background-position: center;
}
.me-avatar.has-photo { color: transparent; }
/* The avatar doubles as a "change photo" button. */
.me-avatar-btn {
  position: relative;
  display: inline-block;
  margin: 0 auto 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}
.me-avatar-btn:focus-visible { outline: 2px solid var(--gold, #d4af37); outline-offset: 3px; }
.me-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-2, #231b1e);
  border: 1px solid var(--line, #342a2d);
  color: var(--cream-dim, #c7b8a6);
  transition: color .15s ease, border-color .15s ease;
}
.me-avatar-edit svg { width: 12px; height: 12px; }
.me-avatar-btn:hover .me-avatar-edit { color: var(--gold-soft, #e7c968); border-color: var(--gold, #d4af37); }
.me-avatar-hint {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(244, 233, 216, .45);
  margin: 0 0 12px;
}
.me-name { font-size: 19px; font-weight: 600; color: var(--cream, #f4e9d8); }
.me-email { font-size: 13px; color: rgba(244, 233, 216, .55); margin-top: 3px; }
.me-role {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold, #d4af37);
  border: 1px solid rgba(212, 175, 55, .4);
  border-radius: 999px;
}
.me-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* "Your Discord invite" (testers and above, on the signed-in account card). */
.me-invite {
  margin-top: 24px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 14px;
  background: rgba(7, 5, 6, .35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.me-invite[hidden], .me-invite .btn[hidden] { display: none; }
.me-invite-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cream, #f4e9d8);
  margin: 0;
}
.me-invite-title .icon { color: var(--gold, #d4af37); }
.me-invite-note,
.me-invite-state {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(244, 233, 216, .62);
  margin: 0;
}
.me-invite-state { color: var(--cream, #f4e9d8); }
.me-invite-state:empty { display: none; }
.me-invite .auth-msg { margin: 0; }

.back-home {
  margin-top: 26px;
  font-size: 13px;
  color: rgba(244, 233, 216, .45);
  text-decoration: none;
}
.back-home:hover { color: rgba(244, 233, 216, .8); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .apply-cta { padding: 12px 24px; font-size: 14px; }
}

/* Anti-bot honeypot: off-screen, not display:none (some bots skip hidden fields
   but will still fill one that's merely positioned away). Real people never see
   it, so it stays empty; a filled value flags a bot server-side. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
/* reCAPTCHA checkbox spacing on the register form. */
.reg-recaptcha { margin: 4px 0 16px; min-height: 0; }
.reg-recaptcha:not(:empty) { min-height: 78px; }
