/* ==========================================================================
   Meet Me After Midnight — brand foundation
   Shared by the customer page and the staff dashboard: tokens first, then a
   small set of primitives. Page-specific styles live in app.css / staff.css.
   ========================================================================== */

:root {
  /* palette sampled from the restaurant's posters */
  --mm-red: #f3563a;
  --mm-red-deep: #d4412a;
  --mm-red-soft: #f77b63;
  --mm-blue: #3940aa;
  --mm-blue-deep: #2a3087;
  --mm-blue-soft: #5a61c9;
  --mm-yellow: #facc60;
  --mm-yellow-deep: #e8ae35;
  --mm-cream: #fff5e3;
  --mm-cream-deep: #f1e0c2;
  --mm-ink: #1e2266;
  --mm-white: #fff;

  --font-ar: "Alexandria", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Montserrat", "Alexandria", "Segoe UI", sans-serif;
  --font-logo: "Archivo", "Arial Black", "Montserrat", sans-serif;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 26px;
  --shadow-sticker: 3px 5px 0 rgba(30, 34, 102, 0.24);
  --shadow-card: 0 22px 44px -22px rgba(30, 34, 102, 0.7), 0 2px 0 rgba(0, 0, 0, 0.06);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation; /* two quick taps are two taps, not a zoom (iPhone, iPad); pinching still zooms */
}

body {
  margin: 0;
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="en"] body {
  font-family: var(--font-en);
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--mm-yellow);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Latin text / numbers inside Arabic copy */
.en {
  font-family: var(--font-en);
}

.num {
  font-family: var(--font-logo);
  font-weight: 900;
  font-stretch: 125%;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* --------------------------------------------------------------------------
   Surfaces. Each one sets the colour roles its children read:
   --fg (headline colour), --accent (second language / highlights), --muted.
   Blue-on-red only passes contrast for large display type, so body copy
   belongs on .on-blue or .on-cream surfaces.
   -------------------------------------------------------------------------- */

.on-red {
  --fg: var(--mm-blue);
  --accent: var(--mm-yellow);
  --muted: rgba(255, 255, 255, 0.9);
  color: var(--mm-blue);
}

.on-blue {
  --fg: var(--mm-yellow);
  --accent: var(--mm-red);
  --muted: rgba(255, 255, 255, 0.76);
  color: var(--mm-white);
}

.on-cream {
  --fg: var(--mm-blue);
  --accent: var(--mm-red);
  --muted: rgba(30, 34, 102, 0.66);
  color: var(--mm-ink);
}

/* crumpled poster paper: flat colour × crease relief × fine grain */
.paper {
  --paper-tone: url("../assets/paper-crumple.svg");
  background-color: var(--mm-red);
  background-image:
    linear-gradient(112deg, transparent 0 41.7%, rgba(255, 255, 255, 0.09) 42%, transparent 42.5%),
    linear-gradient(64deg, transparent 0 63.3%, rgba(0, 0, 0, 0.06) 63.6%, transparent 64.1%),
    linear-gradient(174deg, transparent 0 27.3%, rgba(255, 255, 255, 0.06) 27.6%, transparent 28%),
    url("../assets/paper-noise.svg"),
    var(--paper-tone);
  background-size: auto, auto, auto, 320px 320px, 900px 1400px;
  background-position: center top;
  background-blend-mode: normal, normal, normal, multiply, soft-light;
}

/* the blue posters are printed flat: grain and fold lines only, no mottling */
.paper--blue {
  --paper-tone: none;
  background-color: var(--mm-blue);
}

/* --------------------------------------------------------------------------
   Logo lockup
   <div class="logo" role="img" aria-label="Meet Me After Midnight">
     <svg class="logo__star" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 1.5l3.09 6.9 7.41.78-5.55 5.03 1.57 7.29L12 17.75 5.48 21.5l1.57-7.29L1.5 9.18l7.41-.78z"/></svg>
     <span>Meet Me</span><span>After Midnight.</span>
   </div>
   -------------------------------------------------------------------------- */

.logo {
  --logo-size: 1.55rem;
  position: relative;
  display: inline-grid;
  direction: ltr;
  padding-top: 0.92em;
  font-family: var(--font-logo);
  font-weight: 900;
  font-stretch: 125%;
  font-size: var(--logo-size);
  line-height: 0.86;
  letter-spacing: 0.005em;
  word-spacing: 0.2em;
  text-align: left;
  white-space: nowrap;
  color: var(--logo-color, var(--fg, var(--mm-blue)));
}

.on-blue .logo {
  --logo-color: var(--mm-red);
}

.logo__star {
  position: absolute;
  top: 0;
  left: 0.04em;
  width: 0.86em;
  height: 0.86em;
  fill: var(--mm-yellow);
}

/* --------------------------------------------------------------------------
   Bilingual heading (Arabic over English, like every poster)
   <h2 class="bi-title"><span class="bi-title__ar">القائمة</span><span class="bi-title__en">Menu</span></h2>
   -------------------------------------------------------------------------- */

.bi-title {
  display: grid;
  justify-items: center;
  gap: 0.08em;
  margin: 0;
  text-align: center;
  line-height: 1.1;
}

.bi-title__ar {
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 1.85rem;
  color: var(--fg);
}

.bi-title__en {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.hairline {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--mm-yellow);
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Buttons — chunky stickers with a hard drop
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--mm-yellow);
  --btn-fg: var(--mm-ink);
  --btn-drop: rgba(20, 23, 80, 0.42);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 54px;
  padding: 0.75em 1.6em;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 5px 0 var(--btn-drop);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), filter 0.15s;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-drop);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn--red {
  --btn-bg: var(--mm-red);
  --btn-fg: var(--mm-white);
  --btn-drop: rgba(0, 0, 0, 0.3);
}

