/* Luna Café: shared tokens and pieces (customer, staff, owner) */
/* Fonts bundled with the app (no Google Fonts request, works on any café Wi-Fi) */
@font-face { font-family: 'Cinzel'; src: url('/fonts/Cinzel-wght-600.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-wght-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-wght-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-wght-600.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Birthstone Bounce'; src: url('/fonts/Birthstone-Bounce-wght-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --luna: #90ABE7;        /* Luna's logo blue (from their logo file, 3 Nov) */
  --lilac: #A49DE9;       /* paper card */
  --dusk: #5B4BB0;        /* deep violet: stamped discs, accents */
  --night: #1C1D44;       /* ink and night sky */
  --night-2: #2B2D66;
  --moon: #FFF8E8;        /* moonlight */
  --mist: #EEF0FB;        /* app background */
  --paper: #FFFFFF;
  --muted: #5D6090;
  --line: rgba(28, 29, 68, .10);
  --line-2: rgba(28, 29, 68, .16);
  --ok: #2E7D5B;
  --warn: #A3522B;
  --display: 'Cinzel', 'Times New Roman', serif;
  --body: 'Poppins', system-ui, -apple-system, sans-serif;
  --script: 'Birthstone Bounce', 'Brush Script MT', cursive;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --ios: cubic-bezier(.32, .72, 0, 1);   /* iOS sheet curve */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.55; color: var(--night);
  background: var(--mist); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--dusk); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; line-height: 1.2; margin: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  font-weight: 500; font-size: 16px; letter-spacing: .01em; text-decoration: none;
  transition: transform .18s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); transition-duration: .12s; }
/* press feedback on every tappable surface */
.press, .tabs button, .chip, .row, .teaser, .r, .tr, .results button, .nav button, .pad button, .step, .flip-inner { transition: transform .16s var(--ease), background-color .2s, color .2s; }
.tabs button:active, .chip:active, a.row:active, button.row:active, .teaser:active, .r:active, .results button:active, .nav button:active { transform: scale(.97); transition-duration: .1s; }
button.tr:active { transform: scale(.99); }
.btn-night { background: var(--night); color: var(--moon); box-shadow: 0 12px 26px -14px rgba(28, 29, 68, .7); }
.btn-moon { background: var(--moon); color: var(--night); box-shadow: 0 12px 30px -14px rgba(28, 29, 68, .5); }
.btn-line { background: transparent; color: var(--night); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-ghost { background: transparent; color: inherit; min-height: 44px; padding: 0 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* fields */
.field { display: grid; gap: 7px; }
.field label, .field .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.input {
  width: 100%; min-height: 54px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--line-2);
  background: var(--paper); font-size: 16px; transition: border-color .2s, box-shadow .2s; appearance: none;
}
.input:focus { outline: none; border-color: var(--dusk); box-shadow: 0 0 0 4px rgba(91, 75, 176, .14); }
textarea.input { padding: 14px 18px; min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235D6090' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; padding-right: 44px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--dusk); flex: none; }
.error { color: var(--warn); font-size: 14px; min-height: 1.4em; margin: 0; }

/* wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; letter-spacing: .16em; }
.wordmark svg { width: 18px; height: 18px; }

/* toast */
.toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); z-index: 60; translate: -50% -140%;
  display: flex; align-items: center; gap: 12px; width: min(92vw, 420px); padding: 14px 18px;
  background: var(--night); color: var(--moon); border-radius: 18px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 18px 40px -16px rgba(28, 29, 68, .6); transition: translate .5s var(--ease);
}
.toast.show { translate: -50% 0; }
.toast svg { width: 26px; height: 26px; flex: none; }

