:root {
  --bg: #17120f;
  --surface: transparent;
  --surface-strong: transparent;
  --surface-soft: rgba(255, 255, 255, 0.16);
  --ink: #171717;
  --muted: #655d55;
  --line: rgba(255, 255, 255, 0.34);
  --blue: #1f6bd7;
  --blue-dark: #123f8b;
  --green: #13936f;
  --red: #c03a3a;
  --amber: #f0b45b;
  --shadow: 0 24px 70px rgba(8, 7, 6, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.32), rgba(8, 7, 6, 0.08) 46%, rgba(8, 7, 6, 0.46)),
    linear-gradient(180deg, rgba(8, 7, 6, 0.1), rgba(8, 7, 6, 0.48)),
    url("assets/anders2.1.JPG") center top / cover fixed,
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 14px 54px;
}

.hero {
  display: grid;
  gap: 18px;
}

.hero-copy {
  max-width: 620px;
  padding: 18px 4px 4px;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 10vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.hero-copy p,
.thank-you p,
.admin-help,
.form-note {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.55;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.48);
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.88);
}

.admin-card .admin-help,
.admin-card .form-note {
  color: var(--muted);
  text-shadow: none;
}

.admin-card .eyebrow {
  color: var(--blue-dark);
}

.admin-card .name-field {
  color: var(--ink);
  text-shadow: none;
}

.admin-card .secondary-button {
  border-color: rgba(22, 22, 22, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.admin-card .secondary-button.danger {
  color: var(--red);
}

.vote-card,
.thank-you,
.admin-card {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(8, 7, 6, 0.14);
  backdrop-filter: none;
}

.vote-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.name-field {
  display: grid;
  gap: 7px;
  font-weight: 750;
  color: white;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.name-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  padding: 0 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -18px 36px rgba(255, 255, 255, 0.16),
    0 8px 24px rgba(0, 0, 0, 0.08);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.name-field input::placeholder {
  color: rgba(28, 28, 28, 0.78);
  opacity: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 10px rgba(255, 255, 255, 0.46);
}

.name-field input:focus,
.day-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.admin-tab:focus-visible {
  outline: 3px solid rgba(34, 104, 216, 0.24);
  outline-offset: 2px;
}

.name-field input.has-error {
  border-color: var(--red);
}

.field-error {
  display: none;
  color: #ffd6d6;
  font-size: 0.82rem;
  font-weight: 750;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.52);
}

.field-error.is-visible {
  display: block;
}

.calendar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.selection-summary {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: transparent;
  color: white;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.42);
}

.selection-summary strong {
  color: white;
}

.calendar-legend {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
  font-weight: 750;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.46);
}

.cannot-attend-option {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.cannot-attend-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.legend-swatch {
  width: 22px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 5px;
}

.unavailable-swatch,
.day-button.is-unavailable {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(55, 55, 55, 0.62) 0,
      rgba(55, 55, 55, 0.62) 6px,
      rgba(190, 190, 190, 0.46) 6px,
      rgba(190, 190, 190, 0.46) 12px
    ),
    rgba(120, 120, 120, 0.48);
}

.months {
  display: grid;
  gap: 14px;
}

.month-card {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: none;
  color: white;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.52);
}

.month-card header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.month-card h2 {
  margin: 0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.58);
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekdays {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.58);
}

.day-button,
.day-spacer {
  aspect-ratio: 1;
}

.day-button {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--ink);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.82);
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.day-button:hover {
  border-color: rgba(34, 104, 216, 0.44);
}

.day-button.is-selected {
  border-color: var(--blue-dark);
  background: var(--blue);
  color: white;
  transform: translateY(-1px);
}

.day-button.is-unavailable {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.22);
  cursor: not-allowed;
  opacity: 0.78;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.day-button.is-disabled-by-choice {
  opacity: 0.42;
  cursor: not-allowed;
}

.day-button.is-unavailable.is-selected {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(55, 55, 55, 0.62) 0,
      rgba(55, 55, 55, 0.62) 6px,
      rgba(190, 190, 190, 0.46) 6px,
      rgba(190, 190, 190, 0.46) 12px
    ),
    rgba(120, 120, 120, 0.48);
}

.needs-selection .month-card {
  animation: pulse-warning 700ms ease;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  font-weight: 850;
}

.primary-button {
  background: var(--blue);
  color: white;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: white;
}

.secondary-button.danger {
  color: var(--red);
}

.form-note {
  margin: -6px 0 0;
  font-size: 0.9rem;
}

.thank-you {
  display: grid;
  min-height: 70vh;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: white;
}

.thank-you h2 {
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.page-footer {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 14px 18px;
  text-align: right;
}

.admin-tab {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.56);
}

.admin-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(8, 7, 6, 0.46);
  padding: 12px;
}

.admin-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: 0 auto;
  padding: 18px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-shadow: none;
  backdrop-filter: blur(16px) saturate(1.12);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(22, 22, 22, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 900;
}

.admin-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-right: 42px;
}

.admin-heading span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(22, 22, 22, 0.08);
  background: rgba(245, 238, 228, 0.82);
  color: var(--blue-dark);
  font-weight: 850;
}

.chart {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 42px 0 2px;
}

.empty-chart {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(22, 22, 22, 0.16);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--muted);
  text-align: center;
  text-shadow: none;
}

.chart-row {
  display: grid;
  grid-template-columns: 76px 1fr 24px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.chart-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: capitalize;
}

.bar-track {
  position: relative;
  display: block;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(238, 243, 248, 0.9);
  padding: 0;
  text-align: left;
}

.bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.voter-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: max-content;
  max-width: min(280px, 72vw);
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  white-space: normal;
}

.voter-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  transform: translateX(-50%);
}

.bar-track:hover,
.bar-track:focus,
.bar-track:focus-visible {
  overflow: visible;
}

.bar-track:hover .voter-tooltip,
.bar-track:focus .voter-tooltip,
.bar-track:focus-visible .voter-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chart-row strong {
  font-size: 0.85rem;
  text-align: right;
}

.unavailable-admin {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(22, 22, 22, 0.1);
}

.unavailable-admin h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.unavailable-admin p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.admin-months {
  grid-template-columns: 1fr;
}

.admin-month-card {
  border-color: rgba(22, 22, 22, 0.1);
  background: rgba(248, 250, 252, 0.86);
  color: var(--ink);
  text-shadow: none;
}

.admin-month-card h2,
.admin-month-card .weekdays {
  color: var(--ink);
  text-shadow: none;
}

.admin-month-card .day-button {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-shadow: none;
}

.admin-month-card .day-button.is-unavailable {
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  opacity: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.66);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.is-hidden {
  display: none;
}

@keyframes pulse-warning {
  0%,
  100% {
    border-color: var(--line);
  }

  35% {
    border-color: rgba(192, 58, 58, 0.75);
    box-shadow: 0 0 0 3px rgba(192, 58, 58, 0.12);
  }
}

@media (min-width: 760px) {
  .page-shell {
    padding: 48px 28px 70px;
  }

  .page-footer {
    padding: 0 28px 22px;
  }

  .hero {
    grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
    align-items: start;
    gap: 30px;
  }

  .hero-copy {
    position: sticky;
    top: 38px;
    padding-top: 26px;
  }

  .vote-card {
    padding: 22px;
  }

  .admin-panel {
    align-items: center;
  }
}

@media (max-width: 370px) {
  .vote-card {
    padding: 12px;
  }

  .month-card {
    padding: 10px;
  }

  .weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .day-button {
    border-radius: 8px;
    font-size: 0.9rem;
  }
}
