/* =====================================================================
   KBLIX UI kit (kx) — shared look-and-feel layer for every KBLIX app.
   ONE source, copied byte-for-byte into Cloud, JOT, School and the
   website. Each app sets its own colours by overriding the --kx-*
   tokens in its own stylesheet (loaded after this one); nothing here
   names an app.
   ===================================================================== */

:root {
  --kx-accent: #0077CC;
  --kx-accent-2: #00CCFF;
  --kx-ink: #0A1628;
  --kx-surface: #FFFFFF;
  --kx-text: #334466;
  --kx-border: #DDE4EE;
  --kx-radius: 10px;
  --kx-ease: cubic-bezier(.22, 1, .36, 1);

  /* Thin scrollbars: thumb, hover thumb, track. */
  --kx-scroll-thumb: rgba(0, 119, 204, .42);
  --kx-scroll-thumb-hover: rgba(0, 119, 204, .78);
  --kx-scroll-track: transparent;
}

/* Sideways entrances (fade-left / fade-right) start outside the viewport; they must never create a horizontal scrollbar. */
html, body { overflow-x: clip; }

/* ---------- Scrollbars: thin, coloured, everywhere (page, panels, tables, modals, textareas) ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--kx-scroll-thumb) var(--kx-scroll-track);
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--kx-scroll-track); }
::-webkit-scrollbar-thumb { background: var(--kx-scroll-thumb); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--kx-scroll-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Scroll animation (AOS) safety nets ---------- */
/* No scripts at all: nothing may stay hidden. */
html:not(.kx-js) [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
/* Reduced motion, or the AOS script was blocked: show everything. */
html.kx-aos-off [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
/* AOS failed to start (blocked, errored): reveal after a moment instead of leaving content invisible forever. */
html.kx-js [data-aos]:not(.aos-init) { animation: kx-unhide 0s linear 3s forwards; }
@keyframes kx-unhide { to { opacity: 1; transform: none; } }
/* Cards keep their own hover effect once they have arrived (AOS animates `transform`, hovers use `translate`). */
[data-aos].card, [data-aos].product-card, [data-aos].stat, [data-aos].kx-card {
  transition-property: opacity, transform, translate, box-shadow, border-color, background-color;
}

/* ---------- Preloader: the loading screen (first load, every page change, slow saves) ---------- */
.kx-preloader {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
  background: var(--kx-surface);
  transition: opacity .4s var(--kx-ease), visibility .4s;
}
.kx-preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* Shown again after the page has loaded (a link was followed, a form was sent): up at once, and it stops the page being clicked. */
.kx-preloader.is-showing { animation: none; opacity: 1; visibility: visible; pointer-events: auto; transition-duration: .16s; }
.kx-preloader-mark { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.kx-preloader-mark img, .kx-preloader-mark svg { width: 56px; height: 56px; object-fit: contain; animation: kx-breathe 1.6s ease-in-out infinite; }
.kx-preloader-mark::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--kx-accent); border-right-color: var(--kx-accent-2);
  animation: kx-spin 1s linear infinite;
}
.kx-preloader-label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--kx-text); opacity: .7; margin: 0; }
@keyframes kx-spin { to { transform: rotate(360deg); } }
@keyframes kx-breathe { 0%, 100% { transform: scale(.92); opacity: .85; } 50% { transform: scale(1.04); opacity: 1; } }
/* The core holds the mark and label. Scoped to the content area, the loading screen covers only <main class="kx-scope">: the
   navigation around it (side, top and bottom) stays visible and clickable. The mark stays in view as a long page is scrolled. */
