/* Auth routes only. JS sets the register route/status attributes on <html>. */
.login.sgc-auth-mall-redwhite-v1,
html[data-sgc-auth-toast-route="register"] {
  --sgc-auth-toast-accent: var(--sgc-accent, #b74455);
  --sgc-auth-toast-success: #16835f;
  --sgc-auth-toast-error: #c7353d;
  --sgc-auth-toast-ink: var(--sgc-ink, #26323b);
  --sgc-auth-toast-paper: var(--sgc-paper, #fff);
}

/* The compiled login page renders <u-toast> inside .login. Keep its native
   placement, visibility transition and click-through behavior. */
html body .login.sgc-auth-mall-redwhite-v1 .u-toast {
  box-sizing: border-box !important;
  width: max-content;
  max-width: min(80vw, 360px) !important;
  min-height: 44px;
  padding: 11px 16px !important;
  border: 1px solid var(--sgc-line, #e2e7ee) !important;
  border-left: 4px solid var(--sgc-auth-toast-accent) !important;
  border-radius: 10px !important;
  background: var(--sgc-auth-toast-paper) !important;
  box-shadow: 0 12px 34px rgb(38 50 59 / 18%) !important;
  color: var(--sgc-auth-toast-ink) !important;
  font: 500 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif !important;
  overflow-wrap: anywhere;
}

html body .login.sgc-auth-mall-redwhite-v1 .u-toast .u-text {
  color: inherit !important;
  font: inherit !important;
}

/* The active registration adapter uses uni.showToast({icon:'none'}), whose
   simple toast is mounted outside .createNewCount. The route attribute keeps
   these rules away from member, order and administration pages. */
html[data-sgc-auth-toast-route="register"] uni-toast .uni-simple-toast__text,
html[data-sgc-auth-toast-route="register"] uni-toast .uni-toast {
  box-sizing: border-box !important;
  max-width: min(80vw, 360px) !important;
  padding: 11px 16px !important;
  border: 1px solid var(--sgc-line, #e2e7ee) !important;
  border-left: 4px solid var(--sgc-auth-toast-accent) !important;
  border-radius: 10px !important;
  background: var(--sgc-auth-toast-paper) !important;
  box-shadow: 0 12px 34px rgb(38 50 59 / 18%) !important;
  color: var(--sgc-auth-toast-ink) !important;
  font: 500 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif !important;
  overflow-wrap: anywhere;
  white-space: normal !important;
}

/* Existing uToast "type" classes work if a future login call supplies one.
   For today's calls, JS sets data-sgc-auth-toast-kind while the toast shows. */
html body .login.sgc-auth-mall-redwhite-v1 .u-toast.u-type-success,
html[data-sgc-auth-toast-kind="success"] body .login.sgc-auth-mall-redwhite-v1 .u-toast,
html[data-sgc-auth-toast-route="register"][data-sgc-auth-toast-kind="success"] uni-toast .uni-simple-toast__text,
html[data-sgc-auth-toast-route="register"][data-sgc-auth-toast-kind="success"] uni-toast .uni-toast {
  border-left-color: var(--sgc-auth-toast-success) !important;
  background: #f3fbf7 !important;
  background: color-mix(in srgb, var(--sgc-auth-toast-accent) 12%, #f3fbf7) !important;
  color: #15583f !important;
}

html body .login.sgc-auth-mall-redwhite-v1 .u-toast.u-type-error,
html[data-sgc-auth-toast-kind="error"] body .login.sgc-auth-mall-redwhite-v1 .u-toast,
html[data-sgc-auth-toast-route="register"][data-sgc-auth-toast-kind="error"] uni-toast .uni-simple-toast__text,
html[data-sgc-auth-toast-route="register"][data-sgc-auth-toast-kind="error"] uni-toast .uni-toast {
  border-left-color: var(--sgc-auth-toast-error) !important;
  background: #fff5f5 !important;
  color: #84242b !important;
}

@media (max-width: 360px) {
  html body .login.sgc-auth-mall-redwhite-v1 .u-toast,
  html[data-sgc-auth-toast-route="register"] uni-toast .uni-simple-toast__text,
  html[data-sgc-auth-toast-route="register"] uni-toast .uni-toast {
    max-width: calc(100vw - 32px) !important;
    padding: 10px 13px !important;
  }
}
