/* Midnight Pro auth template. Shared auth core markup is injected by tokens. */

.auth-template--midnight-pro {
  --mp-bg: #0a0e27;
  --mp-bg-card: #141a36;
  --mp-bg-row: #10162e;
  --mp-border: rgba(0, 217, 255, 0.18);
  --mp-border-strong: rgba(0, 217, 255, 0.42);
  --mp-text: #e8ecf1;
  --mp-text-muted: rgba(232, 236, 241, 0.62);
  --mp-text-dim: rgba(232, 236, 241, 0.38);
  --mp-accent: var(--lobby-primary, #00d9ff);
  --mp-grid-line: rgba(255, 255, 255, 0.03);

  min-height: 100vh;
  margin: 0;
  background-color: var(--lobby-secondary, var(--mp-bg));
  background-image:
    linear-gradient(var(--mp-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mp-grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--mp-text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.auth-template--midnight-pro *,
.auth-template--midnight-pro *::before,
.auth-template--midnight-pro *::after {
  box-sizing: border-box;
}

.auth-template--midnight-pro .auth-shell {
  width: min(100%, 1100px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: center;
}

.auth-template--midnight-pro .auth-brand,
.auth-template--midnight-pro .auth-panel {
  position: relative;
  border: 1px solid var(--lobby-card-border, var(--mp-border));
  background: var(--lobby-card-bg, linear-gradient(180deg, #0d1430 0%, var(--mp-bg-card) 100%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), var(--lobby-card-glow, 0 18px 50px rgba(0, 217, 255, 0.08));
}

.auth-template--midnight-pro .auth-brand {
  min-height: 500px;
  padding: 52px 36px;
  overflow: hidden;
  display: grid;
  align-content: center;
}

.auth-template--midnight-pro .auth-brand__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 110, 232, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 110, 232, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 35%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 35%, transparent 75%);
  pointer-events: none;
}

.auth-template--midnight-pro .auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-template--midnight-pro .auth-brand__logo-wrap {
  margin-bottom: 22px;
}

.auth-template--midnight-pro .auth-brand__logo {
  display: block;
  max-width: min(260px, 72vw);
  max-height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 217, 255, 0.25));
}

.auth-template--midnight-pro .auth-brand__mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--mp-accent);
  color: var(--mp-bg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 24px;
  font-weight: 700;
}

.auth-template--midnight-pro .auth-brand__eyebrow,
.auth-template--midnight-pro .auth-panel__eyebrow {
  margin: 0 0 10px;
  color: var(--mp-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-template--midnight-pro .auth-brand h1 {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mp-accent);
  color: var(--lobby-hero-title-color, var(--mp-text));
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-template--midnight-pro .auth-brand__copy {
  max-width: 480px;
  margin: 0;
  color: var(--lobby-hero-tagline-color, var(--mp-text-muted));
  font-size: 15px;
}

.auth-template--midnight-pro .auth-panel {
  border-radius: 8px;
  padding: 28px;
}

.auth-template--midnight-pro .auth-panel__head {
  margin: 0 0 22px;
}

.auth-template--midnight-pro .auth-panel h2 {
  margin: 0 0 8px;
  color: var(--lobby-card-title-color, var(--mp-text));
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 26px;
  line-height: 1.16;
  letter-spacing: 0;
}

.auth-template--midnight-pro .auth-panel__copy {
  margin: 0;
  color: var(--mp-text-muted);
  font-size: 14px;
}

.auth-template--midnight-pro .auth-form {
  display: grid;
  gap: 14px;
}

.auth-template--midnight-pro .auth-field {
  display: grid;
  gap: 7px;
  color: var(--mp-text);
  font-size: 13px;
  font-weight: 600;
}

.auth-template--midnight-pro .auth-field em {
  color: var(--mp-text-dim);
  font-style: normal;
  font-weight: 500;
}

.auth-template--midnight-pro .auth-field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--mp-border);
  border-radius: 6px;
  background: rgba(10, 14, 39, 0.72);
  color: var(--mp-text);
  font: inherit;
  padding: 0 12px;
  outline: none;
}

.auth-template--midnight-pro .auth-field input:focus {
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-accent) 20%, transparent);
}

