/* ============================================================
   CAPITAL POS — TERMINALE CRYPTO PER ESERCENTI & P2P
   Stile moderno, luxury dark, mobile-first per smartphone & tablet
   ============================================================ */

:root {
  --pos-bg: #0a0b10;
  --pos-card: #12151f;
  --pos-card-hover: #181d2a;
  --pos-border: rgba(255, 255, 255, 0.08);
  --pos-border-glow: rgba(242, 108, 42, 0.35);
  --pos-gold: #fbbf24;
  --pos-orange: #f26c2a;
  --pos-green: #10b981;
  --pos-purple: #9945ff;
  --pos-blue: #3b82f6;
  --pos-text-1: #f8fafc;
  --pos-text-2: #94a3b8;
  --pos-text-3: #64748b;
  --pos-radius-sm: 8px;
  --pos-radius-md: 14px;
  --pos-radius-lg: 20px;
}

body.pos-body {
  background-color: var(--pos-bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(242, 108, 42, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(153, 69, 255, 0.06) 0%, transparent 40%);
  color: var(--pos-text-1);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── POS HERO & TOP NAVIGATION ───────────────────────────── */
.pos-navbar {
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pos-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.pos-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pos-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.pos-brand-logo {
  height: 38px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.pos-brand-titles {
  display: flex;
  flex-direction: column;
}

.pos-brand-name {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pos-brand-badge {
  background: linear-gradient(135deg, #f26c2a, #f97316);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pos-brand-sub {
  font-size: 0.74rem;
  color: var(--pos-text-2);
  font-weight: 500;
}

.pos-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pos-network-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.pos-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: posPulse 2s infinite ease-in-out;
}

@keyframes posPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pos-btn-settings {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pos-border);
  color: var(--pos-text-1);
  border-radius: var(--pos-radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.pos-btn-settings:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--pos-gold);
  color: var(--pos-gold);
  transform: translateY(-1px);
}

/* ── POS MAIN WRAPPER ────────────────────────────────────── */
.pos-container {
  max-width: 960px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* ── BANNER ESERCENTE ATTIVO ─────────────────────────────── */
.pos-merchant-bar {
  background: linear-gradient(135deg, rgba(242, 108, 42, 0.12), rgba(251, 191, 36, 0.08));
  border: 1px solid rgba(242, 108, 42, 0.28);
  border-radius: var(--pos-radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pos-merchant-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pos-merchant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f26c2a, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(242, 108, 42, 0.35);
}

.pos-merchant-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.pos-merchant-wallet {
  font-size: 0.75rem;
  color: var(--pos-text-2);
  font-family: monospace;
}

.pos-merchant-edit-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: var(--pos-gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: var(--pos-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pos-merchant-edit-btn:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--pos-gold);
}

/* ── MODE TABS ───────────────────────────────────────────── */
.pos-tabs-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-md);
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  gap: 0.35rem;
}

.pos-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--pos-text-2);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--pos-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.pos-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.pos-tab-btn.active {
  background: linear-gradient(135deg, rgba(242, 108, 42, 0.2), rgba(251, 191, 36, 0.25));
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ── POS TERMINAL BOX (CASSA) ────────────────────────────── */
.pos-terminal-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 500px;
  margin: 0 auto;
  gap: 1.25rem;
}

.pos-card-box {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  position: relative;
}

/* Currency Selector Pills */
.pos-currency-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pos-curr-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-sm);
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pos-curr-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.pos-curr-btn.active {
  background: linear-gradient(135deg, rgba(242, 108, 42, 0.2), rgba(251, 191, 36, 0.25));
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.pos-curr-btn.active.sol-active {
  background: rgba(153, 69, 255, 0.18);
  border-color: #a855f7;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}

.pos-curr-btn.active.usdt-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.pos-curr-btn.active.btc-active {
  background: rgba(247, 147, 26, 0.18);
  border-color: #f7931a;
  box-shadow: 0 0 14px rgba(247, 147, 26, 0.25);
}

.pos-curr-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.pos-curr-symbol {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.pos-curr-rate {
  font-size: 0.68rem;
  color: var(--pos-text-3);
  font-weight: 600;
}

/* Terminal Display Area */
.pos-screen-display {
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pos-radius-md);
  padding: 1.25rem 1.5rem;
  text-align: right;
  margin-bottom: 1.15rem;
  position: relative;
  overflow: hidden;
}

.pos-screen-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f26c2a, #fbbf24, #9945ff);
}

.pos-screen-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pos-text-3);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.pos-screen-eur-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0.4rem 0 0.2rem;
}

.pos-screen-eur-currency {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pos-text-2);
}

.pos-screen-eur-amount {
  font-size: 2.75rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pos-screen-crypto-equiv {
  font-size: 1rem;
  font-weight: 800;
  color: #fbbf24;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Quick Add Chips */
.pos-quick-add-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.pos-quick-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pos-border);
  color: var(--pos-text-2);
  border-radius: var(--pos-radius-sm);
  padding: 0.45rem 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.pos-quick-chip:hover {
  background: rgba(242, 108, 42, 0.15);
  border-color: var(--pos-orange);
  color: #fff;
  transform: translateY(-1px);
}

.pos-quick-chip:active {
  transform: scale(0.96);
}

/* Touch Keypad */
.pos-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.pos-keypad-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.pos-key-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-md);
  padding: 1rem 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pos-key-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.pos-key-btn:active {
  background: rgba(242, 108, 42, 0.25);
  border-color: var(--pos-orange);
  transform: scale(0.95);
}