/* sheet (bottom drawer) */
.scrim { position: fixed; inset: 0; background: rgba(20, 20, 50, .42); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow: auto;
  background: var(--paper); border-radius: 28px 28px 0 0; padding: 12px 22px calc(26px + var(--safe-b));
  translate: 0 105%; visibility: hidden; transition: translate .5s var(--ios), visibility 0s .5s; max-width: 560px; margin: 0 auto;
  overscroll-behavior: contain; touch-action: pan-y;
}
.sheet.show { translate: 0 0; visibility: visible; transition: translate .5s var(--ios); }
.sheet.dragging { transition: none; }
.sheet .grip { cursor: grab; }
.sheet .grip { width: 42px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 16px; }

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

/* ---------- the moon card ---------- */
.moon-card {
  position: relative; border-radius: var(--r-lg); color: #fff; overflow: hidden; isolation: isolate;
  background:
    #90ABE7;   /* Luna's logo blue, flat like their logo (3 Nov) */
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 34px 60px -28px rgba(56, 44, 140, .65), 0 10px 24px -14px rgba(56, 44, 140, .4);
}
.moon-card::before { /* printed-card grain */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .16; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.mc-face { padding: 26px 22px 20px; text-align: center; }
.mc-title { font-family: var(--display); font-weight: 600; font-size: clamp(14px, 4.2vw, 18px); letter-spacing: .04em; white-space: nowrap; line-height: 1.1; margin: 6px 0 10px; text-shadow: 0 2px 14px rgba(70, 50, 160, .25); }
.mc-copy { text-wrap: balance; font-size: 13px; line-height: 1.5; margin: 0 auto 18px; max-width: 29ch; color: rgba(255, 255, 255, .92); }
.mc-moons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px 4px; justify-items: center; }
.moon { position: relative; width: 100%; max-width: 78px; aspect-ratio: 1; }
.moon svg { width: 100%; height: 100%; overflow: visible; }
.moon .disc { fill: rgba(72, 56, 168, .26); transition: fill .8s var(--ease); }
.moon .ghost { fill: rgba(255, 255, 255, .24); transition: opacity .6s; }
.moon .halo { opacity: 0; transition: opacity .9s; }
.moon .craters circle { fill: rgba(170, 150, 120, .16); }
.moon .spark path { fill: #FFF8E8; opacity: 0; transform-box: fill-box; transform-origin: center; }
.moon.on .disc { fill: #4B3F9E; }
.moon.on .ghost { opacity: 0; }
.moon.on .halo { opacity: .55; }
.moon .ring { fill: none; stroke: #FFF8E8; stroke-width: 1.5; opacity: 0; }
.moon.free .disc { fill: rgba(72, 56, 168, .36); }
.free-label { position: absolute; left: 50%; bottom: -22px; translate: -50% 0; font-family: var(--display); font-weight: 600; letter-spacing: .06em; font-size: 15px; line-height: 1; white-space: nowrap; }
.mc-moons:has(.free) { padding-bottom: 22px; }
.moon-card.ready .moon.free .halo { opacity: 1; animation: glow 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes glow { 50% { opacity: .55; transform: scale(1.12); } }
.mc-foot { margin-top: 14px; opacity: .78; font-size: 12px; }

/* mini moons (lists) */
.mini { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini svg { width: 16px; height: 16px; }
.mini .disc { fill: rgba(91, 75, 176, .16); }
.mini .ph { fill: rgba(91, 75, 176, .22); }
.mini .on .disc { fill: var(--dusk); }
.mini .on .ph { fill: var(--moon); }
.mini .free.on .disc { fill: #E9B949; }

/* the customer's card strip (staff sheet, owner member panel) */
.m-band { margin: 0 -10px 16px; padding: 16px 16px 14px; border-radius: 24px; color: #fff;
  background: radial-gradient(120% 90% at 85% -20%, rgba(255, 255, 255, .3), transparent 60%), linear-gradient(160deg, #A9B6F1 0%, #A19FEB 50%, #9B8FE2 100%);
  box-shadow: 0 24px 40px -26px rgba(56, 44, 140, .7); transition: box-shadow .8s; }
.m-band.gold { box-shadow: 0 0 0 2px rgba(244, 210, 122, .9), 0 24px 50px -20px rgba(214, 160, 40, .7); }
.m-band-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.m-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); color: #fff; font-family: var(--display); font-weight: 700; font-size: 20px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
.m-av.sm { width: 40px; height: 40px; font-size: 17px; background: var(--lilac); }
.m-band h2 { font-size: 23px; color: #fff; }
.m-sub { margin: 1px 0 0; color: rgba(255, 255, 255, .88); font-size: 13.5px; }
.moon-card.compact { background: none; box-shadow: none; overflow: visible; }
.moon-card.compact::before { display: none; }
.moon-card.compact .mc-face { padding: 4px 0 0; }
.moon-card.compact .mc-moons { gap: 2px; }
.moon-card.compact .free-label { font-size: 19px; bottom: -16px; }
.moon-card.compact .mc-moons:has(.free) { padding-bottom: 16px; }
.moon.next .disc { fill: rgba(255, 255, 255, .34); }
.moon.next svg { animation: nextp 1.4s ease-in-out infinite; transform-origin: center; }
@keyframes nextp { 50% { transform: scale(1.08); } }

/* screen changes (View Transitions): the old screen lifts away, the new one settles in; bars stay put */
::view-transition-old(root) { animation: vt-out .26s var(--ios) both; }
::view-transition-new(root) { animation: vt-in .46s var(--ios) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
.tabs { view-transition-name: tabs; }
.side { view-transition-name: side; }
.h-top { view-transition-name: htop; }

/* ---------- the card as an object (shared: customer card, owner previews) ---------- */
.tilt { position: relative; will-change: transform; --tx: 0; --ty: 0; }
.mc-sheen, .mc-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 2; }
/* pearl foil: a band of soft colour that slides across as the card tilts */
.mc-sheen { mix-blend-mode: soft-light; opacity: .38;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 205, 240, .9) 34%, rgba(170, 225, 255, .9) 44%, rgba(255, 250, 215, .95) 54%, rgba(200, 180, 255, .8) 63%, transparent 76%);
  background-size: 260% 260%; background-position: calc(50% + var(--tx) * 45%) calc(50% + var(--ty) * 45%); }
/* the light catching the card */
.mc-glare { mix-blend-mode: overlay;
  background: radial-gradient(circle at calc(50% + var(--tx) * 55%) calc(40% + var(--ty) * 55%), rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 46%); }
.moon .earthshine { opacity: .16; }
.moon .lit { filter: drop-shadow(0 0 2.5px rgba(255, 248, 232, .55)); }
.moon.on .disc { fill: #3A3088; }
/* full card: a gold edge */
.moon-card.ready { box-shadow: 0 0 0 1.5px rgba(246, 214, 136, .95) inset, 0 0 0 1px rgba(246, 214, 136, .35), 0 30px 90px -30px rgba(240, 200, 110, .55) !important; }
.moon-card.ready .mc-sheen { background: linear-gradient(115deg, transparent 22%, rgba(255, 228, 160, .95) 38%, rgba(255, 250, 225, 1) 50%, rgba(246, 205, 120, .9) 62%, transparent 76%); background-size: 260% 260%; background-position: calc(50% + var(--tx) * 45%) calc(50% + var(--ty) * 45%); }

.mc-face { position: relative; z-index: 3; }   /* the face sits above the sheen: moons stay crisp */
.mc-sheen, .mc-glare { z-index: 1; }

/* flat logo blue (Luna, 3 Nov): no glare or sheen on an ordinary card; the full card keeps its gold */
.moon-card:not(.ready) .mc-glare, .moon-card:not(.ready) .mc-sheen { display: none; }

.wordmark .luna-logo { width: 34px; height: 34px; display: block; }
.mc-foot:has(.luna-logo) { opacity: 1; }
