/* uStock design system - "frosted glass" refresh.
   Deep azure-to-teal palette, translucent blurred surfaces, soft big radii.
   Gotham is a commercial, non-redistributable typeface, so this self-hosts
   Montserrat instead - the standard free-license geometric-sans substitute
   for it (same proportions, same "single typeface across every weight" feel).
   Variable font, so one file covers every weight. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #2451e0;
  --blue-dark: #17399f;
  --blue-light: #7ea0f8;
  --blue-wash: rgba(36, 81, 224, 0.1);
  --teal: #0f8f82;
  --teal-dark: #0b6e64;
  --teal-light: #4fd8c4;
  --teal-wash: rgba(15, 143, 130, 0.1);
  --ink: #0c1526;
  --black: #060b16;
  --body: #46536b;
  --muted: #75859f;
  --line: rgba(18, 35, 66, 0.09);
  --line-strong: rgba(18, 35, 66, 0.18);
  --white: #ffffff;
  --page: #eef3fb;

  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-blur: blur(20px) saturate(160%);

  --green: #0f9d6e;
  --green-wash: rgba(15, 157, 110, 0.12);
  --amber: #b5790a;
  --amber-wash: rgba(181, 121, 10, 0.12);
  --red: #d5433c;
  --red-wash: rgba(213, 67, 60, 0.1);

  --radius: 10px;
  --radius-card: 20px;
  --shadow: 0 10px 34px rgba(16, 38, 77, 0.1), 0 2px 8px rgba(16, 38, 77, 0.06);

  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, "Helvetica Neue", Arial, sans-serif;
  --display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;

  --wrap: 1120px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
  background: var(--page);
  position: relative;
  min-height: 100vh;
}

/* Soft, static colour wash behind every screen - the calmer sibling of the
   animated one on the auth pages. Fixed + negative z-index so it never
   interferes with layout or scrolling. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px circle at 8% -5%, rgba(36, 81, 224, 0.14), transparent 60%),
    radial-gradient(640px circle at 96% 8%, rgba(15, 143, 130, 0.12), transparent 55%),
    radial-gradient(900px circle at 50% 115%, rgba(36, 81, 224, 0.08), transparent 60%),
    linear-gradient(180deg, #eef3fb 0%, #f5f8fd 45%, #eef8f6 100%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 30px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 19px;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.masthead {
  background: linear-gradient(-45deg, #0a1a33, #123a6a, #0d5c66, #12b4a6, #123a6a);
  background-size: 400% 400%;
  animation: authGradient 18s ease infinite;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 26px rgba(8, 16, 32, 0.18);
  position: sticky;
  top: 0;
  z-index: 30;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
}

.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  color: var(--white);
  letter-spacing: 0.01em;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}
.brand span {
  background: linear-gradient(120deg, var(--blue-light), var(--teal-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.masthead__spacer {
  flex: 1;
}

.masthead__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #b7c3d9;
}
.masthead__user strong {
  color: var(--white);
  font-weight: 600;
}

.mainnav {
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.mainnav__inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}
.mainnav__inner::-webkit-scrollbar {
  display: none;
}

.mainnav a {
  padding: 9px 16px;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 999px;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover {
  color: var(--ink);
  background: rgba(18, 35, 66, 0.05);
  text-decoration: none;
}
.mainnav a.is-active {
  color: var(--blue-dark);
  background: linear-gradient(120deg, var(--blue-wash), var(--teal-wash));
  border-bottom-color: transparent;
}

main {
  padding: 28px 0 64px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head__text {
  flex: 1;
  min-width: 240px;
}
.page-head p {
  margin: 4px 0 0;
  font-size: 14px;
}
.page-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Cards ---------- */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.card + .card {
  margin-top: 16px;
}

.card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card__head h2,
.card__head h3 {
  margin: 0;
  flex: 1;
}

.card__body {
  padding: 20px;
}

.card__body--flush {
  padding: 0;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* ---------- Stat tiles ---------- */

.stat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.stat__label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.stat__value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  margin-top: 6px;
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__hint {
  font-size: 13px;
  margin-top: 2px;
}
.stat--alert .stat__value {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--red);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 16px rgba(36, 81, 224, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    opacity 0.15s ease;
}
.btn:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--teal-dark));
  box-shadow: 0 10px 22px rgba(36, 81, 224, 0.32);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--white);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--dark {
  background: linear-gradient(135deg, #182640, var(--black));
  box-shadow: 0 6px 16px rgba(6, 11, 22, 0.35);
}
.btn--dark:hover {
  background: linear-gradient(135deg, #223252, #0d1526);
  box-shadow: 0 10px 22px rgba(6, 11, 22, 0.4);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--body);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.btn--danger {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--red);
  border-color: rgba(213, 67, 60, 0.35);
  box-shadow: none;
}
.btn--danger:hover {
  background: var(--red-wash);
  color: var(--red);
  box-shadow: none;
  transform: none;
}

.btn--sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn--lg {
  padding: 17px 30px;
  font-size: 17px;
}

.btn--block {
  width: 100%;
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 15px;
}
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.field__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-wash);
  background: rgba(255, 255, 255, 0.95);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.field-row > .field {
  flex: 1;
  min-width: 150px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: 0 0 16px;
}
legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 6px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  padding: 5px 0;
}
.check input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex: none;
}

