/* HostMyVibe design tokens and components.
   Palette is taken from the logo: teal ground, orange coat, pink tongue, ink outline.
   Everything that moves animates transform/opacity only, so it stays on the compositor. */

@font-face { font-family: 'BDOGrotesk'; src: url('/static/fonts/BDOGrotesk-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'BDOGrotesk'; src: url('/static/fonts/BDOGrotesk-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'BDOGrotesk'; src: url('/static/fonts/BDOGrotesk-DemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'BDOGrotesk'; src: url('/static/fonts/BDOGrotesk-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'BDOGrotesk'; src: url('/static/fonts/BDOGrotesk-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --ink: #17211e;
  --ink-soft: #55635e;
  --paper: #f6f3ea;
  --card: #ffffff;
  --line: #e4dfd2;
  --teal: #4e8c7b;
  --teal-deep: #2c6656;
  --teal-wash: #e3efeb;
  --orange: #f4a43c;
  --orange-deep: #b8651f;
  --orange-wash: #fdf0db;
  --pink: #ee5f9a;
  --pink-wash: #fde6ef;
  --red: #c8372d;
  --red-wash: #fbe4e1;
  --green-wash: #dff3e4;
  --green-ink: #1c6b3a;
  --blue-wash: #e1ecfb;
  --blue-ink: #2456a6;

  --radius: 14px;
  --radius-sm: 10px;
  --drop: 0 3px 0 var(--ink);                 /* the chunky "pixel" shadow buttons sit on */
  --lift: 0 10px 30px rgba(23, 33, 30, 0.12);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --fast: 120ms;
  --med: 260ms;

  --font: 'BDOGrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Pixelify Sans', 'BDOGrotesk', sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.4;
       overflow-x: hidden; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
a { color: var(--teal-deep); }
h1, h2, h3 { line-height: 1.15; }
.display { font-family: var(--display); letter-spacing: 0.01em; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.82rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px;
       border-radius: var(--radius-sm); border: 2px solid var(--ink); background: var(--card); font-weight: 700;
       font-size: 0.92rem; text-decoration: none; color: var(--ink); box-shadow: var(--drop); user-select: none;
       transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast); }
.btn:active, .btn.pressed { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--teal-deep); color: #fff; }
.btn-accent { background: var(--orange); }
.btn-pink { background: var(--pink); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-ghost, .btn-ghost.btn-sm { border-color: transparent; box-shadow: none; background: transparent; color: var(--teal-deep); padding: 8px 10px; }
.btn-ghost:active, .btn-ghost.btn-sm:active { transform: scale(0.96); background: var(--teal-wash); box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; box-shadow: 0 2px 0 var(--ink); }
.btn-sm:active { transform: translateY(2px); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent;
             border-radius: 50%; animation: spin 0.6s linear infinite; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: none; background: transparent; color: inherit;
            display: inline-flex; align-items: center; justify-content: center;
            transition: transform var(--fast) var(--ease), background var(--fast); }
.icon-btn:active { transform: scale(0.88); background: rgba(255, 255, 255, 0.18); }
.icon-btn.dark:active { background: var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms ───────────────────────────────────────────────────────────────── */
label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin: 12px 0 5px; }
input, select, textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 2px solid var(--line);
       border-radius: var(--radius-sm); background: var(--card); font-size: 16px;   /* 16px stops iOS zoom-on-focus */
       transition: border-color var(--fast), box-shadow var(--fast); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-wash); }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 46px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--teal-deep); }
textarea { resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }
.hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 5px; }
.error-text { color: var(--red); font-size: 0.85rem; font-weight: 600; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; font-size: 0.9rem; color: var(--ink); }