.kx-preloader-core { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.kx-scope { position: relative; }
.kx-preloader.is-scoped { position: absolute; inset: 0; z-index: 40; display: block; }
.kx-preloader.is-scoped .kx-preloader-core { position: sticky; top: 26vh; padding-top: 3rem; }
/* No scripts to ever remove it: never show it. Safety: the first one hides itself even if the script dies. */
html:not(.kx-js) .kx-preloader { display: none; }
.kx-preloader { animation: kx-preloader-failsafe .01s linear 8s forwards; }
@keyframes kx-preloader-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---------- Busy buttons: a spinner while the form travels ---------- */
.kx-busy { position: relative; pointer-events: none; cursor: progress; opacity: .85; }
.kx-busy::after {
  content: ''; display: inline-block; width: 1em; height: 1em; margin-left: .6em; vertical-align: -.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: kx-spin .7s linear infinite;
}

/* ---------- The menu button ----------
   Closed: three bars. Open: a cross. The bars do not just swap: the top and bottom bar swing about the middle like the two
   blades of a pair of scissors (opening to the cross, snapping shut to the bars), while the middle bar is cut away.
   Every KBLIX app uses this same button. */
.kx-scissors {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, color .25s;
}
.kx-scissors:hover { background: rgba(127, 127, 127, .12); }
.kx-scissors:focus-visible { outline: 2px solid var(--kx-accent-2); outline-offset: 2px; }
.kx-scissors svg { width: 28px; height: 28px; overflow: visible; }
.kx-scissors .kx-bar {
  transform-box: view-box; transform-origin: 12px 12px;
  transition: transform .6s cubic-bezier(.34, 1.7, .64, 1), opacity .28s ease, stroke .25s;
}
.kx-scissors[aria-expanded="true"] .kx-bar-top, .kx-scissors.is-open .kx-bar-top { transform: rotate(45deg) translateY(5px); }
.kx-scissors[aria-expanded="true"] .kx-bar-bot, .kx-scissors.is-open .kx-bar-bot { transform: rotate(-45deg) translateY(-5px); }
.kx-scissors[aria-expanded="true"] .kx-bar-mid, .kx-scissors.is-open .kx-bar-mid { transform: scaleX(0); opacity: 0; }
.kx-scissors[aria-expanded="true"], .kx-scissors.is-open { color: var(--kx-accent); }
.kx-scissors:active .kx-bar-top { transform: translateY(1px); }
.kx-scissors:active .kx-bar-bot { transform: translateY(-1px); }
html.kx-nav-locked, html.kx-nav-locked body { overflow: hidden; }

/* ---------- Table rows rise in one after another (tables are not tagged for scroll animation) ---------- */
html.kx-js tbody > tr { animation: kx-row-in .5s var(--kx-ease) both; }
html.kx-js tbody > tr:nth-child(2) { animation-delay: .04s; } html.kx-js tbody > tr:nth-child(3) { animation-delay: .08s; }
html.kx-js tbody > tr:nth-child(4) { animation-delay: .12s; } html.kx-js tbody > tr:nth-child(5) { animation-delay: .16s; }
html.kx-js tbody > tr:nth-child(n+6) { animation-delay: .2s; }
@keyframes kx-row-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts: slide in, slide out, swipe away ---------- */
.kx-toasts {
  position: fixed; top: 1rem; right: 1rem; z-index: 3800;
  display: flex; flex-direction: column; gap: .6rem;
  width: min(380px, calc(100vw - 2rem)); pointer-events: none;
}
.kx-toast {
  --kx-toast-colour: var(--kx-accent);
  position: relative; display: flex; align-items: flex-start; gap: .7rem;
  padding: .85rem 2.4rem .95rem .9rem; border-radius: var(--kx-radius);
  background: var(--kx-surface); color: var(--kx-ink);
  border: 1px solid var(--kx-border); border-left: 4px solid var(--kx-toast-colour);
  box-shadow: 0 14px 34px rgba(10, 22, 40, .16);
  font-size: .92rem; line-height: 1.45;
  pointer-events: auto; touch-action: pan-y; user-select: none; overflow: hidden;
  opacity: 0; transform: translateX(120%);
  transition: transform .5s var(--kx-ease), opacity .4s ease;
}
.kx-toast.is-in { opacity: 1; transform: translateX(0); }
.kx-toast.is-out { opacity: 0; transform: translateX(calc(120% * var(--kx-dir, 1))); transition: transform .38s cubic-bezier(.5, 0, .75, 0), opacity .3s ease; }
.kx-toast.is-dragging { transition: none; cursor: grabbing; }
.kx-toast-success { --kx-toast-colour: #16A34A; }
.kx-toast-error { --kx-toast-colour: #DC2626; }
.kx-toast-warning { --kx-toast-colour: #D97706; }
.kx-toast-info { --kx-toast-colour: var(--kx-accent); }
.kx-toast-icon { color: var(--kx-toast-colour); flex-shrink: 0; display: grid; margin-top: 1px; }
.kx-toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kx-toast-close { position: absolute; top: .45rem; right: .5rem; width: 1.8rem; height: 1.8rem; border: 0; background: transparent; color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; opacity: .5; border-radius: 8px; }
.kx-toast-close:hover { opacity: 1; background: rgba(127, 127, 127, .14); }
.kx-toast-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--kx-toast-colour); transform-origin: left; transform: scaleX(0); opacity: .55; }
.kx-toast.is-timing .kx-toast-timer { animation: kx-timer var(--kx-ms, 5000ms) linear forwards; }
.kx-toast.is-paused .kx-toast-timer { animation-play-state: paused; }
@keyframes kx-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 640px) {
  .kx-toasts { top: .6rem; right: .8rem; left: .8rem; width: auto; }
}

/* ---------- Social sign-in buttons ---------- */
.kx-social { display: flex; flex-direction: column; gap: .65rem; }
.kx-social-btn {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  width: 100%; min-height: 46px; padding: .65rem 1rem;
  border: 1.5px solid var(--kx-border); border-radius: 8px; background: var(--kx-surface);
  color: var(--kx-ink); font: inherit; font-weight: 600; font-size: .94rem; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.kx-social-btn:hover { border-color: var(--kx-accent); box-shadow: 0 6px 16px rgba(10, 22, 40, .08); text-decoration: none; color: var(--kx-ink); }
.kx-social-btn:active { transform: scale(.985); }
.kx-social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- FAQ accordion ---------- */
.kx-faq { display: grid; gap: .9rem; }
.kx-faq-item {
  background: var(--kx-surface); border: 1px solid var(--kx-border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(10, 22, 40, .06);
  transition: box-shadow .25s, border-color .25s;
}
.kx-faq-item[open] { box-shadow: 0 8px 24px rgba(10, 22, 40, .1); border-color: rgba(0, 119, 204, .3); }
.kx-faq-item > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem; font-weight: 600; color: var(--kx-ink);
  transition: background-color .25s, color .25s;
}
.kx-faq-item > summary::-webkit-details-marker { display: none; }
.kx-faq-item > summary::after {
  content: ''; flex-shrink: 0; width: .55rem; height: .55rem; margin-right: .2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px);
  transition: transform .3s var(--kx-ease);
}
.kx-faq-item[open] > summary { background: var(--kx-accent-2); color: var(--kx-ink); }
.kx-faq-item[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.kx-faq-item > summary:focus-visible { outline: 2px solid var(--kx-accent); outline-offset: -2px; }
.kx-faq-body { overflow: hidden; }
.kx-faq-body > div { padding: 1.1rem 1.25rem 1.25rem; color: var(--kx-ink); }
.kx-faq-body p { margin: 0; color: inherit; }

/* ---------- Reduced motion: keep it still ---------- */
@media (prefers-reduced-motion: reduce) {
  .kx-preloader-mark img, .kx-preloader-mark svg, .kx-preloader-mark::before, .kx-busy::after { animation-duration: 2.4s; }
  .kx-scissors .kx-bar, .kx-faq-item > summary::after { transition: none; }
  [data-aos].aos-init, tbody > tr { animation: none; }
  .kx-toast, .kx-toast.is-out { transition: opacity .2s; transform: none; }
}
@media print { .kx-preloader, .kx-toasts { display: none !important; } }

/* ---------- Pane swap: the card around a sliding pane clips what has slid out of it ---------- */
.is-swapping { overflow: hidden; }
