/* =========================================================
   style.css — LIGHT THEME (sfondo chiaro, contrasto alto)
   Sostituisci tutto il tuo style.css con questo file.
   Mantiene TUTTE le classi/ID che usi già in index/script.
   ========================================================= */

:root{
  /* Base */
  --bg: #f6f7fb;
  --panel: #ffffff;
  --card: #ffffff;
  --card2:#fbfbff;

  /* Text */
  --text:#111827;          /* quasi nero */
  --sub:#4b5563;           /* grigio scuro */
  --sub2:#6b7280;          /* grigio medio */

  /* Lines / Surfaces */
  --line: rgba(17,24,39,.12);
  --line2: rgba(17,24,39,.18);

  /* Accents */
  --blue:#4f46e5;
  --blue2:#2563eb;
  --green:#16a34a;
  --orange:#f59e0b;
  --red:#ef4444;

  /* Effects */
  --shadow: 0 18px 50px rgba(17,24,39,.10);
  --shadow2: 0 10px 30px rgba(17,24,39,.08);

  --r:20px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:
    radial-gradient(900px 540px at 15% 0%, rgba(79,70,229,.12), transparent 60%),
    radial-gradient(800px 520px at 90% 10%, rgba(37,99,235,.10), transparent 55%),
    radial-gradient(900px 600px at 30% 100%, rgba(22,163,74,.08), transparent 60%),
    var(--bg);
  color: var(--text);
}

/* =========================================================
   Topbar
   ========================================================= */
.topbar{
  position:sticky;
  top:0;
  z-index:9999;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom:1px solid var(--line);
  box-shadow: 0 10px 40px rgba(17,24,39,.08);
  transition: background .3s ease, box-shadow .3s ease;
}

.topbar-inner{
  max-width:1100px;
  margin:0 auto;
  height:60px;
  padding: 0 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Brand */
.brand{
  font-weight:900;
  letter-spacing:-.4px;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:1.1rem;
}

.brand:before{
  content:"";
  width:10px;
  height:10px;
  border-radius:99px;
  background: linear-gradient(135deg,var(--blue),var(--blue2));
  box-shadow:0 0 0 6px rgba(79,70,229,.14);
}

/* Optional brand helpers (se li usi) */
.brand-dot{
  width:10px; height:10px; border-radius:50%;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  box-shadow:0 0 0 6px rgba(79,70,229,.14);
}
.brand-text{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color: var(--text);
}

/* Topbar actions (logout) */
.topbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.logout-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line2);
  background: rgba(17,24,39,.03);
  color: var(--text);
  font-weight:900;
  cursor:pointer;
  transition: background .15s ease, transform .08s ease, border-color .15s ease;
}
.logout-btn:hover{ background: rgba(17,24,39,.05); border-color: rgba(17,24,39,.22); }
.logout-btn:active{ transform: scale(0.98); }
.logout-btn svg{ width:18px; height:18px; vertical-align:middle; }

/* =========================================================
   Layout
   ========================================================= */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}
.authbox{ max-width:540px; margin: 0 auto; }

/* =========================================================
   Cards
   ========================================================= */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.96));
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding:14px;
}

.card.soft{
  box-shadow: var(--shadow2);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.985));
}

.divider{ height:1px; background: var(--line); margin:12px 0; }

.muted{ color: var(--sub); font-size:.92rem; }
.tiny{ font-size:.85rem; color: var(--sub2); }

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

/* =========================================================
   Section headers (Apple-style)
   ========================================================= */
.section-header{
  margin-bottom: 10px;
}
.section-title{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:-.3px;
  color: var(--text);
}
.section-title::before{
  content:"";
  width:6px;
  height:20px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  opacity:.85;
}
.section-subtitle{
  margin-top:4px;
  font-size:.9rem;
  color: var(--sub2);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  border:1px solid var(--line2);
  border-radius:14px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  background: rgba(17,24,39,.03);
  color: var(--text);
  box-shadow:none;
  transition: background .15s ease, transform .08s ease, border-color .15s ease, filter .15s ease;
}

.btn:hover{
  background: rgba(17,24,39,.05);
  border-color: rgba(17,24,39,.24);
}

.btn:active{ transform: scale(0.98); }

.btn.primary{
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color:#fff;
}
.btn.primary:hover{ filter: brightness(1.03); }