/* ---------- Tables ---------- */

.table-scroll {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data tbody tr:hover {
  background: rgba(36, 81, 224, 0.04);
}
table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  background: var(--line);
  color: var(--body);
  white-space: nowrap;
}
.badge--blue {
  background: var(--blue-wash);
  color: var(--blue);
}
.badge--green {
  background: var(--green-wash);
  color: var(--green);
}
.badge--amber {
  background: var(--amber-wash);
  color: var(--amber);
}
.badge--red {
  background: var(--red-wash);
  color: var(--red);
}

/* ---------- Notices ---------- */

.notice {
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}
.notice--info {
  background: var(--blue-wash);
  border-color: rgba(36, 81, 224, 0.2);
  border-left-color: var(--blue);
  color: var(--blue-dark);
}
.notice--success {
  background: var(--green-wash);
  border-color: rgba(15, 157, 110, 0.25);
  border-left-color: var(--green);
  color: var(--green);
}
.notice--warn {
  background: var(--amber-wash);
  border-color: rgba(181, 121, 10, 0.25);
  border-left-color: var(--amber);
  color: var(--amber);
}
.notice--error {
  background: var(--red-wash);
  border-color: rgba(213, 67, 60, 0.25);
  border-left-color: var(--red);
  color: var(--red);
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty h3 {
  color: var(--body);
}

/* ---------- Section header inside lists ---------- */

.section-head {
  background: rgba(36, 81, 224, 0.05);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

/* ---------- Check-off list (the volunteer's main screen) ---------- */

.tick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}
.tick:last-child {
  border-bottom: none;
}

.tick__box {
  flex: none;
}
.tick__box input {
  width: 26px;
  height: 26px;
  accent-color: var(--green);
  cursor: pointer;
}

.tick__main {
  flex: 1;
  min-width: 0;
}
.tick__name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.tick__meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.tick__note {
  font-size: 13px;
  color: var(--amber);
  margin-top: 3px;
}

.tick__qty {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 15px;
  min-width: 58px;
  text-align: right;
}

.tick__actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.tick.is-done {
  background: var(--green-wash);
}
.tick.is-done .tick__name {
  color: var(--green);
}
.tick.is-missing {
  background: var(--red-wash);
}
.tick.is-notneeded {
  opacity: 0.5;
}

.tick--busy {
  opacity: 0.45;
  transition: opacity 0.1s;
}

/* ---------- Progress ---------- */

.progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ---------- Misc ---------- */

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.stack > * + * {
  margin-top: 14px;
}
.inline-form {
  display: inline;
}
.hidden {
  display: none;
}

.htmx-request .tick,
.htmx-request.tick {
  opacity: 0.45;
}

/* ---------- Auth screen ---------- */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(-45deg, #0a1a33, #123a6a, #0d5c66, #12b4a6, #123a6a);
  background-size: 400% 400%;
  animation: authGradient 18s ease infinite;
}

/* Shared with .masthead - same moving blue/teal wash, top bar and sign-in
   screen breathe together. */
@keyframes authGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.auth::before,
.auth::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
  animation: authFloat 14s ease-in-out infinite;
}
.auth::before {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(79, 216, 196, 0.6), transparent 70%);
  top: -140px;
  left: -120px;
}
.auth::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(126, 160, 248, 0.55), transparent 70%);
  bottom: -150px;
  right: -100px;
  animation-delay: 4s;
}

@keyframes authFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -24px) scale(1.08);
  }
}

.auth__card {
  width: 100%;
  max-width: 396px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 36px 34px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 24px 70px rgba(4, 12, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
}
.auth__brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  color: var(--ink);
  text-align: center;
  margin-bottom: 4px;
}
.auth__brand span {
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth__tag {
  text-align: center;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------- Print: the cargo list on paper ---------- */

@media print {
  .masthead,
  .mainnav,
  .page-head__actions,
  .no-print {
    display: none !important;
  }
  body {
    background: var(--white);
    font-size: 12px;
    color: #000;
  }
  body::before {
    display: none;
  }
  main {
    padding: 0;
  }
  .card {
    border: none;
    box-shadow: none;
    background: none;
    backdrop-filter: none;
  }
  .card + .card {
    margin-top: 10px;
  }
  .tick {
    padding: 5px 0;
    background: none;
    break-inside: avoid;
  }
  .tick__box input {
    width: 13px;
    height: 13px;
  }
  .section-head {
    background: none;
    border-bottom: 1.5px solid #000;
    color: #000;
  }
  a {
    color: #000;
  }
  .print-only {
    display: block !important;
  }
}

.print-only {
  display: none;
}

@media (max-width: 620px) {
  .page-head {
    margin-bottom: 16px;
  }
  h1 {
    font-size: 25px;
  }
  .card__body {
    padding: 14px;
  }
  .tick {
    padding: 13px 12px;
    gap: 11px;
  }
  main {
    padding: 18px 0 56px;
  }
}
