@font-face {
  font-family: NeutralStd;
  src: url(/static/fonts/neutral-std-regular.woff2);
}

:root {
  color-scheme: light dark;
  --fg: #000;
  --bg: #fff;
  --muted: #beb5b5;
  --accent: #111;

  --container-padding: 20px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: NeutralStd, system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
}

.container {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--container-padding);
}

.muted {
  font-size: 12px;
  color: var(--muted);
}

/* TYPOGRAPHY */
h1 {
  /* 8cqw = 2.4rem exactly at the container's own 480px max-width, so this
     matches the original fixed size there and shrinks below it. */
  font-size: clamp(1.75rem, 8cqw, 2.4rem);
}

p {
  line-height: 1.4;
}

a,
a:hover,
a:visited {
  color: var(--fg);
}
a:hover {
  text-decoration: none;
}

/* Home view */
.top-banner {
  width: calc(100% + calc(var(--container-padding) * 2));
  margin-top: calc(-1 * var(--container-padding));
  margin-left: calc(-1 * var(--container-padding));
}

.home-content-grid {
  display: grid;
  grid-template-rows: auto 1fr auto;
  flex: 1;
}

a.order-link {
  display: block;
  padding: 12px 20px;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  text-align: center;

  &:hover {
    background: #414141;
  }
}

/* Order view */
.order-top {
  margin-bottom: 20px;
}

.logo {
  width: 160px;
  display: inline-block;
}

.order-text {
  margin-bottom: 30px;
}

fieldset {
  border: 1px solid #ddd;
  padding: 16px;
  margin: 32px 0;
}

legend {
  font-weight: 600;
  font-size: 20px;
  padding: 0 4px;
  margin-left: -4px;
  color: #000000;
}

form label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
}

label[for="posterDate"] {
  margin-bottom: 12px;
}

form input[type="date"],
form input[type="text"],
form input[type="email"],
form select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 16px;
  background: var(--bg);
  color: var(--fg);
}

/* The calendar is shown inline (see order.js) and is the actual UI — the
   input itself just holds the form value, so it stays out of sight. */
#posterDate {
  display: none;
}

/* flatpickr's CSS is loaded after app.css (its <link> sits further down the
   page, next to the form it belongs to), so ties on selectors of equal
   specificity go to flatpickr's own rules by default — hence !important
   throughout this block, rather than relying on load order. */

.flatpickr-calendar.inline {
  width: 100% !important;
  margin-top: 8px;
  box-shadow: none;
  border: 1px solid #ccc;
  border-radius: 0 !important;
}

/* The day grid (and the calendar/container widths flatpickr computes from
   it) are hardcoded to a fixed pixel width by default — stretch it to fill
   the container like every other input on this form. */
.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days,
.dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

/* Square corners (matching the rest of the site) and bigger tap targets. */
.flatpickr-day {
  max-width: none !important;
  border-radius: 0 !important;
  height: 46px !important;
  line-height: 46px !important;
}

/* Taller header row, with the month/year controls centered and given room
   to breathe instead of being crammed against each other. */
.flatpickr-months,
.flatpickr-month,
.flatpickr-current-month,
.flatpickr-next-month,
.flatpickr-prev-month {
  height: 50px !important;
}

.flatpickr-current-month {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 !important;
}

/* Bigger, easier-to-tap prev/next month buttons. Needs border-box, since
   the fixed height above would otherwise overflow the clipped parent once
   padding grows. */
.flatpickr-next-month,
.flatpickr-prev-month {
  box-sizing: border-box !important;
  padding: 15px !important;
}

.flatpickr-next-month svg,
.flatpickr-prev-month svg {
  width: 20px !important;
  height: 20px !important;
}

/* Match flatpickr's accent color to the site's monochrome palette instead
   of its default blue. */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--fg) !important;
  border-color: var(--fg) !important;
}

/* No special treatment for today's date — it should look like any other
   day, not just the selected one (the :not(.selected) guard keeps this from
   fighting the selected-day styling above if today is the chosen date). */
.flatpickr-day.today:not(.selected) {
  border-color: transparent !important;
}

.flatpickr-day.today:not(.selected):hover,
.flatpickr-day.today:not(.selected):focus {
  background: #e6e6e6 !important;
  border-color: #e6e6e6 !important;
  color: inherit !important;
}

form select {
  appearance: none;
  border-radius: 0;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg) 50%),
    linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position:
    right 12px top 1.1em,
    right 8px top 1.1em;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.form-section + .form-section {
  margin-top: 24px;
  padding-top: 20px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field {
  flex: 1;
  min-width: 0;
}

.tag-group + .tag-group {
  margin-top: 16px;
}

.tag-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}

label.checkbox {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 6px;
  margin: 4px 12px 4px 0;
  padding: 6px 12px 5px 6px;
  font-weight: normal;
  border: 1px solid var(--muted);
}

label.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--muted);
  background-color: color-mix(in srgb, var(--muted) 25%, var(--bg));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

label.checkbox input:checked {
  background-color: var(--fg);
  border-color: var(--fg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

label.checkbox:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}

label.checkbox input:disabled {
  cursor: not-allowed;
}

.error {
  color: #b00020;
  font-size: 13px;
  margin: 4px 0 0;
}

.order-button {
  display: block;
  padding: 12px 20px;
  margin-top: 30px;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  text-align: center;
  border: none;
  width: 100%;
  font-size: 16px;

  &:hover {
    background: #414141;
  }
}