.btn.green{
  border-color: transparent;
  background: linear-gradient(135deg, #34d399, var(--green));
  color:#052e1a;
}

.btn.orange{
  border-color: transparent;
  background: linear-gradient(135deg, #fbbf24, var(--orange));
  color:#3b1d00;
}

.btn.red{
  border-color: transparent;
  background: linear-gradient(135deg, #fb7185, var(--red));
  color:#3b0a0a;
}

.btn.ghost{
  background: transparent;
}

.btn.danger{
  background: #ef4444;
  color: #fff;
  border: none;
  font-weight: 1000;
}
.btn.danger:hover{ filter: brightness(1.06); }
.btn.danger:active{ transform: scale(0.98); }

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

/* =========================================================
   Tabs (mobile friendly)
   ========================================================= */
.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding:10px;
  border-radius: 18px;
  background: rgba(255,255,255,.70);
  border:1px solid var(--line);
  box-shadow: var(--shadow2);
}

.tab{
  padding:10px 12px;
  border:1px solid var(--line2);
  background: rgba(17,24,39,.03);
  font-weight:1000;
  cursor:pointer;
  color: var(--text);
  border-radius: 14px;
  transition: background .15s ease, border-color .15s ease;
}
.tab:hover{
  background: rgba(17,24,39,.05);
  border-color: rgba(17,24,39,.25);
}

.tab.active{
  border-color: transparent;
  background: linear-gradient(135deg, rgba(79,70,229,.98), rgba(37,99,235,.98));
  color:#fff;
}

/* =========================================================
   Forms
   ========================================================= */
.field label{
  display:block;
  font-size:.92rem;
  color: var(--sub);
  margin:6px 0;
  font-weight:1000;
}

.field input,.field textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line2);
  outline:none;
  font-size:1rem;
  background: rgba(255,255,255,1);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field input::placeholder, .field textarea::placeholder{
  color: rgba(75,85,99,.70);
}

.field input:focus,.field textarea:focus{
  border-color: rgba(79,70,229,.60);
  box-shadow: 0 0 0 4px rgba(79,70,229,.18);
  background: rgba(255,255,255,1);
}

.field textarea{ resize: vertical; min-height:88px; }

/* =========================================================
   Feedback
   ========================================================= */
.success{
  background: rgba(22,163,74,.10);
  color: #064e2a;
  padding:10px 12px;
  border-radius:14px;
  font-weight:1000;
  border:1px solid rgba(22,163,74,.22);
}

.error{
  background: rgba(239,68,68,.10);
  color: #7f1d1d;
  padding:10px 12px;
  border-radius:14px;
  font-weight:1000;
  border:1px solid rgba(239,68,68,.24);
}

.warn{
  background: rgba(245,158,11,.12);
  color: #7a3e00;
  padding:10px 12px;
  border-radius:14px;
  font-weight:1000;
  border:1px solid rgba(245,158,11,.26);
}

/* =========================================================
   Tables -> mobile stack
   ========================================================= */
.table{ width:100%; border-collapse: collapse; }
.table th,.table td{
  padding:10px 8px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:middle;
  font-size:.98rem;
  color: var(--text);
}
.table thead th{
  color: rgba(17,24,39,.92);
  font-weight:1000;
}
.table tbody td{
  color: rgba(17,24,39,.96);
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(79,70,229,.10);
  color: #1f2a8a;
  font-weight:1000;
  min-width:56px;
  border:1px solid rgba(79,70,229,.20);
}

/* =========================================================
   Responsive
   ========================================================= */
@media(max-width: 720px){
  .container{ padding:12px; padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  .tabs{ gap:8px; }
  .tab{ padding:10px 12px; flex: 1 1 auto; text-align:center; }
  .card{ padding:12px; border-radius: 18px; }

  .table thead{ display:none; }
  .table, .table tbody, .table tr, .table td{ display:block; width:100%; }
  .table tr{
    border:1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.85);
    box-shadow: var(--shadow2);
    padding:12px;
    margin-bottom:12px;
  }
  .table td{
    border:none;
    padding:6px 0;
  }
  .table tr:last-child{ margin-bottom: 24px; }

  .topbar-inner{
    height:54px;
    padding: 0 10px;
  }
  .brand-text{
    font-size:1rem;
    max-width:60vw;
  }
  .logout-btn span{ display:none; }
  .logout-btn{
    padding:8px;
    border-radius:14px;
  }
}

/* =========================================================
   Images
   ========================================================= */
.cardimg{
  width:100%;
  border-radius:18px;
  border:1px solid var(--line);
  background: rgba(17,24,39,.02);
}

/* =========================================================
   QR
   ========================================================= */
#qr-reader{
  width:100%;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#000;
}

