/* TEMPRIO back office, login and POS — motion layer (loaded after app.css / pos.css) */

/* ——— Login 3D scene ——— */
.tp-login-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.tp-login-scene .tp-scene-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.tp-login-scene.is-ready .tp-scene-canvas { opacity: 1; }
.tp-login-scene.is-ready ~ .tp-login-orb { opacity: 0; transition: opacity 1.2s ease; }
.tp-login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 18, 28, 0.72) 0%, rgba(5, 18, 28, 0) 42%);
}

/* Floating business-type icons — inside hero / sign-in panel (not behind the opaque shell) */
.tp-login-glyphs {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.tp-login-panel {
  position: relative;
}

.tp-login-panel .tp-login-glyphs {
  z-index: 0;
}

.tp-login-panel .tp-login-card {
  position: relative;
  z-index: 1;
}

.tp-login-hero-inner {
  z-index: 4;
}

.tp-login-glyph {
  position: absolute;
  left: var(--gx, 10%);
  top: var(--gy, 20%);
  width: calc(44px * var(--gs, 1));
  height: calc(44px * var(--gs, 1));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.78);
  font-size: calc(1.2rem * var(--gs, 1));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: tpLoginGlyphDrift var(--gd, 14s) ease-in-out infinite;
  animation-delay: var(--gdelay, 0s);
  will-change: transform, opacity;
}

.tp-login-glyph.is-light {
  background: rgba(11, 61, 92, 0.08);
  border-color: rgba(11, 61, 92, 0.14);
  color: rgba(11, 61, 92, 0.45);
  box-shadow: 0 10px 26px rgba(11, 61, 92, 0.08);
}

.tp-login-glyph i {
  line-height: 1;
}

@keyframes tpLoginGlyphDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.72;
  }
  25% {
    transform: translate3d(12px, -16px, 0) rotate(6deg);
    opacity: 1;
  }
  50% {
    transform: translate3d(-10px, 8px, 0) rotate(-5deg);
    opacity: 0.82;
  }
  75% {
    transform: translate3d(8px, 14px, 0) rotate(4deg);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-login-glyph {
    animation: none;
    opacity: 0.55;
  }
  .tp-login-glyph.is-light {
    opacity: 0.4;
  }
}

/* ——— Back office: GSAP owns transforms ——— */
.tp-motion .tp-stat { transition: box-shadow 0.22s ease, border-color 0.2s ease; transform-style: preserve-3d; }
.tp-motion .tp-stat:hover { transform: none; }
.tp-glare::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--tp-gx, 50%) var(--tp-gy, 50%), rgba(255, 255, 255, 0.55), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: soft-light;
}
.tp-glare:hover::after { opacity: 1; }

/* ——— POS ——— */
.tp-motion .pos-tile {
  animation: none;
  transition: box-shadow 0.28s ease, border-color 0.2s ease;
  transform-style: preserve-3d;
}
.tp-motion .pos-tile:hover,
.tp-motion .pos-tile:active { transform: none; }

.tp-pos-fly {
  position: fixed;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 14px;
  z-index: 2000;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #fff6dc, #E8A838 60%, #b97c12);
  box-shadow: 0 12px 30px rgba(232, 168, 56, 0.45);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
}
.tp-pos-fly img { width: 100%; height: 100%; object-fit: cover; }

.tp-pos-pulse { display: inline-block; will-change: transform; }