.btn--blue {
  --btn-bg: var(--mm-blue);
  --btn-fg: var(--mm-yellow);
  --btn-drop: var(--mm-blue-deep);
}

.btn--cream {
  --btn-bg: var(--mm-cream);
  --btn-fg: var(--mm-blue);
}

.btn--sm {
  min-height: 42px;
  padding: 0.5em 1.05em;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 var(--btn-drop);
}

.btn--sm:active {
  transform: translateY(2px);
}

.btn--ghost,
.btn--ghost.btn--sm {
  border: 2px solid currentColor;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.btn--ghost:active {
  transform: scale(0.97);
  box-shadow: none;
}

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

/* --------------------------------------------------------------------------
   Cards, tape, stickers
   -------------------------------------------------------------------------- */

/* the blue sheet taped onto the red poster (see the Working Hours poster) */
.card-blue {
  position: relative;
  padding: 28px 22px;
  border-radius: 3px;
  background-color: var(--mm-blue);
  background-image:
    linear-gradient(90deg, transparent 49.85%, rgba(255, 255, 255, 0.06) 50%, transparent 50.25%),
    linear-gradient(0deg, transparent 49.85%, rgba(0, 0, 0, 0.1) 50%, transparent 50.25%);
  color: var(--mm-white);
  box-shadow: var(--shadow-card);
}

.card-cream {
  position: relative;
  border-radius: 18px;
  background: var(--mm-cream);
  color: var(--mm-ink);
  box-shadow: var(--shadow-card);
}

/* a strip of masking tape; position it with top/inset-inline and --rot */
.tape {
  position: absolute;
  z-index: 2;
  width: 112px;
  height: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.4));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  transform: rotate(var(--rot, -32deg));
  clip-path: polygon(0 12%, 4% 0, 9% 10%, 14% 0, 100% 0, 97% 22%, 100% 44%, 97% 66%, 100% 88%, 96% 100%, 0 100%, 3% 78%, 0 56%, 3% 34%);
  pointer-events: none;
}

/* die-cut sticker: wrap an <svg>/<img>, tilt it with --rot */
.sticker {
  display: inline-block;
  transform: rotate(var(--rot, -8deg));
  filter: drop-shadow(2px 4px 0 rgba(30, 34, 102, 0.26));
  pointer-events: none;
  user-select: none;
}