/* =========================================================
   Points big
   ========================================================= */
.pointsBig{
  font-size:56px;
  font-weight:1000;
  letter-spacing:-1.2px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  -webkit-background-clip: text;
  background-clip:text;
  color: transparent;
  line-height:1;
  outline:none;
}
.pointsLabel{
  font-weight:1000;
  letter-spacing:-.2px;
  color: var(--sub);
}

.sub-info-italic{
  font-style: italic;
  margin-left: auto;
}

/* Links */
a.link{
  color: #1d4ed8;
  font-weight:1000;
  text-decoration:none;
}
a.link:hover{ text-decoration: underline; }

/* iPhone / mobile: evita “sparizione” contenuti sotto safe-area */
html, body{
  min-height: 100%;
  height: auto;
}

/* =========================================================
   PWA Banner
   ========================================================= */
.pwaBanner{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 9999;
}

.pwaBanner-inner{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(17,24,39,.12);
}

.pwaIcon{
  width:44px;
  height:44px;
  border-radius: 14px;
  background:
    radial-gradient(18px 18px at 30% 25%, rgba(79,70,229,.30), transparent 65%),
    radial-gradient(18px 18px at 80% 30%, rgba(37,99,235,.25), transparent 65%),
    linear-gradient(180deg, rgba(17,24,39,.04), rgba(17,24,39,.02));
  border:1px solid var(--line);
}

.pwaText{ flex:1; min-width: 0; }
.pwaTitle{ font-weight: 1000; letter-spacing:-.3px; color: var(--text); }
.pwaSub{
  color: var(--sub);
  font-size:.9rem;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pwaActions{ display:flex; gap:10px; }

/* =========================================================
   Rewards: cards list (tabella “cardizzata”)
   ========================================================= */
#rewardsTable thead{ display:none; }
#rewardsTable td{ padding:0 !important; border:none !important; }

.rewardRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.rewardLeft{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1 1 auto;
}

.rewardThumb{
  width:72px;
  height:72px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(17,24,39,.02);
  flex:0 0 auto;
}

.rewardThumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.rewardInfo{ min-width:0; }

.rewardTitle{
  font-weight:1000;
  letter-spacing:-.3px;
  font-size:1.05rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color: var(--text);
}

.rewardMeta{
  margin-top:8px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.rewardActions{
  display:flex;
  gap:10px;
  flex:0 0 auto;
}

@media(max-width:720px){
  .rewardRow{
    flex-direction:column;
    align-items:stretch;
  }
  .rewardActions{
    width:100%;
  }
  .rewardActions .btn{
    flex:1 1 0;
    justify-content:center;
  }
}

/* =========================================================
   Rewards print preview modal
   ========================================================= */
#rewardsPrintOverlay{
  position:fixed;
  inset:0;
  z-index:999999;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding:14px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  display:flex;
  align-items:center;
  justify-content:center;
}

#rewardsPrintOverlay[style*="display:none"]{ display:none !important; }

#rewardsPrintOverlay .rp-modal{
  width:min(980px, 100%);
  height:min(86vh, 860px);
  border-radius:22px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 24px 80px rgba(0,0,0,.35);
  background: rgba(255,255,255,.96);
  display:flex;
  flex-direction:column;
}

#rewardsPrintOverlay .rp-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  background: rgba(255,255,255,1);
  border-bottom:1px solid var(--line);
}

#rewardsPrintOverlay .rp-title{
  font-weight:1000;
  letter-spacing:-.3px;
  color: var(--text);
}

#rewardsPrintOverlay .rp-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

#rewardsPrintOverlay .rp-body{
  flex:1 1 auto;
  overflow:auto;
  padding:16px;
  background: rgba(17,24,39,.02);
}

#rewardsPrintOverlay .rp-sheetWrap{
  max-width:860px;
  margin:0 auto;
}

#rewardsPrintOverlay .rp-sheet{
  background:#fff;
  color:#0b1220;
  border-radius:18px;
  padding:22px;
  box-shadow:0 18px 60px rgba(17,24,39,.12);
  border: 1px solid rgba(17,24,39,.08);
}

#rewardsPrintOverlay .rp-h1{
  font-weight:1000;
  letter-spacing:-.4px;
  font-size:22px;
}

#rewardsPrintOverlay .rp-sub{
  color:#374151;
  margin-top:6px;
  font-size:13px;
}

#rewardsPrintOverlay .rp-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}

