/* Dormant customer-page behavior. These styles are loaded only by gated pages. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body.customer-dialog-open {
  overflow: hidden;
}

.customer-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.customer-status {
  min-height: 1.5rem;
}

.customer-dialog[hidden] {
  display: none !important;
}

.customer-dialog {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-dialog-panel {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-field-row,
.customer-dialog-actions,
.customer-plan-row,
.customer-nav {
  min-width: 0;
}

.customer-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.customer-field-row > input {
  min-width: 0;
}

.customer-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.customer-dialog-actions > * {
  flex: 1 1 10rem;
}

.customer-plan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.customer-break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/*
 * Customer pages use emerald as an action and status color on light surfaces.
 * Tailwind's 500/600 palette is too light for normal text and white button
 * labels, so these scoped overrides preserve the existing layout and copy
 * while meeting WCAG AA contrast.
 */
.customer-contrast-aa .text-emerald-500,
.customer-contrast-aa .text-emerald-600 {
  color: #065f46;
}

.customer-contrast-aa .text-slate-400 {
  color: #475569;
}

.customer-contrast-aa .text-red-500 {
  color: #b91c1c;
}

.customer-contrast-aa .text-cyan-400,
.customer-contrast-aa .text-cyan-600 {
  color: #0e7490;
}

.customer-contrast-aa .bg-emerald-500 {
  background-color: #065f46;
}

.customer-contrast-aa .bg-red-500 {
  background-color: #b91c1c;
}

.customer-contrast-aa #checkout-btn {
  background-color: #065f46;
  background-image: none;
  color: #ffffff;
}

.customer-contrast-aa .from-emerald-500 {
  --tw-gradient-from: #065f46 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(6 95 70 / 0%) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.customer-contrast-aa .to-emerald-600 {
  --tw-gradient-to: #064e3b var(--tw-gradient-to-position);
}

@media (hover: hover) {
  .customer-contrast-aa .hover\:bg-emerald-600:hover {
    background-color: #064e3b;
  }

  .customer-contrast-aa .hover\:bg-red-600:hover {
    background-color: #991b1b;
  }

  .customer-contrast-aa #checkout-btn:hover {
    background-color: #064e3b;
  }

  .customer-contrast-aa .hover\:from-emerald-600:hover {
    --tw-gradient-from: #064e3b var(--tw-gradient-from-position);
    --tw-gradient-to: rgb(6 78 59 / 0%) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
  }

  .customer-contrast-aa .hover\:to-emerald-700:hover {
    --tw-gradient-to: #022c22 var(--tw-gradient-to-position);
  }
}

@media (max-width: 480px) {
  .customer-field-row {
    flex-direction: column;
  }

  .customer-field-row > button,
  .customer-field-row > a {
    width: 100%;
  }

  .customer-dialog-panel {
    padding: 1.25rem !important;
  }

  .customer-nav {
    gap: 0.5rem !important;
    padding-inline: 1rem !important;
  }

  .customer-nav .customer-nav-account {
    min-width: 0;
  }

  .customer-nav .customer-nav-account > * {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-dialog *,
  .customer-dialog {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
