/* Volunteer iERA — theme tokens, carried over exactly from the original app. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-inter: 'Inter', sans-serif;

  /* iERA brand palette — used on icons, links and key actions.
     Magenta #B01888 · Yellow Green #A8C94B · Vivid Azure #0099DB · Yellow #EEC135
     Everything else is a neutral, so the colour means something when it appears. */

  --background: 0 0% 98%;
  --foreground: 0 0% 9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 9%;

  --primary: 316 76% 39%;              /* #B01888 */
  --primary-foreground: 0 0% 100%;

  --secondary: 0 0% 96%;
  --secondary-foreground: 0 0% 20%;

  --muted: 0 0% 95%;
  --muted-foreground: 0 0% 45%;

  --accent: 45 85% 57%;                /* #EEC135 */
  --accent-foreground: 0 0% 12%;

  --info: 198 100% 43%;                /* #0099DB */
  --success: 76 54% 45%;               /* #A8C94B, darkened for text */

  --destructive: 0 72% 46%;
  --destructive-foreground: 0 0% 100%;

  --border: 0 0% 89%;
  --input: 0 0% 88%;
  --ring: 316 76% 39%;
  --radius: 0.75rem;

  /* Near-black chrome. Neutral, so the brand colours on the icons carry. */
  --sidebar-background: 0 0% 8%;
  --sidebar-surface: 0 0% 14%;
  --sidebar-foreground: 0 0% 92%;
  --sidebar-muted: 0 0% 62%;
  --sidebar-active: 316 70% 62%;
  --sidebar-border: 0 0% 17%;
}

/* ---------------------------------------------------------------- sidebar */

.sidebar {
  background: hsl(var(--sidebar-background));
  border-right: 1px solid hsl(var(--sidebar-border));
  color: hsl(var(--sidebar-foreground));
}

.sidebar-head,
.sidebar-user,
.sidebar-foot {
  border-color: hsl(var(--sidebar-border));
}

/* A white tile behind the mark, so a dark or coloured logo still reads on the
   dark chrome. With a dedicated light logo uploaded, the tile is dropped
   (.is-bare) and the mark sits directly on the background. */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Only when a tile is genuinely needed — a dark logo on dark chrome, or a
   light logo on a white surface. */
