/* ============================================================================
   QUANT GUILD — AUTH AND ERROR GATES
   Login, register, password reset, unsubscribe, and HTTP error pages.
   Sits on the same canvas, type, and blue bar as the public site.
   ========================================================================== */

body.qg-auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f1f3f7;
  color: var(--qg-text-body);
  font-size: 15px;
}

/* The account card sits in the same hero field as education or careers.
   The canvas is the page; the card covers the middle of the drawing. */
.qg-auth-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #f1f3f7;
}

.qg-auth-stage .qg-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.qg-auth-stage .qg-hero__field {
  position: absolute;
  inset: -28px;
  width: calc(100% + 56px);
  height: calc(100% + 56px);
  display: block;
  -webkit-mask-image: none;
  mask-image: none;
}

.qg-auth-stage .qg-hero__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(820px 520px at 50% 42%, rgba(0, 74, 173, 0.07), transparent 70%),
    radial-gradient(640px 480px at 50% 58%, rgba(255, 203, 5, 0.07), transparent 68%);
}

.qg-auth-stage .qg-hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.08  0 0 0 0 0.16  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

@media (max-width: 420px) {
  body.qg-auth .qg-topnav {
    --qg-topnav-logo-h: 40px;
    --qg-topnav-pad-x: 0.7rem;
  }

  body.qg-auth .qg-topnav a.qg-topnav-cta {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }
}

body.qg-auth main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: calc(var(--qg-topnav-offset, 72px) + 40px) 16px 56px;
  box-sizing: border-box;
}

.qg-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  min-width: 0;
  margin-block: auto;
  padding: 32px 32px 28px;
  background: var(--qg-surface);
  border: 1px solid var(--qg-line);
  border-radius: var(--qg-r-panel);
  box-shadow: var(--qg-sh-card);
  scroll-margin-top: calc(var(--qg-topnav-offset, 72px) + 16px);
}

body.qg-auth--wide .qg-auth-card {
  max-width: 480px;
}

.qg-auth-kicker {
  margin: 0 0 10px;
  font-size: var(--qg-fs-eyebrow);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--qg-ls-eyebrow);
  text-transform: uppercase;
  color: var(--qg-accent);
}

.qg-auth-title {
  margin: 0;
  font-family: var(--qg-font-display);
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.032em;
  font-weight: 600;
  color: var(--qg-text);
}

.qg-auth-lede {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--qg-text-muted);
}

.qg-auth-code {
  margin: 4px 0 0;
  font-family: var(--qg-font-display);
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 600;
  color: var(--qg-text);
}

.qg-auth-card .qg-auth-lede + form,
.qg-auth-card .flash-message-container + form,
.qg-auth-card .qg-auth-steps {
  margin-top: 22px;
}

.qg-auth-card form {
  margin-top: 22px;
}

.qg-auth-card .qg-auth-steps + form {
  margin-top: 18px;
}

/* ------------------------------------------------------------- flashes */

.flash-message-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}

.flash-message {
  display: block;
  padding: 12px 14px;
  border-radius: var(--qg-r-ctl);
  border: 1px solid var(--qg-line);
  background: var(--qg-surface-2);
  color: var(--qg-text);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
}

.flash-message.danger,
.flash-message.error {
  color: var(--qg-neg);
  background: var(--qg-neg-soft);
  border-color: var(--qg-neg-line);
}

.flash-message.success {
  color: var(--qg-pos);
  background: var(--qg-pos-soft);
  border-color: var(--qg-pos-line);
}

.flash-message.info,
.flash-message.warning {
  color: var(--qg-text);
  background: var(--qg-surface-tint);
  border-color: var(--qg-accent-line);
}

/* -------------------------------------------------------------- fields */

.qg-auth-field {
  margin: 0 0 14px;
  text-align: left;
}

.qg-auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--qg-text);
}

.qg-auth-field input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--qg-line-strong);
  border-radius: var(--qg-r-ctl);
  background: var(--qg-surface);
  color: var(--qg-text);
  font: inherit;
  font-size: 15px;
}