/* ── Cards, badges, lists ────────────────────────────────────────────────── */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.tap { transition: transform var(--fast) var(--ease), border-color var(--fast); cursor: pointer; }
.card.tap:active { transform: scale(0.985); border-color: var(--teal); }
.card-title { font-weight: 800; font-size: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 0.72rem;
         font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.badge-confirmed { background: var(--blue-wash); color: var(--blue-ink); }
.badge-checked_in { background: var(--green-wash); color: var(--green-ink); }
.badge-checked_out { background: var(--line); color: var(--ink-soft); }
.badge-cancelled, .badge-no_show { background: var(--red-wash); color: var(--red); }
.badge-paid { background: var(--green-wash); color: var(--green-ink); }
.badge-partial { background: var(--orange-wash); color: var(--orange-deep); }
.badge-unpaid { background: var(--red-wash); color: var(--red); }
.badge-overpaid { background: var(--pink-wash); color: #a82762; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--card); font-size: 0.84rem;
        font-weight: 700; color: var(--ink-soft); white-space: nowrap;
        transition: transform var(--fast) var(--spring), background var(--fast), border-color var(--fast), color var(--fast); }
.chip:active { transform: scale(0.93); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.taken { opacity: 0.45; text-decoration: line-through; pointer-events: none; }
.chip.picked { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-soft); }
.empty img { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 14px; image-rendering: pixelated; }
.empty h3 { color: var(--ink); font-size: 1.05rem; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.section-label { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
                 color: var(--ink-soft); margin: 18px 0 8px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.plain td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
table.plain tr:first-child td { border-top: none; }
.amount { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Counter (meals) ─────────────────────────────────────────────────────── */
.counter { display: inline-flex; align-items: center; gap: 4px; }
.counter button { width: 36px; height: 36px; border-radius: 12px; border: 2px solid var(--ink); background: var(--card);
                  font-size: 1.15rem; font-weight: 800; line-height: 1; box-shadow: 0 2px 0 var(--ink);
                  transition: transform var(--fast) var(--ease), box-shadow var(--fast); }
.counter button:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.counter button.plus { background: var(--orange); }
.counter output { min-width: 34px; text-align: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.pop { animation: pop 220ms var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ── Skeletons ───────────────────────────────────────────────────────────── */
.skeleton { border-radius: var(--radius); height: 78px; margin-bottom: 12px;
            background: linear-gradient(90deg, #ece8dc 25%, #f5f2e9 50%, #ece8dc 75%); background-size: 200% 100%;
            animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in > * { animation: rise var(--med) var(--ease) backwards; }
.fade-in > *:nth-child(2) { animation-delay: 30ms; } .fade-in > *:nth-child(3) { animation-delay: 60ms; }
.fade-in > *:nth-child(4) { animation-delay: 90ms; } .fade-in > *:nth-child(n+5) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Layers: panels slide from the right, sheets rise from the bottom ────── */
.scrim { position: fixed; inset: 0; background: rgba(23, 33, 30, 0.5); opacity: 0; pointer-events: none;
         transition: opacity var(--med) var(--ease); z-index: 50; }
.scrim.open { opacity: 1; pointer-events: auto; }
.panel { position: fixed; inset: 0; background: var(--paper); z-index: 60; display: flex; flex-direction: column;
         transform: translateX(100%); visibility: hidden; will-change: transform;
         transition: transform 320ms var(--ease), visibility 0s linear 320ms; }
.panel.open { transform: none; visibility: visible; transition: transform 320ms var(--ease), visibility 0s; }
.panel-head { background: var(--teal-deep); color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 6px;
              padding-top: calc(10px + env(safe-area-inset-top)); flex-shrink: 0; }
.panel-head h2 { font-size: 1.05rem; font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 16px 110px; -webkit-overflow-scrolling: touch; }
.panel-body > .wrap, .page > .wrap { max-width: 720px; margin: 0 auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--paper); max-height: 92dvh;
         border-radius: 22px 22px 0 0; border-top: 2px solid var(--ink); display: flex; flex-direction: column;
         transform: translateY(105%); visibility: hidden; will-change: transform;
         transition: transform 340ms var(--ease), visibility 0s linear 340ms; }
.sheet.open { transform: none; visibility: visible; transition: transform 340ms var(--ease), visibility 0s; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 2px; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; flex-shrink: 0; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 800; }
.sheet-body { overflow-y: auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body > .wrap { max-width: 620px; margin: 0 auto; }
.sheet-actions { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.fab { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; width: 60px; height: 60px;
       border-radius: 20px; border: 2px solid var(--ink); background: var(--orange); box-shadow: 0 4px 0 var(--ink);
       font-size: 2rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
       transition: transform var(--fast) var(--ease), box-shadow var(--fast); }
.fab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.sticky-cta { position: absolute; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 5; }
.sticky-cta .btn { width: 100%; padding: 14px; font-size: 1rem; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast { position: fixed; left: 50%; top: calc(66px + env(safe-area-inset-top)); z-index: 200; max-width: min(92vw, 460px);
         transform: translate(-50%, -24px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff;
         padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 0.9rem; text-align: center;
         box-shadow: var(--lift); transition: transform var(--med) var(--spring), opacity var(--med) var(--ease); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.error { background: var(--red); }

/* ── Acknowledgement popup ───────────────────────────────────────────────── */
.ack { position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 24px;
       background: rgba(23, 33, 30, 0.55); opacity: 0; visibility: hidden;
       transition: opacity 200ms var(--ease), visibility 0s linear 200ms; }
.ack.show { opacity: 1; visibility: visible; transition: opacity 160ms var(--ease), visibility 0s; }
.ack-card { background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink);
            padding: 26px 26px 22px; text-align: center; width: 100%; max-width: 300px; transform: scale(0.8); }
.ack.show .ack-card { animation: ack-in 360ms var(--spring) forwards; }
.ack-check { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px; border: 2px solid var(--ink);
             background: var(--orange); display: flex; align-items: center; justify-content: center; box-shadow: var(--drop); }
.ack-check svg { width: 46px; height: 46px; stroke-dasharray: 48; stroke-dashoffset: 48; }
.ack.show .ack-check svg { animation: ack-draw 380ms 160ms var(--ease) forwards; }
.ack-card h2 { font-size: 1.25rem; font-weight: 800; }
.ack-card p { color: var(--ink-soft); margin-top: 6px; font-size: 0.92rem; overflow-wrap: anywhere; }
@keyframes ack-in { to { transform: scale(1); } }
@keyframes ack-draw { to { stroke-dashoffset: 0; } }

/* ── Collapsible sections ────────────────────────────────────────────────── */
.fold { padding: 0; overflow: hidden; }
.fold-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; background: none; border: none; text-align: left;
             transition: background var(--fast); }
.fold-head:active { background: var(--teal-wash); }
.fold-head .card-title { flex-shrink: 0; }
.fold-sum { flex: 1; min-width: 0; text-align: right; font-size: 0.86rem; font-weight: 700; color: var(--ink-soft);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fold-sum .due { color: var(--red); }
.fold-head svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-soft); transition: transform var(--med) var(--ease); }
.fold.open .fold-head svg { transform: rotate(180deg); }
.fold-body { display: grid; grid-template-rows: 0fr; visibility: hidden;
             transition: grid-template-rows var(--med) var(--ease), visibility 0s linear var(--med); }
.fold.open .fold-body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--med) var(--ease), visibility 0s; }
.fold-inner { min-height: 0; overflow: hidden; }
.fold-pad { padding: 0 14px 14px; }

@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; width: 620px; margin-left: -310px; bottom: 5vh; border-radius: 22px; border: 2px solid var(--ink);
           box-shadow: var(--lift); max-height: 88vh; }
  .sheet-grip { visibility: hidden; }
  .panel { left: auto; width: min(760px, 100%); border-left: 2px solid var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