.pos-key-btn.key-clear {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.pos-key-btn.key-clear:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #f87171;
}

.pos-key-btn.key-comma {
  color: #fbbf24;
  font-size: 1.9rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
  line-height: 0.8;
}

.pos-key-btn.key-comma:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: #fbbf24;
  color: #fff;
}

.pos-key-btn.key-backspace {
  color: var(--pos-gold);
}

.pos-key-btn.key-backspace:hover {
  background: rgba(251, 191, 36, 0.14);
}

/* Big Action Button (Incassa) */
.pos-btn-charge {
  width: 100%;
  padding: 1.15rem;
  border-radius: var(--pos-radius-md);
  background: linear-gradient(135deg, #f26c2a 0%, #ea580c 50%, #fbbf24 100%);
  border: none;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 8px 30px rgba(242, 108, 42, 0.45);
  transition: all 0.25s ease;
}

.pos-btn-charge:hover {
  background: linear-gradient(135deg, #ff7a38 0%, #f97316 50%, #fcd34d 100%);
  box-shadow: 0 10px 40px rgba(242, 108, 42, 0.65);
  transform: translateY(-2px);
}

.pos-btn-charge:active {
  transform: translateY(1px);
}

/* ── MODAL: SCHERMATA QR CODE PAGAMENTO ─────────────────── */
.pos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pos-modal-backdrop.active {
  display: flex;
  animation: posFadeIn 0.25s ease both;
}

@keyframes posFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pos-modal-box {
  background: #10121a;
  border: 1px solid var(--pos-border-glow);
  border-radius: var(--pos-radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
  position: relative;
  text-align: center;
  max-height: 92vh;
  overflow-y: auto;
  animation: posPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes posPop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.pos-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pos-border);
  color: var(--pos-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pos-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* QR Container */
.pos-qr-stage {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: var(--pos-radius-md);
  display: inline-block;
  margin: 1rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pos-qr-stage canvas,
.pos-qr-stage img {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  width: 100%;
  height: auto;
}

.pos-qr-amount-hero {
  font-size: 2.25rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.pos-qr-crypto-hero {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fbbf24;
  margin-top: 0.35rem;
}

.pos-qr-merchant-info {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-sm);
  padding: 0.65rem 0.85rem;
  margin: 1rem 0;
  font-size: 0.8rem;
  color: var(--pos-text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-qr-actions-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.pos-btn-phantom {
  background: linear-gradient(135deg, #ab9ff2 0%, #4e44ce 100%);
  color: #fff;
  border: none;
  border-radius: var(--pos-radius-md);
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(78, 68, 206, 0.35);
  transition: all 0.2s ease;
}

.pos-btn-phantom:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(78, 68, 206, 0.55);
}

.pos-btn-simulate {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: var(--pos-radius-md);
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.pos-btn-simulate:hover {
  background: #10b981;
  color: #fff;
}

/* ── SCONTRINO / RICEVUTA DIGITALE ───────────────────────── */
.pos-receipt-box {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--pos-radius-md);
  padding: 1.75rem 1.5rem;
  text-align: left;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  font-family: 'Outfit', sans-serif;
  margin: 1rem 0;
}

.pos-receipt-header {
  text-align: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.pos-receipt-logo {
  height: 38px;
  margin-bottom: 0.4rem;
}

.pos-receipt-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}

.pos-receipt-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.2rem 0 0;
}

.pos-receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.pos-receipt-label {
  color: #64748b;
}

.pos-receipt-val {
  font-weight: 700;
  color: #0f172a;
}

.pos-receipt-total-row {
  border-top: 2px dashed #cbd5e1;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pos-receipt-total-amount {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
}

.pos-receipt-badge-paid {
  display: block;
  text-align: center;
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #047857;
  font-weight: 800;
  padding: 0.5rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── P2P MODE ────────────────────────────────────────────── */
.pos-p2p-wrapper {
  max-width: 500px;
  margin: 0 auto;
}

.pos-p2p-card {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 1.5rem;
}

/* ── HISTORY / LEDGER TABLE ──────────────────────────────── */
.pos-history-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

.pos-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.pos-stat-card {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-md);
  padding: 1rem;
  text-align: center;
}

.pos-stat-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fbbf24;
}

.pos-stat-label {
  font-size: 0.72rem;
  color: var(--pos-text-2);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 0.25rem;
}

.pos-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pos-history-item {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pos-history-item:hover {
  background: var(--pos-card-hover);
}

/* ── PWA INSTALL BANNER ──────────────────────────────────── */
.pos-pwa-banner {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.15), rgba(242, 108, 42, 0.15));
  border: 1px solid rgba(153, 69, 255, 0.35);
  border-radius: var(--pos-radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.pos-pwa-text {
  font-size: 0.82rem;
  color: var(--pos-text-2);
  line-height: 1.4;
}

.pos-pwa-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
  .pos-nav-container {
    padding: 0.6rem 0.85rem;
  }
  .pos-brand-sub {
    display: none;
  }
  .pos-screen-eur-amount {
    font-size: 2.25rem;
  }
  .pos-stats-grid {
    grid-template-columns: 1fr;
  }
}
