/* ==========================================================================
   ZALTRO — Design system
   Tailwind (CDN) handles layout/spacing; this file holds the reusable
   components, theme tokens, animations and dashboard-mockup styles.

   CUSTOMISE: change the tokens in :root and the [data-theme] blocks.
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --secondary: #7c3aed;
  --bg: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --cyan: #06b6d4;

  /* Default accent (brand). Overridden per product by [data-theme]. */
  --a1: #4f46e5;
  --a2: #7c3aed;
  --a-soft: #eef2ff;
  --a-ink: #3730a3;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, .03), 0 8px 16px -4px rgba(15, 23, 42, .07), 0 18px 36px -12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, .03), 0 16px 32px -8px rgba(15, 23, 42, .10), 0 40px 80px -24px rgba(79, 70, 229, .22);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Product identities — each product gets its own accent */
[data-theme="pos"]    { --a1: #ea580c; --a2: #f59e0b; --a-soft: #fff7ed; --a-ink: #9a3412; }
[data-theme="hms"]    { --a1: #0891b2; --a2: #14b8a6; --a-soft: #ecfeff; --a-ink: #155e75; }
[data-theme="studio"] { --a1: #7c3aed; --a2: #db2777; --a-soft: #f5f3ff; --a-ink: #5b21b6; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #c7d2fe; }

/* Ambient background lighting (used on hero + CTA sections) */
.ambient { position: relative; isolation: isolate; }
.ambient::before, .ambient::after {
  content: ""; position: absolute; z-index: -1; border-radius: 9999px; filter: blur(90px); opacity: .55; pointer-events: none;
}
.ambient::before { width: 520px; height: 520px; top: -160px; left: -120px; background: radial-gradient(circle, #c7d2fe, transparent 70%); }
.ambient::after  { width: 560px; height: 560px; top: 40px; right: -160px; background: radial-gradient(circle, #e9d5ff, transparent 70%); }
.grid-bg {
  background-image: linear-gradient(to right, rgba(100,116,139,.07) 1px, transparent 1px), linear-gradient(to bottom, rgba(100,116,139,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; color: var(--primary); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 12px; }

/* ---------- Typography helpers ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--a1); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.h-display { font-size: clamp(2.4rem, 5.2vw, 4.25rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; }
.h-section { font-size: clamp(1.75rem, 3.4vw, 2.6rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; }
.text-grad { background: linear-gradient(100deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-grad-brand { background: linear-gradient(100deg, #4f46e5, #7c3aed 60%, #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 12px; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s; cursor: pointer; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 20px -6px color-mix(in srgb, var(--a1) 70%, transparent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 14px 28px -8px color-mix(in srgb, var(--a1) 75%, transparent); }
.btn-primary::after { /* animated sheen */
  content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { color: var(--ink); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { transform: translateY(-2px); border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid rgba(226,232,240,.9); border-radius: 20px; box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--a1) 25%, var(--line)); }
/* gradient hairline border */
.gborder { position: relative; }
.gborder::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--a1) 55%, transparent), transparent 40%, color-mix(in srgb, var(--a2) 45%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass { background: rgba(255,255,255,.66); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow-md); }
.icon-tile {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--a1) 60%, transparent);
}
.icon-soft { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--a-soft); color: var(--a1); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--a-soft); color: var(--a-ink); }

/* ---------- Header / navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; transition: background-color .3s, box-shadow .3s, border-color .3s; border-bottom: 1px solid transparent; }
.site-header.scrolled { background: rgba(248,250,252,.82); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5); border-color: var(--line); box-shadow: 0 6px 24px -14px rgba(15,23,42,.18); }
.nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: #334155; transition: background-color .2s, color .2s; }
.nav-link:hover, .has-dd.open > .nav-link { background: #eef2ff; color: var(--primary); }
.has-dd { position: relative; }
.has-dd > .nav-link .chev { transition: transform .25s var(--ease); }
.has-dd.open > .nav-link .chev, .has-dd:hover > .nav-link .chev { transform: rotate(180deg); }
.dd {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98); transform-origin: top left;
  transition: opacity .2s, transform .25s var(--ease), visibility .2s;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px -16px rgba(15,23,42,.25); padding: 10px;
}
.has-dd::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; } /* hover bridge */
.has-dd:hover > .dd, .has-dd:focus-within > .dd, .has-dd.open > .dd { opacity: 1; visibility: visible; transform: none; }
.dd-item { display: flex; gap: 14px; padding: 12px; border-radius: 14px; transition: background-color .2s; }
.dd-item:hover { background: #f8fafc; }
.mobile-nav { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.mobile-nav.open { max-height: 90vh; overflow-y: auto; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Tabs / accordion ---------- */
.tab-btn { position: relative; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: #475569; display: inline-flex; gap: 8px; align-items: center; transition: color .2s, background-color .2s; }
.tab-btn:hover { color: var(--ink); }
.tab-btn[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.tab-panel[hidden] { display: none; }
.tab-panel.enter { animation: panelIn .55s var(--ease) both; }

.acc-item { border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: box-shadow .3s, border-color .3s; }
.acc-item:has(button[aria-expanded="true"]) { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--a1) 30%, var(--line)); }
.acc-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; padding: 20px 22px; font-weight: 700; font-size: 16px; }
.acc-btn .plus { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #f1f5f9; transition: transform .3s var(--ease), background-color .2s, color .2s; }
.acc-btn[aria-expanded="true"] .plus { transform: rotate(45deg); background: var(--a1); color: #fff; }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.acc-panel > div { overflow: hidden; }
.acc-panel.open { grid-template-rows: 1fr; }

/* ---------- Forms ---------- */
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid #cbd5e1; background: #fff; font-size: 15px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input::placeholder { color: #94a3b8; }
.input:hover { border-color: #94a3b8; }
.input:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 18%, transparent); }
.input[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
.lbl { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.err { color: #b91c1c; font-size: 12.5px; margin-top: 5px; min-height: 0; }
.err:empty { display: none; }

/* ---------- Dialogs & toast ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 24px; width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: #fff; box-shadow: 0 40px 100px -20px rgba(15,23,42,.45); overflow: auto; }
dialog.modal::backdrop { background: rgba(15,23,42,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modalIn .35s var(--ease); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .4s var(--ease); background: #0f172a; color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: 0 20px 40px -10px rgba(15,23,42,.5); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.wa-fab { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #22c55e; box-shadow: 0 12px 28px -6px rgba(34,197,94,.6); transition: transform .3s var(--ease); }
.wa-fab:hover { transform: scale(1.08) rotate(-4deg); }

/* ---------- Misc ---------- */
.check { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--a-soft); color: var(--a1); margin-top: 2px; }
.step-line { background: linear-gradient(90deg, transparent, #c7d2fe 15%, #c7d2fe 85%, transparent); height: 2px; }
.pricing-pop { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(140deg, var(--a1), var(--a2)) border-box; border: 1.5px solid transparent; box-shadow: var(--shadow-lg); }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: #e8edf5; gap: 2px; }
.seg button { padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #475569; transition: .2s; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.cta-band { background: radial-gradient(900px 400px at 85% -10%, rgba(124,58,237,.55), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(6,182,212,.35), transparent 60%), #1e1b4b; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-12px) rotate(var(--r, 0deg)); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 100% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }
.float { animation: floaty 7s ease-in-out infinite; }
.float.d2 { animation-duration: 8.5s; animation-delay: -2s; }
.float.d3 { animation-duration: 9.5s; animation-delay: -4s; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulseDot 1.6s infinite; }

/* Hero 3D stage */
.stage { perspective: 1600px; }
.stage-main { transform: rotateY(-8deg) rotateX(4deg); transform-style: preserve-3d; transition: transform .6s var(--ease); }
.stage:hover .stage-main { transform: rotateY(-3deg) rotateX(2deg); }

/* ==========================================================================
   Dashboard mockups (rendered by main.js → MOCKS). Pure HTML/CSS, no images.
   .mock is a size container so layouts adapt to the card they sit in.
   ========================================================================== */
.mock { container-type: inline-size; background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-md); overflow: hidden; font-size: 10px; color: #334155; text-align: left; }
.mock-bar { display: flex; align-items: center; gap: 5px; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.mock-bar i:nth-child(1) { background: #fca5a5; } .mock-bar i:nth-child(2) { background: #fcd34d; } .mock-bar i:nth-child(3) { background: #86efac; }
.mock-bar span { margin-left: 8px; font-weight: 600; color: #64748b; font-size: 10px; }
.mock-body { display: grid; grid-template-columns: 38px 1fr; min-height: 250px; }
.m-side { background: #f8fafc; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 12px 0; }
.m-side b { width: 20px; height: 20px; border-radius: 7px; background: #e2e8f0; display: block; }
.m-side b:first-child { background: linear-gradient(135deg, var(--a1), var(--a2)); }
.m-main { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.m-title { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 11px; color: var(--ink); }
.m-title small { font-weight: 600; color: #94a3b8; font-size: 9px; }
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; background: #fff; }
.m-stat small { display: block; color: #94a3b8; font-weight: 600; font-size: 8.5px; }
.m-stat strong { display: block; font-size: 13px; color: var(--ink); letter-spacing: -.02em; margin-top: 2px; }
.m-stat em { font-style: normal; font-size: 8.5px; font-weight: 700; color: #16a34a; }
.m-grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.m-box { border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: #fff; min-width: 0; }
.m-box h6 { font-size: 9px; font-weight: 700; color: #64748b; margin-bottom: 7px; }
.m-bars { display: flex; align-items: flex-end; gap: 5px; height: 62px; }
.m-bars span { flex: 1; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--a1) 22%, #fff); transform-origin: bottom; animation: grow .9s var(--ease) both; }
.m-bars span.hi { background: linear-gradient(180deg, var(--a1), var(--a2)); }
.m-tables { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.m-tables span { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 8.5px; background: #f1f5f9; color: #64748b; }
.m-tables .occ { background: color-mix(in srgb, var(--a1) 16%, #fff); color: var(--a-ink); }
.m-tables .bill { background: #dcfce7; color: #166534; }
.m-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-top: 1px solid #f1f5f9; }
.m-row:first-of-type { border-top: 0; }
.m-row .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--a-soft); color: var(--a-ink); font-weight: 700; font-size: 8px; flex: none; }
.m-row .tx { flex: 1; min-width: 0; line-height: 1.25; } .m-row .tx b { display: block; color: var(--ink); font-size: 9.5px; } .m-row .tx small { color: #94a3b8; font-size: 8.5px; }
.m-pill { padding: 2px 7px; border-radius: 99px; font-size: 8.5px; font-weight: 700; background: var(--a-soft); color: var(--a-ink); white-space: nowrap; }
.m-pill.g { background: #dcfce7; color: #166534; } .m-pill.y { background: #fef3c7; color: #92400e; } .m-pill.b { background: #dbeafe; color: #1e40af; }
.m-progress { height: 6px; border-radius: 9px; background: #eef2f7; overflow: hidden; margin: 4px 0 7px; } .m-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.m-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.m-cal span { padding: 4px 0; border-radius: 6px; font-size: 8.5px; font-weight: 600; color: #64748b; }
.m-cal .d { color: #cbd5e1; font-weight: 700; font-size: 7.5px; }
.m-cal .bk { background: color-mix(in srgb, var(--a1) 18%, #fff); color: var(--a-ink); }
.m-cal .tn { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; }
.m-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 6px; background: conic-gradient(var(--a1) calc(var(--p) * 1%), #e8eef5 0); }
.m-ring b { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; color: var(--ink); }
@container (max-width: 430px) {
  .hide-sm { display: none !important; }
  .m-stats { gap: 5px; } .m-grid2 { grid-template-columns: 1fr; }
  .mock-body { grid-template-columns: 30px 1fr; }
}

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