/* ============================================================
   NessTech POS - UI motion pack (v1.3.8).
   Subtle, professional micro-animations. No bouncy/oversized
   effects. Respects prefers-reduced-motion.
   ============================================================ */

/* ---------- 1. Page fade-in ---------- */
@keyframes pageIn { from { opacity: 0 } to { opacity: 1 } }
body { animation: pageIn .16s ease-out; }

/* ---------- 2. Modal open ---------- */
@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pos-modal.open .pos-modal-box { animation: modalIn .18s ease-out; }

/* ---------- 3. Toast slide-in ---------- */
.pos-toast {
    transition: opacity .22s ease, transform .28s cubic-bezier(.2,.9,.25,1.2) !important;
    transform: translateX(-50%) translateY(28px) !important;
}
.pos-toast.show { transform: translateX(-50%) translateY(0) !important; }

/* ---------- 4. Button loading spinner ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading { position: relative; pointer-events: none; opacity: .85; }
.btn-loading::after {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite; vertical-align: -2px;
}
.btn-loading.btn-outline::after { border-color: rgba(0,0,0,.15); border-top-color: currentColor; }

/* ---------- 5. Error shake ---------- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake .32s ease; }

/* ---------- 6. Cart row flash (item added) ---------- */
@keyframes rowFlash {
    0% { background: #dcfce7; }
    100% { background: transparent; }
}
tr.row-flash td { animation: rowFlash 1s ease-out; }

/* ---------- 7. Scan success edge flash ---------- */
#scan-flash {
    position: fixed; inset: 0; pointer-events: none; z-index: 300; opacity: 0;
    box-shadow: inset 0 0 0 5px rgba(21,128,61,.55);
}
#scan-flash.go { animation: edgeFlash .45s ease-out; }
@keyframes edgeFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- 8. Totals pulse ---------- */
@keyframes pulse { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
.pulse { animation: pulse .3s ease; display: inline-block; }

/* ---------- 9. Skeleton shimmer (POS grid loading) ---------- */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skel-card {
    border: 1px solid var(--pos-border, #dfe5ee); border-radius: 10px; padding: 14px;
    background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%);
    background-size: 800px 100%; animation: shimmer 1.1s linear infinite;
    min-height: 86px;
}

/* ---------- 10. Stat card hover lift (dashboard/reports) ---------- */
.stat { transition: transform .15s ease, box-shadow .15s ease; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
div.stat:hover { transform: translateY(-2px); }

/* ---------- 11. Sidebar link transition ---------- */
.sidebar .nav-link { transition: background .14s ease, color .14s ease, padding-left .14s ease; }

/* ---------- 12. Login screen entrance ---------- */
@keyframes loginUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-form-side > * { animation: loginUp .4s ease-out backwards; }
.login-form-side > *:nth-child(2) { animation-delay: .06s; }
.login-form-side > *:nth-child(3) { animation-delay: .12s; }
.login-form-side > *:nth-child(4) { animation-delay: .18s; }
.login-brand > * { animation: loginUp .5s ease-out backwards; }
.login-brand > *:nth-child(2) { animation-delay: .08s; }
.login-brand > *:nth-child(3) { animation-delay: .16s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- v1.3.9: auto-lock screen ---------- */
#auto-lock{position:fixed;inset:0;z-index:9999;background:rgba(10,16,30,.72);
    backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;
    animation:pageIn .2s ease-out}
.al-box{background:#fff;border-radius:14px;padding:34px 38px;text-align:center;max-width:340px;width:92%;
    box-shadow:0 24px 70px rgba(0,0,0,.4);animation:modalIn .22s ease-out;color:#1e293b}
.al-box svg{color:#1a2b4d;margin-bottom:10px}
.al-box h3{margin:0 0 6px;font-size:1.15rem}
.al-box p{color:#64748b;font-size:.88rem;margin:0 0 16px}
.al-box input{width:100%;padding:11px 13px;border:1px solid #cbd5e1;border-radius:8px;font-size:.95rem;margin-bottom:10px}
.al-box input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.14)}
.al-err{color:#b91c1c;font-size:.84rem;min-height:1.3em;margin-bottom:8px}
.al-box button{width:100%;padding:11px;background:#1a2b4d;color:#fff;border:0;border-radius:8px;
    font-size:.95rem;font-weight:600;cursor:pointer}
.al-box button:hover{background:#243a63}
.al-logout{display:inline-block;margin-top:12px;font-size:.84rem;color:#64748b}
[data-theme="dark"] .al-box{background:#162032;color:#e6ecf5}
[data-theme="dark"] .al-box svg{color:#5b8def}
[data-theme="dark"] .al-box p{color:#9fb0cc}
[data-theme="dark"] .al-box input{background:#0e1526;border-color:#263349;color:#e6ecf5}
[data-theme="dark"] .al-box button{background:#5b8def}

/* ---------- v1.3.9: password strength meter ---------- */
.pw-meter{margin-top:6px}
.pw-bar{height:5px;border-radius:3px;background:#e2e8f0;width:0;transition:width .2s ease}
.pw-bar.weak{background:#b91c1c}.pw-bar.med{background:#b45309}.pw-bar.strong{background:#15803d}
.pw-label{font-size:.75rem;color:var(--muted);margin-top:3px;min-height:1.1em}

/* ---------- v1.5.2: subtle button hover animations ---------- */
.btn{transition:transform .12s ease,box-shadow .12s ease,background-color .15s ease}
.btn:hover{transform:translateY(-1px);box-shadow:0 3px 10px rgba(10,25,60,.14)}
.btn:active{transform:translateY(0) scale(.98)}
.btn-navy:hover{filter:brightness(1.08)}
/* receipt preview */
.receipt-preview{max-width:260px;margin:0 auto;background:#fff;border:1px dashed var(--border);
    padding:14px;font-family:monospace;text-align:center;color:#111}
.receipt-preview[data-fs="small"]{font-size:11px}
.receipt-preview[data-fs="normal"]{font-size:13px}
.receipt-preview[data-fs="large"]{font-size:15px}
.receipt-preview .rp-name{font-weight:700;font-size:1.2em}
.receipt-preview .rp-row{display:flex;justify-content:space-between;text-align:left}
.receipt-preview .rp-total{font-weight:700}
.receipt-preview .rp-line{color:#888;margin:6px 0}
