/* Shared foundations for audience, performer, account, and policy pages. */
:root {
  /* Keep adjacent curves concentric: outer radius - gap = inner radius. */
  --radius-surface: 0.75rem;
  --radius-gap: 0.25rem;
  --radius-control: calc(var(--radius-surface) - var(--radius-gap));
  --radius-compact: calc(var(--radius-control) - var(--radius-gap));
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* A component's display layout must never override native hidden state. */
[hidden] {
  display: none !important;
}

/* Shared asynchronous loading state. Keep the visible label specific so the
   same component can describe navigation, reports, payments, and other work. */
.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  margin: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.loading-state-indicator {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: loading-state-spin 0.8s linear infinite;
}

.loading-state-label {
  min-width: 0;
  text-wrap: pretty;
}

@keyframes loading-state-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-state-indicator {
    border-inline-end-color: currentColor;
    opacity: 0.55;
    animation: none;
  }
}

/* Shared checkbox labels and controls. */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
  text-wrap: pretty;
}

.checkbox-field input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 2px solid var(--act-foreground, currentColor);
  border-radius: var(--radius-compact);
  background: transparent;
  cursor: inherit;
}

.checkbox-field input[type="checkbox"]:checked {
  background: var(--act-foreground, currentColor);
}

.checkbox-field input[type="checkbox"]:checked::before {
  content: "";
  width: 0.3rem;
  height: 0.6rem;
  margin-bottom: 0.15rem;
  border: solid var(--act-background, Canvas);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-field input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--act-foreground, currentColor);
  outline-offset: 3px;
}

.checkbox-field:has(input:disabled) {
  cursor: default;
}

@media (forced-colors: active) {
  .checkbox-field input[type="checkbox"] {
    appearance: auto;
  }

  .checkbox-field input[type="checkbox"]:checked::before {
    content: none;
  }
}

.notification-alert {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 40rem;
  margin: 1rem auto;
  padding: 0.5rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-surface);
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
}

.notification-alert:has(> p:not([hidden])) {
  display: flex;
}

.notification-alert > p {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.625rem 0.5rem;
}

.notification-alert .notification-alert-close {
  display: inline-flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-compact);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.notification-alert .notification-alert-close:hover {
  background: transparent;
}

.notification-alert .notification-alert-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
