.site-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1550;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.site-account-modal {
  position: fixed;
  inset: 0;
  z-index: 1560;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.site-account-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-auth-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-auth-sheet {
  position: absolute;
  inset: 24px;
  width: min(480px, calc(100vw - 48px));
  margin: auto;
  height: fit-content;
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 243, 251, 0.9)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  transform: translateY(20px) scale(0.985);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.site-account-sheet {
  width: min(760px, calc(100vw - 48px));
  height: min(760px, calc(100dvh - 48px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.site-auth-sheet::-webkit-scrollbar {
  display: none;
}

.site-auth-modal.is-open .site-auth-sheet {
  transform: translateY(0) scale(1);
}

.site-auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.site-auth-header h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.site-auth-body {
  margin-top: 20px;
}

.site-account-body {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.site-auth-panel {
  display: grid;
  gap: 16px;
}

.site-account-panel {
  display: grid;
  gap: 14px;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
}

.site-account-panel[hidden] {
  display: none !important;
}

.site-auth-panel[hidden] {
  display: none !important;
}

.site-auth-panel [hidden] {
  display: none !important;
}

.site-auth-copy {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.site-account-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.site-account-tab {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.site-account-tab.is-active {
  background: rgba(255, 255, 255, 0.82);
  color: #3c5a80;
  border-color: rgba(255, 255, 255, 0.22);
}

.account-toggle {
  position: relative;
  overflow: hidden;
}

.account-toggle-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-toggle-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-toggle-avatar img[src=""],
.account-toggle-avatar img:not([src]) {
  display: none;
}

.account-toggle.is-signed-in > svg {
  opacity: 0;
}

.site-auth-provider-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.site-auth-provider-icon,
.site-auth-submit {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.site-auth-provider-icon {
  min-width: 64px;
  height: 52px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1.1rem;
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.82),
    inset -1px -1px 1px rgba(148, 163, 184, 0.08);
}

.site-auth-submit {
  width: 100%;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0 18px;
}

.site-auth-provider-icon.google {
  background: rgba(255, 255, 255, 0.92);
}

.site-auth-provider-icon.facebook {
  background: rgba(24, 119, 242, 0.12);
  border-color: rgba(24, 119, 242, 0.2);
  color: #1877f2;
}

.site-auth-provider-icon.apple {
  background: rgba(15, 23, 42, 0.08);
}

.site-auth-submit.secondary {
  background: rgba(241, 245, 249, 0.92);
}

.site-auth-divider {
  position: relative;
  text-align: center;
  color: #64748b;
  font-size: 0.86rem;
}

.site-auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.site-auth-divider span {
  position: relative;
  z-index: 1;
  background: rgba(244, 247, 252, 0.92);
  padding: 0 12px;
}

.site-auth-form {
  display: grid;
  gap: 14px;
}

.site-account-form {
  display: grid;
  gap: 14px;
}

.site-account-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.84);
  padding: 14px 16px;
  font: inherit;
  color: #0f172a;
}

.site-account-actions {
  display: grid;
}

.site-auth-form-actions {
  display: grid;
  gap: 10px;
}

.site-auth-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.site-auth-mode-btn {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.site-auth-mode-btn.is-active {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border-color: rgba(15, 23, 42, 0.9);
}

.site-auth-field {
  display: grid;
  gap: 8px;
}

.site-auth-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.site-auth-field input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.84);
  padding: 14px 16px;
  font: inherit;
  color: #0f172a;
}

.site-auth-phone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.site-auth-phone-prefix {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(241, 245, 249, 0.9);
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-auth-status {
  min-height: 1.3em;
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.site-auth-status[hidden] {
  display: none !important;
}

.site-auth-user-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.site-account-orders {
  display: grid;
  gap: 12px;
}

.site-account-favorites {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.site-account-favorite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  text-align: left;
  min-height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.site-account-favorite-card:hover,
.site-account-favorite-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
  outline: none;
}

.site-account-favorite-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.site-account-favorite-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.site-account-favorite-copy strong,
.site-account-favorite-copy span,
.site-account-favorite-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-account-favorite-copy strong {
  color: #0f172a;
  font-size: 0.88rem;
  line-height: 1.24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.site-account-favorite-copy span {
  color: #475569;
  font-size: 0.8rem;
}

.site-account-favorite-copy small {
  color: #64748b;
  font-size: 0.74rem;
  white-space: nowrap;
}

.site-account-favorite-price {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.86rem;
}

.site-account-empty {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.58);
  color: #475569;
}

.site-account-order-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.site-account-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.site-account-order-id {
  margin: 0;
  font-weight: 800;
  color: #0f172a;
}

.site-account-order-date {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.92rem;
}

.site-account-order-total {
  text-align: right;
  color: #0f172a;
  font-weight: 800;
}

.site-account-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-account-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.78);
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}

.site-account-pill.paid {
  background: rgba(187, 247, 208, 0.8);
  color: #166534;
}

.site-account-pill.pending {
  background: rgba(254, 240, 138, 0.8);
  color: #854d0e;
}

.site-account-pill.delivered {
  background: rgba(191, 219, 254, 0.82);
  color: #1d4ed8;
}

.site-account-order-items {
  display: grid;
  gap: 8px;
}

.site-account-order-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 0.95rem;
}

.site-account-order-item small {
  color: #64748b;
}

.site-auth-user-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.site-auth-avatar-shell {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(203, 213, 225, 0.6));
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(15, 23, 42, 0.08);
}

.site-auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.92);
}

