/* ==========================================================================
   Preheat: reusable pieces, in the vocabulary the demo uses
   Palette and component shapes come from the product demo at
   marketing/landing/public/demo.html. If a screen here and that demo
   disagree, the demo wins.
   ========================================================================== */

/* ---------- Type ---------- */

.serif {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0;
}

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
}
.title--lg {
  font-size: 28px;
}
.title--sm {
  font-size: 20px;
}

/* The screen title in the baker app is the one place that stays sans and
   heavy, matching the demo's "Orders" and "June" headers. */
.screen-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

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

.strong {
  font-weight: 700;
}

.money {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.text-sage {
  color: var(--sage);
}
.text-raspberry {
  color: var(--raspberry);
}
.text-muted {
  color: var(--muted);
}

/* ---------- Cards and rows ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card--pad {
  padding: 14px 16px;
}

.card--tap {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card--tap:hover {
  border-color: var(--line-strong);
  color: inherit;
  transform: translateY(-1px);
}

/* A bordered list where each row is a label and a value: the order detail
   sheet, the quote breakdown, the receipt. */
.rows {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.rows__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.rows__row:last-child {
  border-bottom: 0;
}

.rows__key {
  color: var(--muted);
  flex-shrink: 0;
}

.rows__value {
  font-weight: 700;
  text-align: right;
}

.rows__row--total {
  background: var(--cream-warm);
  font-size: 15px;
  font-weight: 800;
  border-bottom: 0;
}

/* The confirmation screen centres its contents, so the summary has to opt back
   out of that for its own rows to read as a list. */
.rows--confirmation {
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
  text-align: left;
}
.rows__row--total .rows__key {
  color: var(--ink);
  font-weight: 800;
}

.note {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 12px 15px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.note--sage {
  background: var(--sage-tint);
  border-color: var(--sage-line);
  color: var(--sage-text);
}
.note--raspberry {
  background: var(--raspberry-tint);
  border-color: var(--raspberry-line);
  color: var(--raspberry-deep);
}
.note--amber {
  background: var(--amber-tint);
  border-color: var(--amber-line);
  color: var(--amber-text);
}
.note--ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.empty {
  margin: auto;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
  max-width: 300px;
  line-height: 1.5;
}

/* ---------- Badges and pills ---------- */

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: var(--pill);
  padding: 3px 9px;
  white-space: nowrap;
  background: var(--cream-deep);
  color: var(--muted);
}
.badge--new {
  background: var(--sage-tint);
  color: var(--sage-deep);
}
.badge--waiting {
  background: var(--amber-tint);
  color: var(--amber-text);
}
.badge--paid {
  background: var(--sage-deep);
  color: var(--on-accent);
}
.badge--done {
  background: var(--cream-deep);
  color: var(--muted);
}
.badge--cancelled {
  background: var(--raspberry-tint);
  color: var(--raspberry-deep);
}

/* Stage tabs on the board and chapter-style nav elsewhere. */
.pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pill:hover {
  color: var(--ink);
}
.pill[aria-current='true'],
.pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.pill__count {
  opacity: 0.65;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

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

.btn--primary {
  background: var(--raspberry);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--raspberry-deep);
  color: var(--on-accent);
}

.btn--ink {
  background: var(--ink);
  color: var(--cream);
}
.btn--ink:hover {
  background: var(--ink-pressed);
  color: var(--cream);
}

.btn--sage {
  background: var(--sage);
  color: var(--on-accent);
}
.btn--sage:hover {
  background: var(--sage-deep);
  color: var(--on-accent);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--outline:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn--quiet {
  background: transparent;
  color: var(--raspberry);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 4px;
}

.btn--sm {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: var(--pill);
}

.btn[disabled],
.btn--disabled {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  cursor: default;
  border-color: transparent;
}
.btn[disabled]:hover,
.btn--disabled:hover {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
}

.back-link {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--raspberry);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field__label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__label .optional {
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.field__help {
  font-size: 12.5px;
  color: var(--muted-2);
}

.input,
.textarea,
.select {
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-chip);
  padding: 12px 14px;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--raspberry);
  outline: none;
  box-shadow: 0 0 0 3px var(--raspberry-tint);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

/* Choice chips. The radio itself is hidden; the label is the control, which
   is what makes the demo's option rows feel like buttons rather than a form. */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chips--even .chip {
  flex: 1;
}

.chip {
  position: relative;
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--faint);
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip__note {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.chip:has(input:checked) {
  border: 2px solid var(--raspberry);
  background: var(--raspberry-tint);
  padding: 10px 13px;
}
.chip:has(input:focus-visible) {
  outline: 3px solid var(--raspberry);
  outline-offset: 2px;
}

/* Toggle row: a full-width label with a switch on the right. */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-chip);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle__track {
  width: 44px;
  height: 26px;
  border-radius: var(--pill);
  background: var(--switch-off);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle__knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--on-accent);
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.toggle:has(input:checked) .toggle__track {
  background: var(--sage);
}
.toggle:has(input:checked) .toggle__knob {
  transform: translateX(18px);
}

.file-drop {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-chip);
  background: var(--cream-warm);
  padding: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  width: 100%;
}
.file-drop:hover {
  border-color: var(--faint);
}

.errors {
  background: var(--raspberry-tint);
  border: 1px solid var(--raspberry-line);
  border-radius: var(--radius-panel);
  padding: 12px 15px;
  color: var(--raspberry-deep);
  font-size: 13.5px;
}
.errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.flash {
  border-radius: var(--radius-panel);
  padding: 11px 15px;
  font-size: 13.5px;
  font-weight: 600;
}
.flash--notice {
  background: var(--sage-tint);
  border: 1px solid var(--sage-line);
  color: var(--sage-text);
}
.flash--alert {
  background: var(--raspberry-tint);
  border: 1px solid var(--raspberry-line);
  color: var(--raspberry-deep);
}

/* ---------- Calendar ---------- */

.cal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal__weekdays,
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal__weekdays {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  color: var(--faint);
}

/* One cell shape, four states. Closed days stay visible but inert so the
   customer can see the shape of the baker's week, not just its holes. */
.cal__day {
  min-height: 44px;
  border-radius: 10px;
  padding: 7px 0 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--faintest);
  cursor: default;
  font-variant-numeric: tabular-nums;
}

.cal__day--blank {
  visibility: hidden;
}

.cal__sub {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  margin-top: 1px;
  opacity: 0.85;
}

.cal__day--open {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  cursor: pointer;
}
.cal__day--open:hover {
  border-color: var(--raspberry);
}

.cal__day--full {
  background: var(--cream-deep);
  color: var(--struck);
  text-decoration: line-through;
  cursor: not-allowed;
}

/* The picker's selected state is CSS-only. A customer taps a date and sees it
   fill immediately, on a page that ships no JavaScript to make that happen. */
.cal__day--selected,
.cal__day:has(input:checked) {
  background: var(--raspberry);
  border-color: var(--raspberry);
  color: var(--on-accent);
}
.cal__day--selected:hover,
.cal__day:has(input:checked):hover {
  border-color: var(--on-accent);
}
.cal__day:has(input:focus-visible) {
  outline: 3px solid var(--raspberry);
  outline-offset: 2px;
}

.cal__sub--picked {
  display: none;
}
.cal__day:has(input:checked) .cal__sub--idle {
  display: none;
}
.cal__day:has(input:checked) .cal__sub--picked {
  display: block;
}

/* The baker's calendar reads the same grid as counts rather than choices. */
.cal__day--has-room {
  background: var(--sage-tint);
  border-color: var(--sage-line);
  color: var(--sage-deep);
}
.cal__day--booked-out {
  background: var(--raspberry-tint);
  border-color: var(--raspberry-line);
  color: var(--raspberry-deep);
}

.cal__legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}
.cal__swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}
.cal__swatch--room {
  background: var(--sage);
}
.cal__swatch--full {
  background: var(--raspberry);
}
.cal__swatch--closed {
  background: var(--closed-swatch);
}

/* ---------- Motion ---------- */

@keyframes ph-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ph-pop {
  0% {
    transform: scale(0.94);
    opacity: 0;
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes ph-shake {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.fade-up {
  animation: ph-fade-up 0.3s ease both;
}
.pop {
  animation: ph-pop 0.35s ease both;
}
.shake {
  animation: ph-shake 0.45s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