#rewardsPrintOverlay .rp-item{
  border:1px solid rgba(17,24,39,.12);
  border-radius:14px;
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
  background: rgba(255,255,255,1);
}

#rewardsPrintOverlay .rp-thumb{
  width:54px;
  height:54px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(17,24,39,.12);
  background:rgba(17,24,39,.03);
  flex:0 0 auto;
}

#rewardsPrintOverlay .rp-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

#rewardsPrintOverlay .rp-name{
  font-weight:1000;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#rewardsPrintOverlay .rp-points{
  margin-top:6px;
  font-size:12px;
  color:#374151;
}

@media(max-width:720px){
  #rewardsPrintOverlay .rp-grid{ grid-template-columns: 1fr; }
}

/* =========================================================
   Landing page (pre-login)
   ========================================================= */
.landing{
  max-width: 980px;
  margin: 0 auto 18px auto;
}

.landing-hero{
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:22px;
}

.landing-copy{
  flex:1 1 260px;
  min-width:260px;
}

.landing-hero-ill{
  flex:1 1 260px;
  min-width:260px;
  display:flex;
  justify-content:center;
}

.landing-hero-card{
  border-radius:26px;
  padding:10px;
  background: radial-gradient(120% 140% at 10% 0%, rgba(79,70,229,.18), transparent 55%),
              radial-gradient(120% 140% at 90% 100%, rgba(37,99,235,.16), transparent 55%),
              rgba(15,23,42,.96);
  box-shadow:0 24px 80px rgba(15,23,42,.65);
  border:1px solid rgba(148,163,184,.45);
  max-width:340px;
  width:100%;
}

.landing-hero-img{
  width:100%;
  border-radius:18px;
  display:block;
}

.landing-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  background:linear-gradient(135deg, rgba(79,70,229,.16), rgba(37,99,235,.22));
  border:1px solid rgba(79,70,229,.35);
  color:#111827;
  font-size:.9rem;
  font-weight:900;
  letter-spacing:-.01em;
  box-shadow:0 10px 30px rgba(15,23,42,.10);
  margin-bottom:10px;
}

.landing-title{
  margin:0;
  font-size:2.1rem;
  line-height:1.1;
  letter-spacing:-.06em;
  color:var(--text);
}

.landing-subtitle{
  margin:10px 0 16px 0;
  color:var(--sub);
  font-size:.98rem;
}

.landing-cta-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}

.landing-cta-row .btn{
  padding:12px 18px;
  border-radius:999px;
  font-size:0.98rem;
  font-weight:900;
}

.landing-cta-row .btn.primary{
  box-shadow:0 16px 40px rgba(79,70,229,.35);
}

.landing-cta-row .btn.ghost{
  border-width:2px;
}

@media(max-width: 680px){
  .landing-cta-row{
    flex-direction:column;
  }
  .landing-cta-row .btn{
    width:100%;
    justify-content:center;
  }
}

.landing-hint{
  margin-top:4px;
}

.landing-pricing{
  margin-top:10px;
  color:var(--sub2);
}

.landing-pricing-title{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:999px;
  background:linear-gradient(135deg, rgba(251,191,36,.16), rgba(248,180,0,.40));
  border:1px solid rgba(245,158,11,.65);
  box-shadow:0 8px 24px rgba(245,158,11,.35);
  font-weight:900;
  font-size:1rem;
  color:#78350f;
  letter-spacing:-.02em;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",system-ui,sans-serif;
}

.landing-pricing-title::before{
  content:"★";
  font-size:1.05rem;
}

.landing-pricing-text{
  margin-top:4px;
}

.landing-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
}