.site-auth-user-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.site-auth-user-card strong {
  color: #0f172a;
  font-size: 1.06rem;
}

.site-auth-user-card span {
  color: #475569;
  word-break: break-word;
}

.site-auth-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.site-auth-quick-action {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site-auth-quick-action i {
  font-size: 0.95rem;
}

body.auth-modal-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  .site-auth-sheet {
    inset: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px;
    border-radius: 26px;
  }

  .site-auth-provider-strip {
    justify-content: center;
    flex-wrap: wrap;
  }

  .site-account-sheet {
    width: calc(100vw - 24px);
    height: min(760px, calc(100dvh - 24px));
  }

  .site-account-tabs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    grid-template-columns: none;
  }

  .site-account-tabs::-webkit-scrollbar {
    display: none;
  }

  .site-account-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.83rem;
    white-space: nowrap;
  }

  .site-account-favorite-card {
    padding: 14px;
  }

  .site-account-favorites {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .site-account-favorite-copy strong {
    font-size: 0.92rem;
  }

  .site-account-order-head,
  .site-account-order-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-account-order-total {
    text-align: left;
  }

  .site-auth-user-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .site-auth-user-meta {
    justify-items: center;
  }
}

/* Iridescent pill treatment */
.site-account-tab,
.site-auth-submit,
.site-auth-quick-action {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 999px;
  border: 0;
  outline: 0;
  transition:
    color 0.33s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.33s cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow 0.33s cubic-bezier(0.33, 1, 0.68, 1),
    background 0.33s cubic-bezier(0.33, 1, 0.68, 1);
  background:
    linear-gradient(to bottom, oklch(0.96 0.01 257), oklch(0.93 0.018 257 / 82%) 34%, oklch(0.985 0.01 257 / 82%));
  box-shadow:
    inset 0 0 0 0 oklch(1 0.02 257 / 0),
    inset -0.35em -0.35em 0.25em -0.25em oklch(0.99 0.02 257),
    inset -0.33em -1em 0.75em -0.75em oklch(0.99 0.01 257),
    oklch(0.35 0.1 257 / 0.12) 0 0.3em 0.3em 0,
    oklch(0.35 0.1 257 / 0.12) 0 0.18em 0.18em 0,
    oklch(0.35 0.1 257 / 0.10) 0 0.05em 0.05em 0;
  -webkit-appearance: none;
  appearance: none;
}

.site-account-tab::before,
.site-auth-submit::before,
.site-auth-quick-action::before,
.site-account-tab::after,
.site-auth-submit::after,
.site-auth-quick-action::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  transition: all 0.33s cubic-bezier(0.33, 1, 0.68, 1);
}

