/* Shared non-admin components. Admin styles remain isolated under assets/admin/. */
:where(button, .button, a.button, .secondary-button) {
  min-height: unset;
  padding: 10px 14px;
  border: 0;
  border-radius: 7px;
  background: var(--accent-gradient);
  color: #fff;
  font: var(--font-weight-bold) var(--font-size-sm)/var(--line-height-tight)
    var(--font-display);
  cursor: pointer;
}

:where(button, .button, a.button, .secondary-button, .btn):disabled,
.btn-disabled {
  background: var(--bg-disabled, rgba(255, 255, 255, 0.04));
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color);
  cursor: not-allowed;
  opacity: 0.5;
}

:where(input, select, textarea) {
  font: inherit;
}

/* Every branded customer page starts with this normal-flow row. The shared
 * safe-area insets keep the wordmark stable between routes without pinning it
 * to the viewport while the document scrolls. */
.brand-slot {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  margin: 0;
  padding: max(clamp(20px, 2.34vw, 28px), env(safe-area-inset-top, 0px))
    max(clamp(20px, 2.67vw, 32px), env(safe-area-inset-right, 0px)) 14px
    max(clamp(20px, 2.67vw, 32px), env(safe-area-inset-left, 0px));
}

.brand-anchor {
  position: static !important;
  display: inline-flex;
  flex: 0 1 auto;
  width: auto !important;
  max-width: calc(100vw - 10rem);
  margin: 0 !important;
  overflow: hidden;
  color: var(--accent);
  font: 900 1rem/1.2 var(--font-display) !important;
  letter-spacing: 0.18em !important;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.modal-heading, .panel-heading) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

:where(.modal-actions, .actions, .support-actions) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--field-gap);
}

:where(.modal, .dialog, .profile-panel, .cart-panel, .access-card) {
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}

:where(.field, .field-label) {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
}

:where(.price, .product-price, .cart-item-total) {
  color: var(--price-color);
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

:where(.status, .pill, .badge, .tier-chat-badge, .secure-badge) {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.admin-password-modal {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  color: var(--text-color);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}

.admin-password-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}
.admin-password-modal h2 {
  margin: 0 0 8px;
}
.admin-password-modal p {
  color: var(--text-muted);
}
.admin-password-modal .field {
  width: 100%;
  margin-top: 8px;
}
.admin-password-modal .modal-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  margin-top: 18px;
}

.admin-password-modal .admin-passkey-login {
  width: 100%;
  margin-top: 0.75rem;
}

.admin-password-modal .admin-password-status:empty {
  display: none;
}

.admin-password-modal .admin-password-status {
  margin: 0.75rem 0 0;
  color: var(--muted, #6b7280);
  font-size: 0.875rem;
}
.admin-password-modal .modal-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-password-loading-modal {
  min-width: 180px;
  padding: 20px 24px;
  color: var(--text-color);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
}
.admin-password-loading-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.admin-password-loading-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.admin-password-loading-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: admin-password-loading-spin 700ms linear infinite;
}
@keyframes admin-password-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

:where(.message, .hint, .muted) {
  color: var(--text-muted);
}
