/* THE BAKERY BANÚS — shared design system (web cashier, customer display, Android, iPhone).
   Fonts are served locally from node_modules/@fontsource. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant/cormorant-garamond-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant/cormorant-garamond-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant/cormorant-garamond-latin-500-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jost/jost-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jost/jost-latin-500-normal.woff2') format('woff2');
}

/* Bakery Light (default) */
:root {
  --ivory: #f6efe5; /* Bakery Cream — page */
  --paper: #fffcf7; /* Warm Surface — cards */
  --cream: #efe4d5; /* pressed / subtle fill */
  --espresso: #2b1d16; /* text, primary buttons */
  --espresso-2: #5b4637; /* secondary text */
  --muted: #9e8d7d; /* Muted Taupe */
  --line: #e3d5c4; /* Soft Border */
  --gold: #b58a5b; /* Warm Accent */
  --gold-soft: #f1e4d2;
  --sage: #5f7f58; /* Success */
  --sage-soft: #e4ebdd;
  --danger: #a14f46; /* Error */
  --danger-soft: #f5e1dd;
  --night: #12100e; /* scanner / dark premium background */
  --qr-bg: #ffffff;

  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', 'Futura', 'Century Gothic', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(43, 29, 22, 0.05), 0 12px 32px -18px rgba(43, 29, 22, 0.22);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 150ms;
  --med: 220ms;
  color-scheme: light;
}

/* Midnight (staff screens only; customer-facing screens stay Bakery Light) */
:root[data-theme='midnight'] {
  --ivory: #12100e;
  --paper: #1b1714;
  --cream: #26201b;
  --espresso: #f3e9dc;
  --espresso-2: #cdbfae;
  --muted: #9a8b7c;
  --line: #312922;
  --gold: #c99d6b;
  --gold-soft: #2c231a;
  --sage: #8dae80;
  --sage-soft: #1d2a19;
  --danger: #d98073;
  --danger-soft: #34201c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--espresso);
}

body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.no-select {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.tabular {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease), opacity var(--fast) var(--ease), transform var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--espresso);
  color: var(--ivory);
}

.btn-primary:disabled {
  opacity: 0.25;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--espresso);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-outline:hover {
  box-shadow: inset 0 0 0 1px var(--muted);
}

.btn-quiet {
  background: transparent;
  color: var(--espresso-2);
  letter-spacing: 0.16em;
  min-height: 48px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.btn-xl {
  min-height: 64px;
  font-size: 15px;
}

.btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn:disabled {
  cursor: default;
}

/* ── Fields ────────────────────────────────────────────────────────────── */

.field {
  display: block;
  text-align: left;
}

.field > span {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--espresso);
  font-size: 17px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-error {
  min-height: 20px;
  font-size: 14px;
  color: var(--danger);
}

/* ── Brand lockup ──────────────────────────────────────────────────────── */

.lockup {
  text-align: center;
}

.lockup-name {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  line-height: 1;
  white-space: nowrap;
}

.lockup-rule {
  width: 44px;
  height: 1px;
  margin: 18px auto 16px;
  background: var(--gold);
}

.lockup-place {
  font-size: 12px;
  letter-spacing: 0.62em;
  margin-right: -0.62em;
  color: var(--espresso-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-sandbox {
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

/* ── Settings rows (shared by cashier and customer display) ───────────────── */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--espresso-2);
  cursor: pointer;
}

.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform var(--med) var(--ease);
}

.switch:checked {
  background: var(--sage);
}

.switch:checked::after {
  transform: translateX(18px);
}

.select-inline {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--espresso);
}

/* ── Drawn checkmark ───────────────────────────────────────────────────── */

.check {
  display: block;
}

.check-disc {
  fill: var(--sage-soft);
  opacity: 0;
  transform-origin: 60px 60px;
}

.check-ring {
  fill: none;
  stroke: var(--sage);
  stroke-width: 2.5;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
}

.check-tick {
  fill: none;
  stroke: var(--sage);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
}

.play .check-disc {
  animation: disc-in 0.4s var(--ease) forwards;
}

.play .check-ring {
  animation: draw 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.play .check-tick {
  animation: draw 0.3s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes disc-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rise {
  opacity: 0;
  transform: translateY(6px);
}

.play .rise {
  animation: rise 0.25s var(--ease) forwards;
}

.play .rise-1 {
  animation-delay: 0.45s;
}

.play .rise-2 {
  animation-delay: 0.55s;
}

.play .rise-3 {
  animation-delay: 0.65s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(43, 29, 22, 0.15);
  border-top-color: var(--espresso);
  animation: spin 0.9s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