.site-account-tab::before,
.site-auth-submit::before,
.site-auth-quick-action::before {
  opacity: 0;
  translate: 0.9em 0;
  scale: 0.84;
  background: linear-gradient(
    98deg in oklab,
    oklch(0.8 0.1348 355.91) -5%,
    oklch(0.8 0.2 280),
    oklch(0.98 0.22 200) 160%
  );
  mask: linear-gradient(166deg, transparent 60%, black);
  filter: blur(5px) brightness(1) contrast(1.24);
  box-shadow:
    inset 0 -1px 0 1px oklch(0.99 0.01 257 / 20%),
    inset 0 -0.25em 0.25em 0.125em oklch(0.99 0.01 257 / 40%);
  z-index: 0;
}

.site-account-tab::after,
.site-auth-submit::after,
.site-auth-quick-action::after {
  opacity: 0.36;
  box-shadow:
    inset 0 -0.3em 2px 1px oklch(0.99 0.01 257),
    inset 0 -0.3em 0.25em oklch(0.99 0.01 257),
    inset 0 -0.3em 0.5em oklch(0.99 0.01 257);
  mix-blend-mode: lighten;
  z-index: 0;
}

.site-account-tab > *,
.site-auth-submit > *,
.site-auth-quick-action > * {
  position: relative;
  z-index: 1;
}

.site-account-tab:hover,
.site-account-tab:focus-visible,
.site-auth-submit:hover,
.site-auth-submit:focus-visible,
.site-auth-quick-action:hover,
.site-auth-quick-action:focus-visible {
  color: #3c5a80;
  transform: translateY(-1px);
}

.site-account-tab:hover::before,
.site-account-tab:focus-visible::before,
.site-auth-submit:hover::before,
.site-auth-submit:focus-visible::before,
.site-auth-quick-action:hover::before,
.site-auth-quick-action:focus-visible::before {
  opacity: 0.58;
  translate: 0 0;
  scale: 1;
}

.site-account-tab:hover::after,
.site-account-tab:focus-visible::after,
.site-auth-submit:hover::after,
.site-auth-submit:focus-visible::after,
.site-auth-quick-action:hover::after,
.site-auth-quick-action:focus-visible::after {
  opacity: 0.8;
}

.site-account-tab:active,
.site-auth-submit:active,
.site-auth-quick-action:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 0.25em 0.66em 0 oklch(1 0.02 257 / 0.66),
    inset -0.35em -0.35em 0.25em -0.25em oklch(0.99 0.02 257),
    inset -0.33em -1em 0.75em -0.75em oklch(0.99 0.01 257),
    oklch(0.35 0.1 257 / 0.12) 0 0.15em 0.15em 0,
    oklch(0.35 0.1 257 / 0.12) 0 0.09em 0.09em 0,
    oklch(0.35 0.1 257 / 0.10) 0 0.025em 0.025em 0;
}

.site-account-tab:active::before,
.site-auth-submit:active::before,
.site-auth-quick-action:active::before {
  opacity: 0.72;
  translate: 0 0;
  scale: 1.06;
  filter: blur(6px) brightness(1.05) contrast(1.28);
}

.site-account-tab:active::after,
.site-auth-submit:active::after,
.site-auth-quick-action:active::after {
  opacity: 1;
}

.site-account-tab.is-active {
  color: #3c5a80;
  box-shadow:
    inset 0 0.18em 0.4em 0 oklch(1 0.02 257 / 0.45),
    inset -0.35em -0.35em 0.25em -0.25em oklch(0.99 0.02 257),
    inset -0.33em -1em 0.75em -0.75em oklch(0.99 0.01 257),
    oklch(0.35 0.1 257 / 0.12) 0 0.22em 0.22em 0,
    oklch(0.35 0.1 257 / 0.10) 0 0.04em 0.05em 0;
}

.site-account-tab.is-active::before {
  opacity: 0.44;
  translate: 0 0;
  scale: 1;
}

.site-account-tab.is-active::after {
  opacity: 0.72;
}
