/* Collect authentication shell.
   The shared auth atoms own semantics and interaction; this route-owned sheet
   owns only the Sticker Mule composition shown around them. */

html,
body.auth-surface-light {
  min-height: 100%;
}

body.auth-surface-light {
  margin: 0;
  background: var(--sm-page, #f7f4f1);
  color: var(--sm-text, #292524);
}

.sm-auth-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--sm-page, #f7f4f1);
}

.sm-auth-main {
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* stickermule.com/login cadence: card top offset reads as brand
     breathing room (their real login is airier above the card than
     ours), but the tail was pushing past the fold — 72 + footer mb
     46 → 40 + 20. Top clamp raised slightly toward their real ~72px
     offset at 900px vh. */
  padding: clamp(48px, 7vh, 80px) 24px 48px;
}

.sm-auth-card {
  box-sizing: border-box;
  width: min(400px, calc(100vw - 32px));
  /* 44px side padding: stickermule.com's card interior rhythm. */
  padding: 40px 44px 44px;
  overflow: hidden;
  border: 1px solid rgba(78, 40, 23, 0.1);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(58, 30, 12, 0.05);
}

/* Heading atoms default to the editorial serif family. Auth is a product UI
   surface, so its headings use the same Inter stack as labels, fields, and
   actions. Keeping this route-scoped prevents an auth fix from changing
   article typography elsewhere. */
.sm-auth-card h1 {
  font-family: inherit;
  text-wrap: balance;
}

.sm-auth-card [data-auth-login-intro] {
  margin: 0;
}

.sm-auth-card [data-auth-login-intro] > div {
  margin-bottom: 24px;
}

.sm-auth-card [data-google-login-block] {
  margin: 0 0 20px;
}

.sm-auth-card [data-google-login-block] > a {
  min-height: 44px;
  border-color: #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #292524;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.sm-auth-card [data-google-login-block] > a:hover {
  border-color: #a8a29e;
  background: #fafafa;
}

.sm-auth-card [data-google-login-block] [role="separator"] {
  margin-block: 20px 18px;
  color: #6b625d;
}

.sm-auth-card form[data-design-component="Form"] {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.sm-auth-card form[data-design-component="Form"] > [data-design-slot] {
  margin-block: 0;
}

.sm-auth-card form[data-design-component="Form"] > [data-design-slot="hiddenFields"],
.sm-auth-card form[data-design-component="Form"] > [data-design-slot="status"]:empty,
.sm-auth-card form[data-design-component="Form"] > [data-design-slot="error_summary"]:has(.error-summary.hidden) {
  display: none;
}

.sm-auth-card form > [data-design-slot="fields"],
.sm-auth-card form > .form-fields {
  gap: 16px;
}

.sm-auth-card label {
  color: #44403c;
  font-size: 14px;
  font-weight: 600;
}

.sm-auth-card input {
  min-height: 44px;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}

.sm-auth-card form [data-design-slot="actions"],
.sm-auth-card form .form-actions {
  /* Was mt:0 while Form.Base carried space-y-7 (48px boundary). The
     pack token is now gone and the form frame's gap-5 owns the
     boundary at 20px; add 16 back for the stickermule ~40 cadence. */
  margin-top: 16px;
  padding-top: 0;
}

.sm-auth-card form button[type="submit"] {
  min-height: 44px;
  border-color: #db4f00;
  border-radius: 6px;
  background: #db4f00;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sm-auth-card form button[type="submit"]:active {
  transform: translateY(1px);
}

.sm-auth-card a {
  color: #1257c4;
}

.sm-auth-card > p:last-child {
  margin-top: 14px;
  font-size: 13px;
}

.sm-auth-card > p:last-child a {
  /* Touch target for "Create an account" was 114x16 — below the WCAG
     2.2 24px floor. Inflate the hitbox without moving the baseline. */
  display: inline-block;
  padding: 6px 2px;
  margin: -6px -2px;
}

/* Logout is a compact two-decision surface. The generic Form molecule carries
   field and action spacing intended for full forms; neutralize that frame only
   here so cancel and confirm share one 48px grid and one baseline. */
.sm-auth-logout-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-top: 8px;
}

.sm-auth-logout-cancel,
.sm-auth-card .sm-auth-logout-form button[type="submit"] {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.sm-auth-card .sm-auth-logout-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sm-border-2, #d8cec5);
  background: #fff;
  color: var(--sm-text, #282320);
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sm-auth-card .sm-auth-logout-cancel:hover {
  border-color: #bcaea2;
  background: var(--sm-page-2, #f1ece7);
  color: var(--sm-text, #282320);
}

.sm-auth-logout-cancel:active,
.sm-auth-card .sm-auth-logout-form button[type="submit"]:active {
  transform: translateY(1px);
}

.sm-auth-logout-cancel:focus-visible {
  outline: 2px solid var(--sm-orange, #db4f00);
  outline-offset: 2px;
}

.sm-auth-card form.sm-auth-logout-form {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
}

.sm-auth-card .sm-auth-logout-form > [data-design-slot="fields"],
.sm-auth-card .sm-auth-logout-form > [data-design-slot="status"] {
  display: none;
}

.sm-auth-card .sm-auth-logout-form > [data-design-slot="actions"] {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0;
}

.sm-auth-card .sm-auth-logout-form .form-actions {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0;
}

.sm-auth-footer {
  z-index: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 10px 18px;
  border-radius: 6px;
  background: transparent;
  color: #57504a;
  font-size: 13px;
  line-height: 1;
}

.sm-auth-footer a {
  min-width: 0;
  min-height: 0;
  color: inherit;
  text-decoration: none;
}

.sm-auth-footer a:hover {
  text-decoration: underline;
}

.sm-auth-herman {
  position: absolute;
  z-index: 1;
  bottom: -1px;
  left: -28px;
  width: clamp(220px, 20vw, 280px);
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* Dialog presentation is selected by the server. It never renders the
   storefront navbar, legal footer, artwork, or orange page canvas, so the
   parent dialog cannot flash full-page chrome while JavaScript catches up. */
body.auth-surface-dialog,
.sm-auth-shell--dialog {
  min-height: 0;
  background: #fff;
}

.sm-auth-shell--dialog {
  display: block;
  overflow: visible;
}

.sm-auth-shell--dialog .sm-auth-main {
  display: block;
  padding: 0;
}

.sm-auth-shell--dialog .sm-auth-card {
  width: 100%;
  max-width: none;
  padding: 32px 32px 36px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 700px) {
  .sm-auth-main {
    padding: 24px 16px 32px;
  }

  .sm-auth-card {
    padding: 28px 24px 32px;
  }

  .sm-auth-herman {
    display: none;
  }

  .sm-auth-footer {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    max-width: calc(100vw - 32px);
    line-height: 1.35;
  }

  .sm-auth-logout-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 720px) {
  .sm-auth-main {
    padding-block: 16px 32px;
  }

  .sm-auth-card {
    padding-block: 24px 28px;
  }

  .sm-auth-footer {
    margin-bottom: 20px;
  }
}

/* Password visibility toggle — shared by login/register/reset fields.
   The wrapper reserves right padding so typed text never runs under
   the button; the button reuses SM link styling. */
.sm-password-wrap {
  position: relative;
}

.sm-password-wrap input {
  padding-right: 4.75rem;
}

.sm-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sm-text, #292524);
  opacity: 0.72;
  cursor: pointer;
}

.sm-password-toggle:hover {
  opacity: 1;
  background: rgba(41, 37, 36, 0.06);
}

.sm-password-toggle:focus-visible {
  outline: 2px solid var(--sm-orange, #ff6900);
  outline-offset: 1px;
  opacity: 1;
}