/* the white link chip from the Location poster */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 1.1em;
  border-radius: 14px;
  background: var(--mm-white);
  color: #15171f;
  font-family: var(--font-en);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.14);
}

/* --------------------------------------------------------------------------
   Form fields (designed for .on-blue; .on-cream variant below)
   -------------------------------------------------------------------------- */

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: var(--fg);
}

.field__label small {
  font-family: var(--font-en);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.field__input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--mm-white);
  font-size: 1.06rem; /* >=16px so iOS does not zoom on focus */
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.field__input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.field__input:focus-visible {
  border-color: var(--mm-yellow);
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.field--error .field__input {
  border-color: var(--mm-red-soft);
}

.field__error {
  min-height: 1.3em;
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffd3c9;
}

.on-cream .field__input {
  border-color: var(--mm-cream-deep);
  background: var(--mm-white);
  color: var(--mm-ink);
}

.on-cream .field__input::placeholder {
  color: rgba(30, 34, 102, 0.42);
}

.on-cream .field__input:focus-visible {
  border-color: var(--mm-blue);
  background: var(--mm-white);
}

.on-cream .field__error {
  color: var(--mm-red-deep);
}

/* --------------------------------------------------------------------------
   Credit — who built this: one thin line of capitals under a card, with a
   see-through WhatsApp mark (an outline in the colour of the letters).
   A tap opens a WhatsApp chat.
   <a class="credit" href="https://wa.me/…"><span>BY: …</span><svg class="credit__wa">…</svg></a>
   -------------------------------------------------------------------------- */

.credit {
  display: flex;
  align-items: center;
  gap: 5px; /* the letter spacing after the last letter is the rest of the gap */
  width: -moz-fit-content;
  width: fit-content;
  margin: 16px auto 0;
  padding: 8px 14px; /* a finger needs more than the letters */
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-ar);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0; /* Arabic letters join: no spacing between them */
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}

.credit__wa {
  flex: none;
  width: 18px;
  height: 18px;
}

.credit__wa-bubble {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.credit__wa-phone {
  fill: currentColor;
}

.credit:hover,
.credit:focus-visible {
  color: #fff;
}

.credit:focus-visible {
  outline: 2px solid var(--mm-yellow);
  outline-offset: 0;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Seat map — the 26 chairs. One element per chair:
   <div class="seatmap"><i class="seat" data-state="free|held|seated|mine"></i>…</div>
   -------------------------------------------------------------------------- */

.seatmap {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
  direction: ltr;
}

.seat {
  display: block;
  aspect-ratio: 1 / 1.08;
  border: 2px solid var(--mm-yellow);
  border-radius: 46% 46% 28% 28%;
  background: transparent;
  transition: background-color 0.35s, border-color 0.35s, transform 0.35s var(--ease-pop);
}

.seat[data-state="seated"] {
  border-color: var(--mm-red);
  background: var(--mm-red);
}

.seat[data-state="held"] {
  border-color: var(--mm-yellow);
  background: var(--mm-yellow);
}

.seat[data-state="mine"] {
  border-color: var(--mm-white);
  background: var(--mm-white);
  animation: mm-pulse 1.4s ease-in-out infinite;
}

.on-cream .seat {
  border-color: var(--mm-blue);
}

.on-cream .seat[data-state="seated"] {
  border-color: var(--mm-red);
}

.on-cream .seat[data-state="held"] {
  border-color: var(--mm-yellow-deep);
  background: var(--mm-yellow);
}

.on-cream .seat[data-state="mine"] {
  border-color: var(--mm-blue);
  background: var(--mm-blue);
}

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

@keyframes mm-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

@keyframes mm-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes mm-wobble {
  0%, 100% { transform: rotate(calc(var(--rot, -8deg) - 3deg)); }
  50% { transform: rotate(calc(var(--rot, -8deg) + 3deg)); }
}

@keyframes mm-rise {
  0% { transform: translateY(18px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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