/* Component: auth — isolated, full-screen X-style authentication screen. */
.wpar-app--auth {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.wpar-app--auth .wpar-view {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.wpar-app--auth .wpar-view--auth {
  display: block;
}

/* Safety net: the header is not rendered on auth screens, but never show it if a theme or script injects one. */
.wpar-app--auth .wpar-topbar {
  display: none;
}
.wpar-view--auth {
  min-height: calc(100vh - var(--wpar-top, 0px));
}

.wpar-auth {
  position: relative;
  min-height: calc(100vh - var(--wpar-top, 0px));
  display: grid;
  place-items: center;
  padding: 56px 20px 40px;
  background: #fff;
}

.wpar-auth__top {
  position: fixed;
  top: calc(var(--wpar-top, 0px) + 18px);
  left: 22px;
  z-index: 2;
}

.wpar-auth__back {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
}

.wpar-auth__back:hover { background: var(--field); }

.wpar-auth__card {
  width: min(100%, 600px);
  min-height: 600px;
  padding: 40px 44px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wpar-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}

.wpar-auth__logo .wpar-brand { padding: 0; font-size: 22px; }

.wpar-auth__logo .wpar-brand__logo {
  --logo-h: 38px;
  top: 0; /* centred on its own row, no header optical nudge */
}

/* The auth screen is always light (white card), so keep the original brand blue in dark mode too. */
.wpar-auth__logo .wpar-brand__logo path { fill: #2f3fbf; }

.wpar-auth h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #0a0f3d;
}

.wpar-auth__subtitle {
  margin: 12px auto 28px;
  max-width: 440px;
  text-align: center;
  color: #5a6288;
  font-size: 15px;
}

.wpar-auth__google-wrap { min-height: 44px; }
.wpar-auth__google { display: flex; justify-content: center; min-height: 44px; }
/* Google caps its button at 400 px, so centre it in the form column instead of stretching its wrapper
   (a 100%-wide wrapper left the 400 px button hugging the left edge). */
.wpar-auth__google > div { width: auto !important; max-width: 100%; margin: 0 auto; }
/* Never squeeze Google's iframe: its button does not reflow, so a max-width clips the rounded right end.
   auth.js sizes the button to fit the column instead. */
.wpar-auth__google iframe { max-width: none; }

.wpar-auth__google-fallback {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cdd5ee;
  border-radius: 999px;
  background: #fff;
  color: #0a0f3d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.wpar-auth__google-fallback:hover { background: #f1f4ff; }
.wpar-auth__google-fallback[hidden] { display: none; }

.wpar-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #5a6288;
  font-size: 14px;
}

.wpar-auth__divider::before,
.wpar-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e6ebff;
}

.wpar-auth__form { display: grid; gap: 14px; }
.wpar-auth__password-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.wpar-auth__field { display: grid; gap: 6px; }
.wpar-auth__field > span { font-size: 13px; font-weight: 650; color: #5a6288; }
.wpar-auth__field--required > span::after {
  content: "*";
  margin-left: 3px;
  color: #dc2626;
  font-weight: 700;
}

.wpar-auth__field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid #cdd5ee;
  border-radius: 10px;
  background: #fff;
  color: #0a0f3d;
  font: inherit;
  font-size: 16px;
}

.wpar-auth__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.wpar-auth__field.is-invalid > span { color: #b42318; }
.wpar-auth__field.is-invalid input {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626;
  background: #fffafa;
}
.wpar-auth__field.is-invalid input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626, 0 0 0 4px rgba(220, 38, 38, .10);
}
.wpar-auth__field.is-invalid .wpar-phone {
  border-radius: 10px;
  box-shadow: 0 0 0 1px #dc2626;
}
.wpar-auth__field.is-invalid .wpar-phone__input {
  border-color: transparent;
  box-shadow: none;
  background: #fffafa;
}

@media (max-width: 640px) {
  .wpar-auth__password-row { grid-template-columns: 1fr; }
}

.wpar-auth__form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.wpar-auth__form-row a,
.wpar-auth__switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.wpar-auth__form-row a:hover,
.wpar-auth__switch a:hover { text-decoration: underline; }

.wpar-auth__remember { display: inline-flex; align-items: center; gap: 7px; color: #5a6288; }
.wpar-auth__remember input { accent-color: var(--accent); }

.wpar-auth__submit {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: #03075b;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.wpar-auth__submit:hover { background: #1e2365; }
.wpar-auth__submit:disabled { opacity: .6; cursor: wait; }

.wpar-auth__error {
  padding: 11px 13px;
  border-radius: 10px;
  background: #fff1f0;
  color: #b42318;
  font-size: 14px;
}

.wpar-auth__success {
  padding: 12px 13px;
  border-radius: 10px;
  background: #eefaf3;
  color: #166534;
  font-size: 14px;
  line-height: 1.5;
}

.wpar-auth__success[hidden] { display: none; }

.wpar-auth__switch {
  margin: 22px 0 0;
  text-align: center;
  color: #5a6288;
  font-size: 14px;
}

.wpar-auth__legal {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  margin: 0;
  text-align: center;
  color: #8a93b8;
  font-size: 12px;
}

@media (max-width: 600px) {
  .wpar-auth { padding: 48px 16px 64px; align-items: start; }
  .wpar-auth__card { min-height: 0; padding: 38px 4px 20px; }
  .wpar-auth__logo { margin-bottom: 28px; }
  .wpar-auth__logo .wpar-brand__logo { --logo-h: 32px; }
  .wpar-auth__top { left: 12px; }
}
