:root {
  --accent-1: #0B5FFF;
  --accent-2: #00C2A8;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --border: #E3E9F2;
  --text-primary: #0F1C2E;
  --text-muted: #5B6B82;
  --text-faint: #9AA7B8;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text-primary);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

/* ------------------------------------------------------------------ */
/* Layout — mobile-first, widens gracefully on tablet/desktop          */
/* ------------------------------------------------------------------ */
.page-wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 90px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

@media (min-width: 860px) {
  .page-wrap { max-width: 760px; padding-bottom: 60px; }
  .pnp-bottom-nav { display: none; }              /* bottom nav is a mobile pattern */
  .pnp-top-nav { display: flex; }                  /* desktop gets a top nav instead */
  body { padding-top: 0; }
}
@media (max-width: 859px) {
  .pnp-top-nav { display: none; }
}

/* ------------------------------------------------------------------ */
/* Header / hero                                                       */
/* ------------------------------------------------------------------ */
.pnp-header {
  background: linear-gradient(135deg, var(--accent-1), #063B9E);
  color: #fff; padding: 28px 20px 34px; border-radius: 0 0 28px 28px;
}
@media (min-width: 860px) { .pnp-header { padding: 40px 40px 46px; border-radius: 0 0 32px 32px; } }
.pnp-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.pnp-brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
}
.pnp-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.pnp-header h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 8px; line-height: 1.25; }
@media (min-width: 860px) { .pnp-header h1 { font-size: 2.1rem; } }
.pnp-header p { margin: 0; opacity: 0.85; font-size: 0.92rem; }

/* Top nav (desktop only) */
.pnp-top-nav {
  display: none; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 18px 24px;
}
.pnp-top-nav-links { display: flex; gap: 6px; }
.pnp-top-nav-link {
  text-decoration: none; color: var(--text-muted); font-weight: 700; font-size: 0.86rem;
  padding: 9px 16px; border-radius: 999px; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pnp-top-nav-link:hover { background: var(--surface); color: var(--text-primary); }
.pnp-top-nav-link.active { background: var(--accent-1); color: #fff; }

/* ------------------------------------------------------------------ */
/* Cards                                                                */
/* ------------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; margin: 16px; box-shadow: 0 4px 18px rgba(15,28,46,0.04);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  animation: pnpFadeUp 0.4s var(--ease) backwards;
}
@media (hover: hover) {
  a.card:hover, .card.hoverable:hover { box-shadow: 0 10px 28px rgba(15,28,46,0.08); transform: translateY(-2px); }
}
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin: 0 0 4px; }
.card-sub { color: var(--text-muted); font-size: 0.84rem; margin: 0 0 14px; }

@keyframes pnpFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .card, .pnp-nav-item, .btn, * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Two/three-column card grids on wider screens */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px; }
@media (min-width: 640px) { .card-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .card-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.card-grid .card { margin: 0; }

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; font-weight: 700; font-size: 0.92rem;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), opacity 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-primary { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-primary); }
.btn-block { width: 100%; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-1) 35%, transparent); transform: translateY(-1px); }
  .btn-outline:hover:not(:disabled) { border-color: var(--accent-1); color: var(--accent-1); }
}

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border);
  font-size: 0.95rem; background: var(--bg); color: var(--text-primary);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-1); background: var(--surface); }

/* Upload dropzone */
.upload-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-md); padding: 26px 16px;
  text-align: center; cursor: pointer; color: var(--text-muted);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.upload-dropzone:hover, .upload-dropzone:focus-visible { border-color: var(--accent-1); background: color-mix(in srgb, var(--accent-1) 4%, transparent); outline: none; }