.auth-template--midnight-pro .auth-submit {
  height: 48px;
  border: 0;
  border-radius: 6px;
  margin-top: 2px;
  background: var(--lobby-join-bg, var(--mp-accent));
  color: var(--lobby-join-text-color, var(--mp-bg));
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-template--midnight-pro .auth-submit:disabled,
.auth-template--midnight-pro .auth-resend__button:disabled {
  opacity: 0.64;
  cursor: wait;
}

.auth-template--midnight-pro .auth-banner {
  border-radius: 6px;
  padding: 11px 12px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-template--midnight-pro .auth-banner--success {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.34);
}

.auth-template--midnight-pro .auth-banner--error {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.34);
}

.auth-template--midnight-pro .auth-error {
  min-height: 20px;
  margin: 2px 0 0;
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
}

.auth-template--midnight-pro .auth-resend {
  display: none;
  gap: 8px;
  align-items: center;
  margin: -4px 0 2px;
}

.auth-template--midnight-pro .auth-resend[data-visible="1"] {
  display: grid;
}

.auth-template--midnight-pro .auth-resend__button {
  justify-self: start;
  border: 1px solid var(--mp-border-strong);
  border-radius: 6px;
  background: rgba(0, 217, 255, 0.08);
  color: var(--mp-text);
  cursor: pointer;
  font: inherit;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
}

.auth-template--midnight-pro .auth-resend__status {
  min-height: 18px;
  color: var(--mp-text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-template--midnight-pro .auth-alt {
  margin: 18px 0 0;
  text-align: center;
  color: var(--mp-text-muted);
  font-size: 14px;
}

.auth-template--midnight-pro .auth-alt a {
  color: var(--mp-accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-template--midnight-pro .auth-alt a:hover {
  text-decoration: underline;
}

@media (max-width: 840px) {
  .auth-template--midnight-pro .auth-shell {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }

  .auth-template--midnight-pro .auth-brand {
    min-height: 280px;
    padding: 36px 24px;
  }
}

@media (max-width: 430px) {
  .auth-template--midnight-pro .auth-panel {
    padding: 22px 18px;
  }

  .auth-template--midnight-pro .auth-brand h1 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-template--midnight-pro * {
    transition: none !important;
    animation: none !important;
  }
}

/* Login Hide elements: decorative / marketing only. Functional auth controls,
   banners, status messages, navigation links, and install gate stay visible. */
.auth-template[data-hide-marketingPanel="true"] .auth-brand,
.auth-template[data-hide-logo="true"] .auth-brand__logo-wrap,
.auth-template[data-hide-brandEyebrow="true"] .auth-brand__eyebrow,
.auth-template[data-hide-brandEyebrow="true"] .auth-brand__stamp,
.auth-template[data-hide-headline="true"] .auth-brand h1,
.auth-template[data-hide-tagline="true"] .auth-brand__copy,
.auth-template[data-hide-tagline="true"] .auth-brand > p:not(.auth-brand__eyebrow):not(.auth-brand__stamp),
.auth-template[data-hide-panelEyebrow="true"] .auth-panel__eyebrow,
.auth-template[data-hide-footerNote="true"] .auth-alt--footer,
.auth-template[data-hide-ornament="true"] .auth-brand__diamond,
.auth-template[data-hide-ornament="true"] .auth-brand__rule,
.auth-template[data-hide-ornament="true"] .auth-brand__suits,
.auth-template[data-hide-ornament="true"] .auth-brand__crest,
.auth-template[data-hide-ornament="true"] .auth-brand__ribbon,
.auth-template[data-hide-ornament="true"] .auth-brand__grid,
.auth-template[data-hide-ornament="true"] .auth-brand__lights,
.auth-template[data-hide-ornament="true"] .auth-brand__bokeh {
  display: none !important;
}

.auth-template[data-hide-ornament="true"] .auth-brand::before,
.auth-template[data-hide-ornament="true"] .auth-brand::after,
.auth-template[data-hide-ornament="true"] .auth-shell::before {
  content: none !important;
  display: none !important;
}

.auth-template[data-hide-marketingPanel="true"] .auth-shell {
  grid-template-columns: minmax(0, 460px);
  justify-content: center;
}

.auth-template[data-hide-marketingPanel="true"] .auth-panel {
  width: 100%;
}

@media (max-width: 480px) {
  .auth-template[data-hide-marketingPanelMobile="true"] .auth-brand {
    display: none !important;
  }

  .auth-template[data-hide-marketingPanelMobile="true"] .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
  }

  .auth-template[data-hide-marketingPanelMobile="true"] .auth-panel {
    width: 100%;
  }
}
