/*
 * Sign-in screen for signed-out visitors (2026 redesign).
 * Reads the shared tokens; each site's brand file recolors it.
 */
html body.mpj-surface-auth {
  margin: 0;
  min-height: 100vh;
  background: var(--mpj-paper, #f5f7fa) !important;
  color: var(--mpj-text, #1c2738);
  font-family: var(--mpj-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html body.mpj-surface-auth *,
html body.mpj-surface-auth *::before,
html body.mpj-surface-auth *::after { box-sizing: border-box; }

/* Other plugins' floating widgets (chat bubbles, promo popups) stay off this screen. */
html body.mpj-surface-auth [id*="mochi" i],
html body.mpj-surface-auth [class*="mochi" i],
html body.mpj-surface-auth .pum-overlay,
html body.mpj-surface-auth .pum { display: none !important; }

.mpj-auth {
  --auth-ink: var(--mpj-auth-ink, linear-gradient(150deg, #10234a 0%, #17386b 52%, #135566 100%));
  --auth-accent: var(--mpj-auth-accent, var(--mpj-blue, #1a4f9c));
  --auth-accent-hover: var(--mpj-auth-accent-hover, var(--mpj-blue-hover, #153f7d));
  --auth-tick: var(--mpj-auth-tick, #7fd8d4);
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(0, 1.25fr);
  min-height: 100vh;
}

/* Brand panel */
.mpj-auth__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 56px clamp(32px, 4.5vw, 72px) 40px;
  background: var(--auth-ink);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.mpj-auth__aside::before,
.mpj-auth__aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.mpj-auth__aside::before {
  width: 520px; height: 520px; right: -220px; top: -180px;
  background: radial-gradient(circle, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 68%);
}
.mpj-auth__aside::after {
  width: 420px; height: 420px; left: -160px; bottom: -200px;
  background: radial-gradient(circle, rgba(127,216,212,.16) 0%, rgba(127,216,212,0) 70%);
}
.mpj-auth__asideInner { margin-top: auto; margin-bottom: auto; max-width: 440px; }
.mpj-auth__eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.mpj-auth__pitch {
  margin: 0 0 28px;
  font-family: var(--mpj-serif, var(--mpj-sans));
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: #fff;
}
.mpj-auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.mpj-auth__points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.9); }
.mpj-auth__tick {
  flex: 0 0 26px; height: 26px; margin-top: -1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--auth-tick);
}
.mpj-auth__tick svg { width: 16px; height: 16px; }
.mpj-auth__asideFoot { margin: 0; font-size: 13px; color: rgba(255,255,255,.62); max-width: 440px; }

/* Form panel */
.mpj-auth__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px clamp(20px, 4vw, 56px) 40px;
  min-width: 0;
}
.mpj-auth__top {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 7vh, 72px);
}
.mpj-auth__logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--mpj-navy, #162c55); font-weight: 700; font-size: 18px; }
.mpj-auth__logo img { display: block; height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.mpj-auth__back { font-size: 14px; font-weight: 500; color: var(--mpj-muted, #5a6879); text-decoration: none; }
.mpj-auth__back:hover { color: var(--mpj-text, #1c2738); text-decoration: underline; }

.mpj-auth__card {
  width: 100%;
  max-width: 440px;
  background: var(--mpj-surface, #fff);
  border: 1px solid var(--mpj-line, #dde3eb);
  border-radius: 16px;
  padding: 36px 36px 32px;
  box-shadow: 0 1px 2px rgba(15,33,66,.05), 0 12px 32px rgba(15,33,66,.08);
}
.mpj-auth__title {
  margin: 0 0 6px;
  font-family: var(--mpj-serif, var(--mpj-sans));
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--mpj-navy, #162c55);
}
.mpj-auth__lede { margin: 0 0 24px; color: var(--mpj-muted, #5a6879); font-size: 15px; }

.mpj-auth__alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 20px; padding: 12px 14px;
  border-radius: 10px;
  background: var(--mpj-danger-bg, #fbecec);
  border: 1px solid #f1c9c9;
  color: var(--mpj-danger, #a33030);
  font-size: 14px; line-height: 1.45;
}
.mpj-auth__alert svg { flex: 0 0 18px; margin-top: 1px; }

/* Social login (third-party markup, kept tidy) */
.mpj-auth__social { margin-bottom: 4px; }
.mpj-auth__social .nsl-container { margin: 0 !important; }
.mpj-auth__social .nsl-container-buttons { padding: 0 !important; display: grid !important; gap: 10px; }
.mpj-auth__social .nsl-container-buttons a { margin: 0 !important; display: block !important; text-decoration: none !important; }
.mpj-auth__social .nsl-button {
  width: 100% !important; min-height: 46px;
  border-radius: 10px !important;
  box-shadow: none !important;
  border: 1px solid var(--mpj-line-strong, #c6cfdb) !important;
  justify-content: center;
}
.mpj-auth__social .nsl-button-default { background: #fff !important; color: var(--mpj-text, #1c2738) !important; }
.mpj-auth__or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: var(--mpj-faint, #8592a3);
  font-size: 13px;
}
.mpj-auth__or::before, .mpj-auth__or::after { content: ""; flex: 1; height: 1px; background: var(--mpj-line, #dde3eb); }

/* Form */
.mpj-auth__form { margin: 0; }
.mpj-auth__field { margin-bottom: 18px; }
.mpj-auth__field label,
.mpj-auth__labelRow label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mpj-text, #1c2738);
}
.mpj-auth__labelRow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mpj-auth__labelRow .mpj-auth__link { font-size: 13px; }
html body.mpj-surface-auth .mpj-auth__input {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--mpj-line-strong, #c6cfdb);
  border-radius: 10px;
  background: #fff;
  color: var(--mpj-text, #1c2738);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming */
  box-shadow: inset 0 1px 1px rgba(15,33,66,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
html body.mpj-surface-auth .mpj-auth__input:hover { border-color: var(--mpj-faint, #8592a3); }
html body.mpj-surface-auth .mpj-auth__input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 22%, transparent);
}
.mpj-auth__pass { position: relative; }
html body.mpj-surface-auth .mpj-auth__pass .mpj-auth__input { padding-right: 72px; }
html body.mpj-surface-auth .mpj-auth__show {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; min-width: 56px; padding: 0 10px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--mpj-muted, #5a6879);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
html body.mpj-surface-auth .mpj-auth__show:hover { background: var(--mpj-sunken, #f0f3f7); color: var(--mpj-text, #1c2738); }
html body.mpj-surface-auth .mpj-auth__show:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 1px; }

.mpj-auth__remember {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 2px 0 22px;
  font-size: 14px; color: var(--mpj-muted, #5a6879);
  cursor: pointer; user-select: none;
}
html body.mpj-surface-auth .mpj-auth__remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--auth-accent); }

html body.mpj-surface-auth .mpj-auth__submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  margin: 0; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--auth-accent);
  color: #fff;
  font: inherit; font-size: 16px; font-weight: 600;
  letter-spacing: .005em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,33,66,.12), 0 6px 16px color-mix(in srgb, var(--auth-accent) 28%, transparent);
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
html body.mpj-surface-auth .mpj-auth__submit:hover { background: var(--auth-accent-hover); }
html body.mpj-surface-auth .mpj-auth__submit:active { transform: translateY(1px); }
html body.mpj-surface-auth .mpj-auth__submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--auth-accent) 40%, transparent); outline-offset: 2px; }
html body.mpj-surface-auth .mpj-auth__submit.is-busy { opacity: .8; cursor: progress; }

.mpj-auth__link { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.mpj-auth__link:hover { text-decoration: underline; color: var(--auth-accent-hover); }
.mpj-auth__link--muted { color: var(--mpj-muted, #5a6879); font-weight: 500; }

.mpj-auth__alt { width: 100%; max-width: 440px; margin-top: 24px; text-align: center; font-size: 15px; color: var(--mpj-muted, #5a6879); }
.mpj-auth__alt p { margin: 0 0 8px; }
.mpj-auth__help { margin: auto 0 0; padding-top: 32px; font-size: 13px; color: var(--mpj-faint, #8592a3); text-align: center; }

/* Admin preview: WordPress toolbar */
html body.mpj-surface-auth.admin-bar .mpj-auth { min-height: calc(100vh - 32px); }

@media (max-width: 960px) {
  .mpj-auth { grid-template-columns: 1fr; }
  .mpj-auth__aside { display: none; }
  .mpj-auth__top { margin-bottom: 32px; }
}
@media (max-width: 480px) {
  .mpj-auth__main { padding: 20px 16px 28px; }
  .mpj-auth__card { padding: 26px 20px 24px; border-radius: 14px; }
  .mpj-auth__title { font-size: 24px; }
  .mpj-auth__logo img { height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .mpj-auth * { transition: none !important; }
}