.sidebar-logo.has-tile {
  padding: 5px 8px;
  min-width: 2.25rem;
}
.sidebar-logo.tile-white { background: #ffffff; box-shadow: 0 1px 2px rgb(0 0 0 / .18); }
.sidebar-logo.tile-black { background: hsl(0 0% 8%); box-shadow: 0 1px 2px rgb(0 0 0 / .22); }
.sidebar-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-logo > div { background: transparent !important; }
.sidebar-logo svg { color: hsl(var(--primary)); }

.sidebar-title { color: #ffffff; font-weight: 700; }
.sidebar-sub   { color: hsl(var(--sidebar-muted)); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--sidebar-muted));
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sidebar-link:hover {
  background: hsl(var(--sidebar-surface));
  color: #ffffff;
}
.sidebar-link.is-active {
  background: hsl(var(--sidebar-active) / .16);
  color: hsl(var(--sidebar-active));
  font-weight: 600;
}
.sidebar-link.is-locked {
  color: hsl(var(--sidebar-muted) / .38);
  cursor: not-allowed;
}
.sidebar-link .sidebar-badge {
  margin-left: auto;
  background: hsl(var(--sidebar-active));
  color: #04201a;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: hsl(var(--sidebar-active) / .2);
  color: hsl(var(--sidebar-active));
}
.sidebar-avatar.is-admin {
  background: rgb(245 158 11 / .22);
  color: #fcd34d;
}

.sidebar-cta {
  background: hsl(var(--sidebar-active) / .14);
  border: 1px solid hsl(var(--sidebar-active) / .25);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.sidebar-cta p:first-child { color: hsl(var(--sidebar-active)); font-weight: 700; }
.sidebar-cta p:last-child  { color: hsl(var(--sidebar-muted)); }

.sidebar-scroll::-webkit-scrollbar-thumb { background: hsl(var(--sidebar-border)); }

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Icons are swapped in by lucide at load; reserve the box so nothing jumps. */
[data-lucide] { display: inline-block; vertical-align: middle; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / .35); }


/* Logo tile on light surfaces — keeps a transparent or pale logo from
   disappearing, and gives every placement the same silhouette. */
.auth-logo {
  background: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-logo > div { background: transparent !important; }
.auth-logo svg { color: hsl(var(--primary)); }


/* ------------------------------------------------------- sign-in screen */

.auth-shell {
  display: flex;
  min-height: 100vh;
}

.auth-panel {
  display: none;
  position: relative;
  width: 46%;
  max-width: 620px;
  background: linear-gradient(155deg,
              hsl(0 0% 8%) 0%,
              hsl(0 0% 13%) 58%,
              hsl(316 55% 22%) 135%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.auth-panel.has-image { background-color: hsl(var(--sidebar-background)); }

/* Keeps white text legible over any photograph. */
.auth-panel-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
              hsl(0 0% 6% / .88) 0%,
              hsl(0 0% 8% / .6) 45%,
              hsl(316 60% 18% / .72) 100%);
}

.auth-panel-inner {
  position: relative;
  height: 100%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: hsl(var(--background));
}

.auth-form {
  width: 100%;
  max-width: 380px;
}

@media (min-width: 1024px) {
  .auth-panel { display: block; }
  .auth-main  { padding: 48px; }
}


/* ------------------------------------------------- surfaces and materials */

body {
  background-color: hsl(var(--background));
}

/* Cards read as frosted glass rather than flat panels: translucent, blurred,
   hairline border, and a soft shadow instead of a hard one. */
.bg-card {
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(0 0% 0% / .04), 0 1px 3px hsl(0 0% 0% / .03);
}

/* A touch more roundness everywhere — softer, less boxy. */
.rounded-xl  { border-radius: 16px; }
.rounded-2xl { border-radius: 20px; }
.rounded-3xl { border-radius: 26px; }

.border-border\/60 { border-color: hsl(var(--border) / .45); }
.border-border      { border-color: hsl(var(--border) / .6); }

/* Hover lift, kept gentle. */
.hover\:shadow-md:hover {
  box-shadow: 0 1px 2px hsl(0 0% 0% / .05), 0 6px 16px -8px hsl(0 0% 0% / .14);
  border-color: hsl(var(--border));
}
.hover\:shadow-lg:hover,
.hover\:shadow-xl:hover,
.hover\:shadow-2xl:hover {
  box-shadow: 0 2px 4px hsl(0 0% 0% / .06), 0 12px 28px -12px hsl(0 0% 0% / .18);
}
.transition-all { transition-property: all; transition-duration: .18s; transition-timing-function: cubic-bezier(.2, .7, .3, 1); }

/* Icon tiles inside cards: soft brand wash rather than a solid block. */
.bg-primary\/10 { background-color: hsl(var(--primary) / .09); }

/* Tables sit inside glass cards, so their own surface stays clear. */
.bg-muted\/50 { background-color: hsl(var(--muted) / .45); }

.sidebar-logo.is-bare {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* The sidebar stays opaque — chrome should feel solid while content floats. */
.sidebar { backdrop-filter: none; }


/* Top bar: frosted, hairline base, so it separates without a hard rule. */
.topbar {
  background: hsl(var(--card) / .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}

/* Stat tiles, one per brand colour. Wash for the icon, ink for the number. */
.stat-magenta { --stat: var(--primary); }
.stat-azure   { --stat: var(--info); }
.stat-lime    { --stat: var(--success); }
.stat-yellow  { --stat: var(--accent); }
.stat-tile    { background: hsl(var(--stat) / .12); color: hsl(var(--stat)); }
.stat-value   { color: hsl(var(--stat)); }
.stat-rail    { background: hsl(var(--stat)); }

/* A hairline of colour down the leading edge of a card. */
.card-accent { position: relative; overflow: hidden; }
.card-accent::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: hsl(var(--stat, var(--primary)));
  opacity: .85;
}

/* Bars in the small charts. */
.chart-bar {
  background: linear-gradient(180deg, hsl(var(--primary) / .9), hsl(var(--primary) / .55));
  border-radius: 6px 6px 2px 2px;
  transition: opacity .15s;
}
.chart-bar:hover { opacity: .8; }


/* Viewing as someone else should never be mistaken for normal use. */
.view-as-bar {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.view-as-bar a, .view-as-bar button { color: inherit; }


/* Section labels in the sidebar — quiet, so they organise without shouting. */
.sidebar-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: hsl(var(--sidebar-muted) / .6);
  padding: 14px 12px 6px;
  margin: 0;
}

/* Page headings sit in the top bar, so content starts with substance. */
.page-lede { color: hsl(var(--muted-foreground)); font-size: 14px; margin-bottom: 24px; }


/* --------------------------------------------------------------- polish */

/* One focus treatment everywhere, brand-tinted rather than browser blue. */
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid hsl(var(--ring) / .5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Controls share a resting state, so a page of forms reads as one surface. */
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=tel], input[type=number], input[type=search], input[type=file],
select, textarea {
  background-color: hsl(var(--card) / .6);
  transition: background-color .14s, border-color .14s, box-shadow .14s;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: hsl(var(--border));
}
input:focus, select:focus, textarea:focus {
  background-color: hsl(var(--card));
}

/* Checkboxes and radios in brand colour rather than system blue. */
input[type=checkbox], input[type=radio] {
  accent-color: hsl(var(--primary));
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Buttons lift very slightly — enough to feel alive, not enough to bounce. */
button, .btn, a[class*="bg-primary"] {
  transition: background-color .14s, box-shadow .14s, transform .12s;
}
a[class*="bg-primary"]:active, button[class*="bg-primary"]:active {
  transform: translateY(1px);
}

/* Table rows: a calmer stripe than a hard hover. */
tbody tr { transition: background-color .12s; }

/* Details/summary used for collapsible panels — remove the default marker
   and give the arrow room. */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }

/* Long pages deserve a little rhythm at the bottom. */
main > div { padding-bottom: 48px; }

/* Selection in brand colour. */
::selection { background: hsl(var(--primary) / .16); }

/* Icons carry the brand. Everything around them stays neutral. */
.stat-tile   { background: hsl(var(--stat) / .12); color: hsl(var(--stat)); }
.card-accent::before { opacity: .9; }

/* Respect a reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .hover\:shadow-md:hover, .hover\:shadow-lg:hover,
  .hover\:shadow-xl:hover, .hover\:shadow-2xl:hover { transform: none; }
}


/* ------------------------------------------------- collapsible sidebar */

[data-sidebar] {
  transition: width .2s cubic-bezier(.2, .7, .3, 1);
  overflow: hidden;
}

.sidebar-collapsed [data-sidebar] { width: 4.25rem; }

/* In the rail, labels and section headings fold away; icons stay put. */
.sidebar-collapsed [data-sidebar] .sidebar-link span:not(.sidebar-badge),
.sidebar-collapsed [data-sidebar] .sidebar-title,
.sidebar-collapsed [data-sidebar] .sidebar-sub,
.sidebar-collapsed [data-sidebar] .sidebar-group,
.sidebar-collapsed [data-sidebar] .sidebar-cta,
.sidebar-collapsed [data-sidebar] .sidebar-user > div:last-child {
  display: none;
}

.sidebar-collapsed [data-sidebar] .sidebar-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed [data-sidebar] .sidebar-head,
.sidebar-collapsed [data-sidebar] .sidebar-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.sidebar-collapsed [data-sidebar] .sidebar-head a { justify-content: center; }

.sidebar-collapsed [data-sidebar] .sidebar-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
}
.sidebar-collapsed [data-sidebar] .sidebar-link { position: relative; }

/* The label returns as a tooltip, so nothing is guessed from an icon alone. */
.sidebar-collapsed [data-sidebar] .sidebar-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 12px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 60;
}
.sidebar-collapsed [data-sidebar] .sidebar-link:hover::after { opacity: 1; }


/* ----------------------------------------------------------- announcement */

.announce-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: hsl(316 45% 8% / .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: announce-fade .22s ease-out;
}
.announce-backdrop[hidden] { display: none; }

.announce-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: hsl(var(--card));
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px hsl(316 40% 10% / .45);
  animation: announce-rise .26s cubic-bezier(.2, .7, .3, 1);
}