.qg-auth-field input::placeholder {
  color: var(--qg-text-faint);
}

.qg-auth-field input:focus {
  outline: 2px solid var(--qg-accent);
  outline-offset: 1px;
  border-color: var(--qg-accent);
}

.qg-auth-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--qg-text-muted);
}

.qg-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 18px;
}

.qg-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--qg-text-body);
  cursor: pointer;
}

.qg-auth-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--qg-accent);
  cursor: pointer;
}

.qg-auth-check--block {
  align-items: flex-start;
  margin-bottom: 8px;
  font-weight: 400;
}

.qg-auth-row .qg-auth-check {
  align-items: center;
}

.qg-auth-row .qg-auth-check input {
  margin-top: 0;
}

.qg-auth-forgot {
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--qg-link);
  text-decoration: none;
  white-space: nowrap;
}

.qg-auth-forgot:hover {
  color: var(--qg-accent-hover);
  text-decoration: underline;
}

.qg-auth-card .qg-btn--block {
  margin-top: 6px;
}

.qg-auth-card .qg-auth-lede + .qg-btn--block {
  margin-top: 22px;
}

.qg-auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--qg-text-muted);
}

.qg-auth-foot a {
  color: var(--qg-link);
  font-weight: 600;
  text-decoration: none;
}

.qg-auth-foot a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------- steps */

.qg-auth-steps {
  display: flex;
  gap: 8px;
}

.progress-dot {
  flex: 1;
  height: 3px;
  border-radius: var(--qg-r-pill);
  background: var(--qg-line-strong);
}

.progress-dot.active,
.progress-dot.completed {
  background: var(--qg-accent);
}

.registration-panel {
  display: none;
}

.registration-panel.active {
  display: block;
}

.qg-auth-panel-title {
  margin: 0;
  font-family: var(--qg-font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--qg-text);
}

.qg-auth-panel-sub {
  margin: 4px 0 16px;
  font-size: 13.5px;
  color: var(--qg-text-muted);
}

.qg-auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.qg-auth-actions .qg-btn {
  flex: 1;
  width: auto;
}

.qg-auth-actions .btn-next,
.qg-auth-actions .btn-submit {
  flex: 1.4;
}

.qg-auth-captcha {
  width: 304px;
  max-width: 100%;
  margin: 16px auto 8px;
  overflow: hidden;
}

.g-recaptcha {
  min-height: 78px;
}

@media (max-width: 420px) {
  .qg-auth-captcha {
    height: 70px;
  }

  .qg-auth-captcha .g-recaptcha {
    transform: scale(0.8);
    transform-origin: left top;
  }
}

/* -------------------------------------------------------------- footer */

body.qg-auth .qg-auth-legal {
  margin-top: auto;
  padding-top: 0;
  background: var(--qg-blue);
  color: rgba(255, 255, 255, 0.78);
}

body.qg-auth .qg-auth-legal .qg-footer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 0;
  padding: 22px 0;
  border-top: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

body.qg-auth .qg-auth-legal .qg-footer__bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

body.qg-auth .qg-auth-legal .qg-footer__bar a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

body.qg-auth .qg-auth-legal .qg-footer__bar a:hover {
  color: #fff;
}

@media (max-width: 520px) {
  body.qg-auth main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .qg-auth-card {
    padding: 24px 16px 20px;
  }

  .qg-auth-actions {
    flex-direction: column-reverse;
  }

  .qg-auth-actions .qg-btn,
  .qg-auth-actions .btn-next,
  .qg-auth-actions .btn-submit {
    flex: none;
    width: 100%;
  }

  .qg-auth-title {
    font-size: 28px;
  }

  .qg-auth-code {
    font-size: 56px;
  }

  .qg-auth-row {
    flex-wrap: wrap;
  }

  .g-recaptcha {
    transform: scale(0.9);
    transform-origin: center top;
  }
}
