/* ==========================================================================
   Installing the app: install bar, help sheet, /app page, AdminCP QR card.
   Behaviour: includes/assets/js/core/nc-install.js
   ========================================================================== */

/* --------------------------------------------------------------- the bar */
.nc-install-bar {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1080;
  width: min(560px, calc(100% - 24px));
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.nc-install-bar.is-active { display: block; animation: nc-install-in .3s ease forwards; }
@keyframes nc-install-in { to { opacity: 1; transform: translate(-50%, 0); } }

.nc-install-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--nc-line, #e4e8ee);
  border-radius: 18px;
  background: var(--nc-surface, #fff);
  color: var(--nc-ink, #10161f);
  box-shadow: 0 10px 30px rgba(16, 22, 31, .18);
}
.nc-install-bar__logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 11px; object-fit: cover; }
.nc-install-bar__text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.nc-install-bar__text strong { display: block; font-size: .95rem; font-weight: 700; }
.nc-install-bar__text span { display: block; font-size: .8rem; color: var(--nc-ink-soft, #5a6675); }
.nc-install-bar__btn { flex: 0 0 auto; white-space: nowrap; font-weight: 600; padding: 8px 16px; }
.nc-install-bar__close {
  flex: 0 0 32px; width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--nc-ink-faint, #667180);
}
.nc-install-bar__close:hover { background: var(--nc-surface-sunk, #f5f7fa); }

/* phones: sit just above the floating nav, never on it */
@media (max-width: 767.98px) {
  .nc-install-bar { bottom: calc(var(--nc-nav-h, 64px) + 22px + env(safe-area-inset-bottom, 0px)); }
  .nc-install-bar__text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 360px) {
  .nc-install-bar__text span { display: none; }
}
/* while it is up, the cookie notice and the support bot step above it */
body.nc-has-install-bar .nc-cookie-consent,
body.nc-has-install-bar .cc-window { margin-bottom: 78px; }

body.night-mode .nc-install-bar__inner { background: #171d25; border-color: #2a323d; color: #eef2f7; }
body.night-mode .nc-install-bar__text span { color: #a8b3c1; }

/* ----------------------------------------------------- steps (shared) */
.nc-inst-steps__title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }
.nc-inst-steps__note { margin: 0 0 12px; color: var(--nc-ink-soft, #5a6675); font-size: .9rem; }
.nc-inst-steps__list { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: ncstep; }
.nc-inst-steps__list li {
  position: relative;
  counter-increment: ncstep;
  padding: 8px 0 8px 40px;
  min-height: 40px;
  line-height: 1.45;
}
.nc-inst-steps__list li::before {
  content: counter(ncstep);
  position: absolute; left: 0; top: 6px;
  width: 28px; height: 28px; line-height: 28px;
  border-radius: 50%;
  background: var(--nc-blue-soft, #eceffd); color: var(--nc-blue-ink, #3a4cb8);
  font-weight: 700; font-size: .85rem; text-align: center;
}
.nc-inst-glyph { display: inline-block; vertical-align: -3px; color: var(--nc-blue-strong, #4a5fd0); }
.nc-inst-steps__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.nc-inst-steps__qr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; font-size: .85rem; color: var(--nc-ink-soft, #5a6675); }
.nc-inst-steps__qr canvas { border-radius: 10px; border: 1px solid var(--nc-line, #e4e8ee); }

/* ------------------------------------------------------------ help sheet */
.nc-inst-sheet { position: fixed; inset: 0; z-index: 1100; display: none; }
.nc-inst-sheet.is-open { display: block; }
.nc-inst-sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 12, 18, .55); }
.nc-inst-sheet__panel {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  max-height: 88vh; overflow-y: auto;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--nc-surface, #fff); color: var(--nc-ink, #10161f);
  box-shadow: 0 -8px 40px rgba(8, 12, 18, .28);
}
@media (min-width: 768px) {
  .nc-inst-sheet__panel { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 22px; }
}
.nc-inst-sheet__x {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--nc-surface-sunk, #f5f7fa); color: var(--nc-ink-soft, #5a6675);
}
.nc-inst-sheet .nc-inst-steps__title { padding-right: 40px; }
body.night-mode .nc-inst-sheet__panel { background: #171d25; color: #eef2f7; }

/* --------------------------------------------------------------- /app page */
.nc-app-page { max-width: 980px; margin: 24px auto 40px; padding: 0 16px; }
.nc-app-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 28px 22px;
  border-radius: 24px;
  background: linear-gradient(160deg, #0b2a5b 0%, #16408a 100%);
  color: #fff;
}
.nc-app-hero__icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.nc-app-hero h1 { margin: 16px 0 8px; font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; color: #fff; line-height: 1.15; }
.nc-app-hero__lead { margin: 0 0 18px; font-size: 1.02rem; color: rgba(255, 255, 255, .85); }
.nc-app-hero__perks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.nc-app-hero__perks li { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .85rem; }
.nc-app-hero__perks i { margin-right: 6px; color: #8fd3ff; }
.nc-app-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 360px;
  padding: 15px 24px;
  border: 0; border-radius: 999px;
  background: #fff; color: #0b2a5b;
  font-size: 1.1rem; font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}
.nc-app-cta:hover { color: #0b2a5b; transform: translateY(-1px); }
.nc-app-cta.is-ready { animation: nc-app-pulse 1.8s ease-in-out infinite; }
@keyframes nc-app-pulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, .25), 0 0 0 0 rgba(255, 255, 255, .55); }
  50% { box-shadow: 0 8px 22px rgba(0, 0, 0, .25), 0 0 0 12px rgba(255, 255, 255, 0); }
}
.nc-app-cta[hidden] { display: none; }
.nc-app-status { margin: 12px 0 0; font-size: .9rem; color: rgba(255, 255, 255, .8); min-height: 1.3em; }

.nc-app-card {
  padding: 22px 20px;
  border-radius: 20px;
  background: #fff; color: #10161f;
}
.nc-app-card .nc-inst-steps__title { color: #10161f; }
.nc-app-qr { text-align: center; }
.nc-app-qr__code canvas { width: 200px; height: 200px; border-radius: 12px; border: 1px solid #e4e8ee; }
.nc-app-qr p { margin: 10px 0 12px; color: #5a6675; font-size: .9rem; }
.nc-app-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

@media (min-width: 900px) {
  .nc-app-hero { grid-template-columns: 1.3fr 1fr; align-items: center; padding: 40px; }
}

/* ------------------------------------------------------- AdminCP QR card */
.nc-admin-qr { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.nc-admin-qr__code canvas { width: 180px; height: 180px; border: 1px solid #e4e8ee; border-radius: 10px; }
.nc-admin-qr__side { flex: 1 1 260px; min-width: 0; }
.nc-app-card .nc-inst-steps { transition: box-shadow .3s ease; border-radius: 14px; }
.nc-app-card .nc-inst-steps.is-flash { box-shadow: 0 0 0 4px rgba(74, 95, 208, .35); }
.nc-app-card .nc-inst-steps:not(:empty) { margin-bottom: 18px; }

/* own buttons: the landing page has no Bootstrap */
.nc-inst-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--nc-line, #e4e8ee); border-radius: 999px;
  background: var(--nc-surface-sunk, #f5f7fa); color: var(--nc-ink, #10161f);
  font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none;
}
.nc-inst-btn:hover { filter: brightness(.97); color: inherit; }
.nc-inst-btn--primary { border-color: transparent; background: var(--nc-blue-strong, #4a5fd0); color: #fff; }
.nc-inst-btn--primary:hover { color: #fff; }
.nc-app-card .nc-inst-btn { background: #f5f7fa; color: #10161f; border-color: #e4e8ee; }
.nc-app-card .nc-inst-btn--primary { background: #4a5fd0; color: #fff; border-color: transparent; }