/* File preview cards (upload.php) */
.file-preview-card {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px;
  animation: pnpFadeUp 0.3s var(--ease) backwards;
}
.file-preview-thumb {
  width: 44px; height: 44px; border-radius: 10px; background: var(--bg);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.file-preview-info { flex: 1; min-width: 0; }
.file-preview-info .machine-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-card button {
  border: none; background: var(--bg); color: var(--text-faint); width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 0.9rem; flex-shrink: 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.file-preview-card button:hover { background: #FEE2E2; color: #DC2626; }

/* ------------------------------------------------------------------ */
/* Status pills                                                         */
/* ------------------------------------------------------------------ */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 4px 10px; border-radius: 999px; }
.status-online  { background: color-mix(in srgb, #16A34A 15%, transparent); color: #16A34A; }
.status-offline { background: color-mix(in srgb, #9AA7B8 20%, transparent); color: #5B6B82; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-online .status-dot { animation: pnpPulse 1.6s ease-in-out infinite; }
@keyframes pnpPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Machine row */
.machine-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  transition: background 0.15s var(--ease);
}
.machine-row:last-child { border-bottom: none; }
a .machine-row:hover, a:hover .machine-row { background: color-mix(in srgb, var(--accent-1) 3%, transparent); border-radius: 10px; }
.machine-name { font-weight: 700; font-size: 0.9rem; }
.machine-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.machine-distance { font-size: 0.78rem; color: var(--text-faint); text-align: right; }

/* ------------------------------------------------------------------ */
/* Dashboard grid                                                       */
/* ------------------------------------------------------------------ */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
@media (min-width: 640px) { .dash-grid { grid-template-columns: repeat(4, 1fr); } }
.dash-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; text-decoration: none; color: var(--text-primary);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
@media (hover: hover) {
  .dash-tile:hover { box-shadow: 0 8px 20px rgba(15,28,46,0.07); transform: translateY(-2px); border-color: var(--accent-1); }
}
.dash-tile-icon { font-size: 1.4rem; margin-bottom: 8px; }
.dash-tile-label { font-weight: 700; font-size: 0.86rem; }

/* Premium badge */
.premium-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #F5A623, #F76B1C); color: #fff; font-weight: 800; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ */
/* Bottom nav (mobile only — hidden on desktop, see breakpoint above)  */
/* ------------------------------------------------------------------ */
.pnp-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
  border-top: 1px solid var(--border); display: flex; max-width: 480px; margin: 0 auto;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.pnp-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--text-faint); font-size: 0.68rem; font-weight: 700; padding: 4px 0; transition: color 0.15s var(--ease); }
.pnp-nav-item.active { color: var(--accent-1); }
.pnp-nav-item:active { transform: scale(0.94); }
.pnp-nav-icon { font-size: 1.25rem; transition: transform 0.15s var(--ease); }
.pnp-nav-item.active .pnp-nav-icon { transform: scale(1.1); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* Premium homepage                                                     */
/* ------------------------------------------------------------------ */
.pnp-glass-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(227,233,242,0.8);
}
.pnp-glass-nav .pnp-top-nav { padding: 14px 24px; }

.pnp-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, #063B9E, var(--accent-1) 55%, var(--accent-2) 130%);
  padding: 52px 20px 64px; border-radius: 0 0 32px 32px;
}
@media (min-width: 860px) { .pnp-hero { padding: 80px 40px 96px; border-radius: 0 0 40px 40px; } }
.pnp-hero-mesh {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.55;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.25), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(0,194,168,0.5), transparent 45%),
    radial-gradient(circle at 75% 85%, rgba(255,255,255,0.15), transparent 40%);
  animation: pnpMeshDrift 14s ease-in-out infinite alternate;
}
@keyframes pnpMeshDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(-2%, 2%) scale(1.08); } }
.pnp-hero-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
@media (min-width: 860px) {
  .pnp-hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
}
.pnp-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255,255,255,0.16);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.pnp-hero h1 { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.15; margin: 0 0 14px; }
@media (min-width: 860px) { .pnp-hero h1 { font-size: 3.2rem; } }
.pnp-hero p.lead { font-size: 1rem; opacity: 0.9; max-width: 480px; margin: 0 0 26px; }
@media (min-width: 860px) { .pnp-hero p.lead { font-size: 1.1rem; } }
.pnp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.pnp-hero-cta .btn-outline { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); color: #fff; }

/* Floating stat chips under the hero CTA */
.pnp-hero-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.pnp-hero-chip {
  display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 700;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  padding: 8px 13px; border-radius: 999px; backdrop-filter: blur(6px);
}

/* Phone mockup showing the app, desktop only */
.pnp-phone-mock {
  display: none; position: relative; margin: 0 auto;
  width: 240px; height: 480px; border-radius: 34px; background: #0F1C2E;
  padding: 10px; box-shadow: 0 30px 60px rgba(6,59,158,0.35);
  animation: pnpPhoneFloat 5s ease-in-out infinite;
}
@media (min-width: 860px) { .pnp-phone-mock { display: block; } }
@keyframes pnpPhoneFloat { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
.pnp-phone-mock-screen { width: 100%; height: 100%; border-radius: 24px; background: var(--bg); overflow: hidden; position: relative; }
.pnp-phone-mock-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 60px; height: 6px; border-radius: 4px; background: rgba(0,0,0,0.4); z-index: 2; }
.pnp-phone-mock-header { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); padding: 26px 16px 20px; color: #fff; }
.pnp-phone-mock-header .t1 { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.pnp-phone-mock-header .t2 { font-size: 0.66rem; opacity: 0.85; margin-top: 3px; }
.pnp-phone-mock-body { padding: 12px; }
.pnp-phone-mock-card { background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 8px; box-shadow: 0 3px 10px rgba(15,28,46,0.06); }
.pnp-phone-mock-bar { height: 7px; border-radius: 4px; background: var(--border); margin-bottom: 6px; }
.pnp-phone-mock-bar.w60 { width: 60%; } .pnp-phone-mock-bar.w80 { width: 80%; } .pnp-phone-mock-bar.w40 { width: 40%; }
.pnp-phone-mock-btn { height: 30px; border-radius: 999px; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); margin-top: 10px; }

/* Numbered glowing steps */
.pnp-step-num {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent-1) 40%, transparent);
  margin-bottom: 12px;
}

/* Sticky mobile CTA bar */
.pnp-mobile-cta-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 45;
  background: var(--surface); border-radius: 999px; box-shadow: 0 12px 32px rgba(15,28,46,0.18);
  padding: 8px; display: flex;
}
.pnp-mobile-cta-bar .btn { flex: 1; }
@media (min-width: 860px) { .pnp-mobile-cta-bar { display: none; } }

.pnp-section-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 4px; }
@media (min-width: 860px) { .pnp-section-title { font-size: 2rem; } }
.pnp-section-sub { color: var(--text-muted); margin: 0 0 24px; }
.scan-frame { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: #000; margin: 16px auto; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame::after {
  content: ''; position: absolute; inset: 12%; border: 2.5px solid var(--accent-2); border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0,0,0,0.35);
  animation: pnpScanPulse 1.8s ease-in-out infinite;
}
@keyframes pnpScanPulse { 0%,100% { border-color: var(--accent-2); } 50% { border-color: #7FF0DE; } }
.scan-hint { text-align: center; color: var(--text-muted); font-size: 0.84rem; padding: 0 24px; }