.tp-motion .pos-btn-pay:not(:disabled) { position: relative; overflow: hidden; }
.tp-motion .pos-btn-pay:not(:disabled)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg);
  animation: tpShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.tp-success {
  position: relative;
  display: grid;
  place-items: center;
  height: 96px;
  margin: -0.25rem 0 0.75rem;
}
.tp-success svg { width: 76px; height: 76px; overflow: visible; }
.tp-success-ring { fill: none; stroke: #2f9e55; stroke-width: 3; }
.tp-success-fill { fill: rgba(47, 158, 85, 0.1); }
.tp-success-check { fill: none; stroke: #2f9e55; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.tp-confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.tp-confetti i {
  position: absolute;
  left: -4px;
  top: -6px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
}

@keyframes tpShine {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}

/* =====================================================================
   Premium skin (back office + POS). Static styles apply without JS;
   anything GSAP animates is gated by .tp-motion.
   ===================================================================== */

/* ——— Ambient aurora behind the back office ——— */
body.tp-body { position: relative; }
body.tp-body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 18%, rgba(26, 107, 154, 0.16), transparent 70%),
    radial-gradient(30% 28% at 82% 12%, rgba(232, 168, 56, 0.12), transparent 70%),
    radial-gradient(34% 30% at 70% 88%, rgba(11, 61, 92, 0.1), transparent 70%);
  animation: tpAurora 38s ease-in-out infinite alternate;
  will-change: transform;
}
body.tp-body > .tp-shell { position: relative; z-index: 1; }
@keyframes tpAurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(4%, 3%, 0) rotate(4deg); }
  100% { transform: translate3d(-3%, 5%, 0) rotate(-3deg); }
}

/* ——— Lenis on .tp-content ——— */
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
.tp-motion .tp-content > * { animation: none; }

/* ——— Sidebar ——— */
.tp-sidebar {
  position: relative;
  background:
    radial-gradient(260px 200px at 10% 0%, rgba(232, 168, 56, 0.18), transparent 60%),
    radial-gradient(240px 260px at 100% 70%, rgba(26, 107, 154, 0.35), transparent 65%),
    linear-gradient(180deg, #0c4266 0%, #072232 100%);
  box-shadow: 8px 0 30px rgba(4, 20, 30, 0.18);
}
.tp-sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(232, 168, 56, 0.45), rgba(26, 107, 154, 0.4), transparent);
}
.tp-brand-logo { transition: transform 0.5s var(--tp-ease), box-shadow 0.5s var(--tp-ease); }
.tp-brand:hover .tp-brand-logo { transform: translateY(-2px) scale(1.02); }
.tp-nav { position: relative; }
.tp-nav-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  border-radius: 11px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 16px rgba(0, 0, 0, 0.15);
}
.tp-nav-link, .tp-nav-group > summary { position: relative; z-index: 1; }
.tp-nav-items { overflow: hidden; }
.tp-motion .tp-nav-link:hover,
.tp-motion .tp-nav-group > summary:hover { background: transparent; transform: none; }
.tp-motion .tp-nav-link.active:hover { background: linear-gradient(135deg, rgba(232, 168, 56, 0.95), #d49220); }
.tp-nav-link.active {
  box-shadow: 0 10px 24px rgba(232, 168, 56, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.tp-nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 3px;
  background: #ffd27a;
  box-shadow: 0 0 12px rgba(255, 210, 122, 0.9);
}

/* ——— Topbar ——— */
.tp-topbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.tp-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(26, 107, 154, 0.35), rgba(232, 168, 56, 0.45), transparent);
}
.tp-user { box-shadow: 0 2px 8px rgba(11, 61, 92, 0.06); }

/* ——— Route feedback ——— */
.tp-route-bar {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  z-index: 3000;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  background: linear-gradient(90deg, #1A6B9A, #E8A838, #ffd27a);
  box-shadow: 0 0 12px rgba(232, 168, 56, 0.7);
}
.tp-content { transition: opacity 0.25s ease, filter 0.25s ease; }
.tp-leaving .tp-content { opacity: 0.45; filter: saturate(0.6) blur(1px); pointer-events: none; }

/* ——— Page title (split words) ——— */
.tp-page-title .tp-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.04em 0.02em 0.16em;
  margin: -0.04em -0.02em -0.16em;
}
.tp-page-title .tp-wi { display: inline-block; will-change: transform; }

/* ——— Cards: layered depth + pointer spotlight border ——— */
.tp-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(8, 38, 54, 0.04), 0 10px 30px rgba(8, 38, 54, 0.06);
}
.tp-card:not(.overflow-auto)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--tp-mx, -400px) var(--tp-my, -400px), rgba(232, 168, 56, 0.75), rgba(26, 107, 154, 0.35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tp-card.is-lit:not(.overflow-auto)::after { opacity: 1; }
.tp-card-title { display: flex; align-items: center; gap: 8px; }
.tp-card-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tp-accent);
  box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.2);
  flex-shrink: 0;
}