.landing-feature{
  background:rgba(255,255,255,.86);
  border-radius:20px;
  border:1px solid var(--line);
  padding:12px;
  box-shadow:var(--shadow2);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.landing-feature-img{
  width:100%;
  border-radius:16px;
  display:block;
}

.landing-feature-title{
  font-weight:900;
  letter-spacing:-.02em;
  font-size:.98rem;
}

.landing-feature-text{
  margin:0;
  font-size:.9rem;
  color:var(--sub2);
}

.landing-feature-mini{
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.landing-feature-mini-title{
  font-weight:900;
  letter-spacing:-.02em;
  margin-bottom:6px;
}

.landing-bullets{
  margin:0;
  padding-left:18px;
  color:var(--sub2);
  font-size:.9rem;
}

.landing-bullets li{ margin-bottom:4px; }

@media(max-width: 880px){
  .landing-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media(max-width: 680px){
  .landing-hero{
    flex-direction:column;
    align-items:flex-start;
  }
  .landing-hero-ill{
    order:-1;
    width:100%;
  }
  .landing-hero-card{
    max-width:100%;
  }
  .landing-title{
    font-size:1.8rem;
  }
  .landing-grid{
    grid-template-columns: minmax(0,1fr);
  }
}
/* Topbar logo */
.brand:before{ content:none !important; }  /* disattiva il pallino vecchio */

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand-logo{
  width:22px;
  height:22px;
  border-radius:6px;
  display:block;
  box-shadow: 0 6px 18px rgba(17,24,39,.12);
}

.brand-text{
  font-weight:900;
  letter-spacing:-.4px;
}
/* iOS PWA: topbar meno alta con notch */
:root{
  --topbar-safe: env(safe-area-inset-top, 0px);
  --topbar-offset: 8px; /* quanto "abbassare" (aumenta se vuoi più bassa) */
}

/* quando è PWA/standalone */
@media (display-mode: standalone) {
  .topbar{
    /* riduci spazio sopra */
    padding-top: max(0px, calc(var(--topbar-safe) - var(--topbar-offset)));
  }
  .topbar-inner{
    height: 52px; /* prima 60 */
  }
}

/* iOS Safari standalone (vecchia proprietà) */
@supports (-webkit-touch-callout: none) {
  body[style], body { } /* no-op: solo per target iOS */

  /* se vuoi essere più aggressivo anche su iOS non-standalone, sposta fuori dal media query */
  @media (display-mode: standalone) {
    .topbar-inner{ height: 52px; }
  }
}
.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line2);
  outline:none;
  font-size:1rem;
  background: rgba(255,255,255,1);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field select:focus{
  border-color: rgba(79,70,229,.60);
  box-shadow: 0 0 0 4px rgba(79,70,229,.18);
}

/* ============================
   Carica / Scarica — layout
   ============================ */

.scan-header{
  margin-bottom: 12px;
}
.scan-title{
  font-weight: 1000;
  font-size: 1.25rem;
  letter-spacing: -.3px;
}
.scan-subtitle{
  margin-top: 4px;
  color: var(--sub2);
  font-size: .9rem;
}

/* Sezioni principali (i 3 blocchi) */
.scan-section{
  background: linear-gradient(180deg, #e5e7f5, #e0e2f5);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
  margin-top: 12px;
}

.scan-delta-input{
  max-width: 88px; /* sufficiente e comodo per 4 cifre */
  font-weight: 900;
  font-size: 1.05rem;
  text-align: center;
  border: 2px solid var(--blue2);
  background: #eef2ff;
  color: var(--text);
}

.scan-delta-input:focus{
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,.35);
  background: #e0e7ff;
}

.scan-section-header{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-bottom:10px;
}

.scan-step-pill{
  width:24px;
  height:24px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.88rem;
  font-weight:900;
  flex-shrink:0;
}

.scan-section-title{
  font-weight:900;
  letter-spacing:-.2px;
}
.scan-section-subtitle{
  font-size:.88rem;
  color: var(--sub2);
  margin-top:2px;
}

/* Sottocard (tessera + premi) */
.scan-subcard{
  background:#fff;
  border-radius:14px;
  border:1px solid var(--line);
  padding:10px;
  margin-top:8px;
}

.scan-subcard-title{
  font-weight:900;
  font-size:.95rem;
  margin-bottom:6px;
}

.scan-card-box,
.scan-rewards-box{
  font-size:.9rem;
}

/* QR box */
.qr-reader-box{
  width:100%;
  border-radius:12px;
  overflow:hidden;
  background:#000; /* fallback quando la camera non è attiva */
}

/* Azioni scanner */
.scan-actions{
  margin-top:10px;
}

/* Riga punti + pulsanti */
.scan-points-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-start;
  margin-top:4px;
}

.scan-points-field{
  flex: 1 1 180px;
  min-width: 180px;
}

.scan-inline-note{
  margin-top:4px;
}

/* Colonna pulsanti + e - */
.scan-buttons-col{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width: 150px;
}

.scan-message-box{
  margin-top:10px;
}

/* Testi di aiuto */
.scan-hint{
  margin-top:6px;
  color: var(--sub2);
}

/* Mobile small fix */
@media (max-width: 480px){
  .scan-section{
    padding:10px;
  }
  .scan-buttons-col{
    width:100%;
    flex-direction:row;
    justify-content:space-between;
  }
  .scan-buttons-col .btn{
    flex:1;
    text-align:center;
  }
}