.announce-image { width: 100%; height: 170px; object-fit: cover; display: block; }
.announce-body  { padding: 26px 26px 24px; }

.announce-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--card) / .85);
  color: hsl(var(--muted-foreground));
  backdrop-filter: blur(6px);
}
.announce-x:hover { color: hsl(var(--foreground)); }

.announce-banner {
  position: relative;
  z-index: 40;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.announce-banner[hidden] { display: none; }
.announce-banner-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@keyframes announce-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes announce-rise {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}


/* --------------------------------------------------------------- charts */

.chart { width: 100%; }

.chart-plot {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 150px;
  padding-top: 18px;
  border-bottom: 1px solid hsl(var(--border) / .6);
}

/* A column never grows past a sensible width, so two months of data look like
   two months rather than two slabs. */
.chart-col {
  flex: 1 1 0;
  max-width: 68px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.chart-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, hsl(var(--primary) / .92), hsl(var(--primary) / .55));
  border-radius: 8px 8px 3px 3px;
  transition: opacity .15s;
  min-height: 4px;
}
.chart-bar:hover { opacity: .82; }

.chart-value {
  position: absolute;
  top: -4px;
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.chart-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  position: absolute;
  bottom: -22px;
}

/* Room for the labels sitting under the baseline. */
.chart { padding-bottom: 24px; }