/* ——— Stats ——— */
.tp-stat {
  background: linear-gradient(160deg, #ffffff 0%, rgba(246, 250, 253, 0.95) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 26px rgba(8, 38, 54, 0.07);
}
.tp-stat .tp-stat-icon {
  background: linear-gradient(135deg, #1A6B9A, #0B3D5C);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 61, 92, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.tp-stat:nth-child(3n+2) .tp-stat-icon { background: linear-gradient(135deg, #f0b84a, #d48f1c); color: #1a1408; box-shadow: 0 8px 18px rgba(232, 168, 56, 0.3); }
.tp-stat:nth-child(3n) .tp-stat-icon { background: linear-gradient(135deg, #2a8fc4, #1A6B9A); }
.tp-stat strong { font-size: 1.32rem; background: linear-gradient(120deg, #0B3D5C, #1A6B9A); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ——— Tables ——— */
.tp-table tbody tr { position: relative; }
.tp-table tbody tr:hover { background: linear-gradient(90deg, rgba(232, 168, 56, 0.08), rgba(26, 107, 154, 0.04) 40%, transparent); }
.tp-table tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--tp-accent); }

/* ——— Buttons ——— */
.btn-primary { background: linear-gradient(135deg, #f6c560, #e8a838 55%, #d48f1c); box-shadow: 0 8px 20px rgba(232, 168, 56, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.tp-ripple-host { position: relative; overflow: hidden; isolation: isolate; }
.tp-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%);
  z-index: -1;
}
.tp-btn-glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}
.tp-btn-glass:hover, .tp-btn-glass:focus { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px); }

/* ——— Dashboard welcome banner + 3D scene ——— */
.tp-hero-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 22px;
  padding: 18px 22px;
  padding-right: clamp(22px, 26%, 320px);
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(420px 220px at 88% 50%, rgba(26, 107, 154, 0.6), transparent 65%),
    radial-gradient(360px 200px at 0% 0%, rgba(232, 168, 56, 0.2), transparent 60%),
    linear-gradient(120deg, #0c4266 0%, #072232 75%);
  box-shadow: 0 20px 44px rgba(8, 38, 54, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.tp-hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
  mask-image: linear-gradient(90deg, #000, transparent 70%);
}
.tp-hero-banner .tp-page-title { color: #fff; font-size: 1.7rem; }
.tp-hero-banner .tp-page-sub { color: rgba(255, 255, 255, 0.7); }
.tp-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f4c86a;
}
.tp-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 2; }
.tp-hero-scene {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 28%);
  z-index: 1;
  pointer-events: none;
}
.tp-hero-scene .tp-scene-canvas,
.pos-empty-scene .tp-scene-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.tp-hero-scene.is-ready .tp-scene-canvas,
.pos-empty-scene.is-ready .tp-scene-canvas { opacity: 1; }
@media (max-width: 991.98px) {
  .tp-hero-banner { grid-template-columns: 1fr; padding-right: 150px; }
  .tp-hero-scene { width: 160px; }
}
@media (max-width: 575.98px) {
  .tp-hero-banner {
    grid-template-columns: 1fr;
    padding: 14px 16px;
    padding-right: 16px;
    gap: 12px;
  }
  .tp-hero-banner-copy { position: relative; z-index: 2; min-width: 0; }
  .tp-hero-actions {
    grid-column: 1;
    width: 100%;
  }
  .tp-hero-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
  .tp-hero-scene { display: none; }
  .tp-hero-banner .tp-page-title { font-size: 1.25rem; line-height: 1.2; }
  .tp-hero-eyebrow { font-size: 10px; letter-spacing: 0.05em; }
  .tp-hero-banner .tp-page-sub { font-size: 12px; line-height: 1.45; }
}

/* ——— POS polish ——— */
.pos-empty-scene {
  position: relative;
  flex-shrink: 0;
  pointer-events: none;
  height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef3f7 100%);
  transition: opacity 0.35s ease;
}
.pos-bill-panel.is-empty .pos-empty-scene {
  height: 148px;
  visibility: visible;
  opacity: 1;
}
.pos-bill-panel.is-empty .pos-empty { padding-top: 4px; }
@media (max-width: 767.98px), (max-height: 680px) {
  .pos-bill-panel.is-empty .pos-empty-scene {
    height: 0;
    visibility: hidden;
    opacity: 0;
  }
}
.pos-tile { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 18px rgba(8, 38, 54, 0.06); }
.pos-tile:hover { box-shadow: 0 18px 36px rgba(8, 38, 54, 0.14), 0 0 0 1px rgba(232, 168, 56, 0.45); }
.pos-cart-head { position: relative; overflow: hidden; }
.pos-cart-head::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 30%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-18deg);
  animation: tpShine 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .tp-motion .pos-btn-pay:not(:disabled)::after { animation: none; display: none; }
  body.tp-body::before, .pos-cart-head::after { animation: none; }
  .tp-content { transition: none; }
  .pos-brand-mark--custom img,
  .pos-brand-mark--custom::after { animation: none !important; }
}

