/*
  PawBank design tokens, after Material Design 3.

  Color: tonal palettes from the seed #cc1d92 (tone = CIELAB L*, hue of the seed; primary, secondary, neutral and
  neutral variant on the seed hue, tertiary 60° further, error is the M3 default). Every role is one light-dark() pair,
  so it follows `color-scheme`: the system setting by default, or the theme the user picked (data-theme on <html>,
  set by js/theme-init.js and ThemeService).
*/
:root {
  color-scheme: light dark;

  /* Color roles: light-dark(light tone, dark tone) */
  --pb-color-primary: light-dark(#b4007f, #ffaeda);
  --pb-color-on-primary: light-dark(#ffffff, #620043);
  --pb-color-primary-container: light-dark(#ffd8ec, #8a0060);
  --pb-color-on-primary-container: light-dark(#3c0028, #ffd8ec);
  --pb-color-inverse-primary: light-dark(#ffaeda, #b4007f);

  --pb-color-secondary: light-dark(#7c5268, #e9b9d2);
  --pb-color-on-secondary: light-dark(#ffffff, #4a2439);
  --pb-color-secondary-container: light-dark(#ffd8ec, #623a50);
  --pb-color-on-secondary-container: light-dark(#320e24, #ffd8ec);

  --pb-color-tertiary: light-dark(#8a4f3b, #fdb69e);
  --pb-color-on-tertiary: light-dark(#ffffff, #542110);
  --pb-color-tertiary-container: light-dark(#ffdbcf, #6f3725);
  --pb-color-on-tertiary-container: light-dark(#331100, #ffdbcf);

  --pb-color-error: light-dark(#ba1a1a, #ffb4ab);
  --pb-color-on-error: light-dark(#ffffff, #690005);
  --pb-color-error-container: light-dark(#ffdad6, #93000a);
  --pb-color-on-error-container: light-dark(#410002, #ffdad6);

  --pb-color-surface: light-dark(#fff7fb, #191115);
  --pb-color-surface-dim: light-dark(#e2d7dd, #191115);
  --pb-color-surface-bright: light-dark(#fff7fb, #40373b);
  --pb-color-surface-container-lowest: light-dark(#ffffff, #160b11);
  --pb-color-surface-container-low: light-dark(#fcf1f6, #21191d);
  --pb-color-surface-container: light-dark(#f6ebf0, #251d21);
  --pb-color-surface-container-high: light-dark(#f1e5eb, #30282c);
  --pb-color-surface-container-highest: light-dark(#ebdfe5, #3b3237);
  --pb-color-surface-variant: light-dark(#f3dce8, #54424b);
  --pb-color-on-surface: light-dark(#21191d, #ebdfe5);
  --pb-color-on-surface-variant: light-dark(#54424b, #d7c1cc);
  --pb-color-inverse-surface: light-dark(#372e32, #ebdfe5);
  --pb-color-inverse-on-surface: light-dark(#f9eef3, #372e32);

  --pb-color-outline: light-dark(#86727c, #a08b96);
  --pb-color-outline-variant: light-dark(#d7c1cc, #54424b);
  --pb-color-shadow: #000000;
  --pb-color-scrim: #000000;

  /* State layers and disabled opacities */
  --pb-state-hover: 8%;
  --pb-state-focus: 10%;
  --pb-state-pressed: 10%;
  --pb-state-dragged: 16%;
  --pb-disabled-content: 38%;
  --pb-disabled-container: 12%;

  /* Typography: system font stack (no font files, no font service). font shorthand + separate tracking. */
  --pb-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pb-font-family-code: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --pb-type-display-large: 400 3.5625rem/4rem var(--pb-font-family);
  --pb-type-display-large-tracking: -0.016rem;
  --pb-type-display-medium: 400 2.8125rem/3.25rem var(--pb-font-family);
  --pb-type-display-medium-tracking: 0;
  --pb-type-display-small: 400 2.25rem/2.75rem var(--pb-font-family);
  --pb-type-display-small-tracking: 0;

  --pb-type-headline-large: 400 2rem/2.5rem var(--pb-font-family);
  --pb-type-headline-large-tracking: 0;
  --pb-type-headline-medium: 400 1.75rem/2.25rem var(--pb-font-family);
  --pb-type-headline-medium-tracking: 0;
  --pb-type-headline-small: 400 1.5rem/2rem var(--pb-font-family);
  --pb-type-headline-small-tracking: 0;

  --pb-type-title-large: 400 1.375rem/1.75rem var(--pb-font-family);
  --pb-type-title-large-tracking: 0;
  --pb-type-title-medium: 500 1rem/1.5rem var(--pb-font-family);
  --pb-type-title-medium-tracking: 0.009rem;
  --pb-type-title-small: 500 0.875rem/1.25rem var(--pb-font-family);
  --pb-type-title-small-tracking: 0.006rem;

  --pb-type-body-large: 400 1rem/1.5rem var(--pb-font-family);
  --pb-type-body-large-tracking: 0.031rem;
  --pb-type-body-medium: 400 0.875rem/1.25rem var(--pb-font-family);
  --pb-type-body-medium-tracking: 0.016rem;
  --pb-type-body-small: 400 0.75rem/1rem var(--pb-font-family);
  --pb-type-body-small-tracking: 0.025rem;

  --pb-type-label-large: 500 0.875rem/1.25rem var(--pb-font-family);
  --pb-type-label-large-tracking: 0.006rem;
  --pb-type-label-medium: 500 0.75rem/1rem var(--pb-font-family);
  --pb-type-label-medium-tracking: 0.031rem;
  --pb-type-label-small: 500 0.6875rem/1rem var(--pb-font-family);
  --pb-type-label-small-tracking: 0.031rem;

  /* Shape */
  --pb-shape-none: 0;
  --pb-shape-extra-small: 0.25rem;
  --pb-shape-small: 0.5rem;
  --pb-shape-medium: 0.75rem;
  --pb-shape-large: 1rem;
  --pb-shape-extra-large: 1.75rem;
  --pb-shape-full: 624.9375rem;

  /* Elevation (shadows; M3 also tints surfaces by level, which the surface-container roles cover) */
  --pb-elevation-0: none;
  --pb-elevation-1: 0 1px 2px 0 rgb(0 0 0 / 30%), 0 1px 3px 1px rgb(0 0 0 / 15%);
  --pb-elevation-2: 0 1px 2px 0 rgb(0 0 0 / 30%), 0 2px 6px 2px rgb(0 0 0 / 15%);
  --pb-elevation-3: 0 1px 3px 0 rgb(0 0 0 / 30%), 0 4px 8px 3px rgb(0 0 0 / 15%);
  --pb-elevation-4: 0 2px 3px 0 rgb(0 0 0 / 30%), 0 6px 10px 4px rgb(0 0 0 / 15%);
  --pb-elevation-5: 0 4px 4px 0 rgb(0 0 0 / 30%), 0 8px 12px 6px rgb(0 0 0 / 15%);

  /* Motion */
  --pb-motion-duration-short: 150ms;
  --pb-motion-duration-medium: 250ms;
  --pb-motion-duration-long: 400ms;
  --pb-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --pb-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --pb-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);

  /* Layout */
  --pb-breakpoint-expanded: 840px; /* reference only: media queries can't read custom properties */
  --pb-top-app-bar-height: 4rem;
  --pb-navigation-bar-height: 5rem;
  --pb-navigation-rail-width: 5rem;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --pb-motion-duration-short: 0ms;
    --pb-motion-duration-medium: 0ms;
    --pb-motion-duration-long: 0ms;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/*
  Scrollbars in the app's style: a rounded "pill" thumb in the outline color (darker on hover and while dragging) on a
  transparent track, without arrow buttons, in light and dark through the color roles. Chrome, Edge and Safari need
  ::-webkit-scrollbar for this (and ignore it on an element that sets scrollbar-color or scrollbar-width, so those are
  only set where ::-webkit-scrollbar doesn't exist: Firefox, thin and outline-colored). Overlay scrollbars (phones,
  macOS) stay the platform's. The app shell's content area reserves its scrollbar's space (scrollbar-gutter), so the
  layout doesn't shift when a page starts or stops scrolling.
*/
::-webkit-scrollbar {
  width: 0.75rem;
  height: 0.75rem;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 0.1875rem solid transparent;
  border-radius: var(--pb-shape-full);
  background: var(--pb-color-outline) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--pb-color-on-surface-variant);
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--pb-color-on-surface);
}

::-webkit-scrollbar-button {
  display: none;
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--pb-color-outline) transparent;
  }
}

body {
  margin: 0;
  font: var(--pb-type-body-large);
  letter-spacing: var(--pb-type-body-large-tracking);
  color: var(--pb-color-on-surface);
  background: var(--pb-color-surface);
  -webkit-font-smoothing: antialiased;
}

/* Shared utility classes for page content. */
.pb-status {
  margin: 0;
  padding: 1.5rem;
  font: var(--pb-type-body-large);
  color: var(--pb-color-on-surface-variant);
}

.pb-error-text {
  margin: 0;
  font: var(--pb-type-body-medium);
  letter-spacing: var(--pb-type-body-medium-tracking);
  color: var(--pb-color-error);
}

.pb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000;
  padding: 0.75rem 3rem 0.75rem 1.25rem;
  background: var(--pb-color-error-container);
  color: var(--pb-color-on-error-container);
  box-shadow: var(--pb-elevation-3);
  font: var(--pb-type-body-medium);
}

#blazor-error-ui .reload {
  color: inherit;
  font-weight: 500;
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  cursor: pointer;
}

.blazor-error-boundary {
  padding: 1rem 1.5rem;
  border-radius: var(--pb-shape-medium);
  background: var(--pb-color-error-container);
  color: var(--pb-color-on-error-container);
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--pb-color-surface-container-highest);
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--pb-color-primary);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
  text-align: center;
  font: var(--pb-type-label-large);
  color: var(--pb-color-on-surface-variant);
}

.loading-progress-text::after {
  content: var(--blazor-load-percentage-text, "Loading");
}

/* Page scaffolding shared by the signed-in pages (global, so every page lays out the same way). */
.pb-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pb-page__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pb-page__title {
  margin: 0;
  font: var(--pb-type-headline-medium);
  letter-spacing: var(--pb-type-headline-medium-tracking);
}

.pb-page__text {
  margin: 0;
  color: var(--pb-color-on-surface-variant);
}

.pb-section-title {
  margin: 0;
  font: var(--pb-type-title-medium);
  letter-spacing: var(--pb-type-title-medium-tracking);
}

.pb-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pb-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}