/* --------------------------------------------------- sidebar breathing room */

.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--sidebar-border)) transparent;
  /* A soft fade at the bottom hints there is more below. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent 100%);
}

.sidebar-foot { padding-top: 6px; padding-bottom: 6px; }
.sidebar-foot .sidebar-link { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }


/* ------------------------------------------------------ neutral corrections */

/* Muted greys were tinted toward magenta; make them true neutrals so the
   brand colour only appears where it is meant to. */
.bg-muted        { background-color: hsl(0 0% 95%); }
.bg-muted\/50    { background-color: hsl(0 0% 96%); }
.bg-muted\/40    { background-color: hsl(0 0% 97%); }
.bg-muted\/30    { background-color: hsl(0 0% 98%); }
.bg-muted\/20    { background-color: hsl(0 0% 98.5%); }

.border-border      { border-color: hsl(0 0% 89%); }
.border-border\/60  { border-color: hsl(0 0% 91%); }

/* Bars stay magenta — a single accent reads as deliberate. */
.chart-bar {
  background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--primary) / .68));
}

/* The avatar gradients were three different colours; one neutral treatment. */
.bg-gradient-to-br.from-primary\/40 { background-image: none; background-color: hsl(var(--primary) / .12); }


/* ------------------------------------------------------------ account menu */

.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background-color .14s, border-color .14s;
}
.user-menu-trigger:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: hsl(var(--primary) / .12);
  color: hsl(var(--primary));
}
.user-avatar.is-admin {
  background: hsl(var(--foreground) / .08);
  color: hsl(var(--foreground));
}

.user-menu-text {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
@media (min-width: 1280px) { .user-menu-text { display: flex; } }

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-role {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 228px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  box-shadow: 0 4px 8px hsl(0 0% 0% / .05), 0 18px 40px -16px hsl(0 0% 0% / .22);
  padding: 6px;
  z-index: 70;
  animation: menu-rise .14s ease-out;
}
.user-menu-panel[hidden] { display: none; }

.user-menu-head {
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid hsl(var(--border));
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
}
.user-menu-item:hover { background: hsl(var(--muted)); }
.user-menu-item.is-quiet {
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
  border-top: 1px solid hsl(var(--border));
  border-radius: 0 0 9px 9px;
  padding-top: 11px;
}
.user-menu-item.is-quiet:hover { color: hsl(var(--destructive)); }

@keyframes menu-rise {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}


/* -------------------------------------------------------------- celebration */

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: hsl(0 0% 6% / .55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: announce-fade .22s ease-out;
}
.celebrate[hidden] { display: none; }

.celebrate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  background: hsl(var(--card));
  border-radius: 22px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px -18px hsl(0 0% 0% / .5);
  animation: celebrate-pop .42s cubic-bezier(.18, .9, .3, 1.1);
}

.celebrate-medal {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / .12);
  animation: medal-in .5s cubic-bezier(.2, .8, .25, 1.2) .1s both;
}

.celebrate-detail {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / .1);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Confetti in the four brand colours, falling behind the card. */
.celebrate-confetti { position: absolute; inset: 0; overflow: hidden; z-index: 1; }

.confetti-piece {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}
.confetti-piece.c0 { background: hsl(316 76% 45%); }
.confetti-piece.c1 { background: hsl(198 100% 43%); }
.confetti-piece.c2 { background: hsl(76 54% 54%); }
.confetti-piece.c3 { background: hsl(45 85% 57%); }

@keyframes confetti-fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: 0; transform: translateY(105vh) rotate(680deg); }
}

@keyframes celebrate-pop {
  0%   { opacity: 0; transform: scale(.9) translateY(14px); }
  100% { opacity: 1; transform: none; }
}
@keyframes medal-in {
  0%   { transform: scale(.4) rotate(-18deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece { display: none; }
  .celebrate-card, .celebrate-medal { animation: none; }
}