/* ——— 3D logo reveal (tp-logo.js) ——— */
.tp-logo-3d {
  position: relative;
  aspect-ratio: 1 / 1;
}
.tp-logo-3d .tp-logo-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tp-logo-3d.is-ready .tp-logo-canvas { opacity: 1; }
/* Same box the logo occupies in the 3D scene, so the swap is seamless */
.tp-logo-fallback {
  position: absolute;
  left: 21.1%;
  top: 27.8%;
  width: 57.8%;
  height: auto;
  transition: opacity 0.35s ease;
}
/* Hidden at first so a slow WebGL start doesn't show the full mark and then break it apart */
.tp-logo-3d .tp-logo-fallback { opacity: 0; animation: tpLogoFallback 0.4s ease 2.5s forwards; }
.tp-logo-3d.is-ready .tp-logo-fallback { animation: none; opacity: 0; }
.tp-logo-3d.is-fallback .tp-logo-fallback { animation: none; opacity: 1; }
@keyframes tpLogoFallback { to { opacity: 1; } }
.tp-login-logo-3d {
  --tp-logo-s: min(360px, 78vw);
  width: var(--tp-logo-s);
  margin: calc(var(--tp-logo-s) * -0.2) 0 calc(var(--tp-logo-s) * -0.17) calc(var(--tp-logo-s) * -0.211);
  pointer-events: none;
}

/* POS header: compact 3D TEMPRIO reveal */
.pos-brand-logo-3d {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.28));
}

.pos-brand-logo-3d .tp-logo-fallback {
  animation-delay: 0.85s;
}

.tp-motion .pos-brand-mark--custom img {
  animation: posBrandLogoIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tp-motion .pos-brand-mark--custom::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: posBrandLogoShine 5.5s ease-in-out infinite;
  animation-delay: 1.2s;
  pointer-events: none;
}

@keyframes posBrandLogoIn {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes posBrandLogoShine {
  0%, 76%, 100% { transform: translateX(-130%); }
  88% { transform: translateX(130%); }
}
.tp-splash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  cursor: pointer;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(26, 107, 154, 0.35), transparent 70%),
    radial-gradient(120% 90% at 50% 50%, #0a1c2e 0%, #050b14 70%);
  animation: tpSplashBail 0.6s ease 8s forwards;
}
.tp-splash-logo { width: min(560px, 92vw, 92vh); }
@keyframes tpSplashBail { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .tp-splash { animation-delay: 1.2s; }
}
