/* app/css/42-modals.css — estratto da app.css (2026-07, split senza build). */
/* ========== MODAL ========== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,20,25,0.5); display: none; align-items: flex-end; z-index: 100; }
.modal-backdrop.open { display: flex; }
.sheet { background: var(--surface); border-radius: 24px 24px 0 0; width: 100%; max-width: 480px; margin: 0 auto; max-height: 92%; overflow-y: auto; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); animation: slideUp .25s ease; }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
.sheet-handle { width: 44px; height: 4px; background: var(--line); border-radius: 2px; margin: -6px auto 18px; }
/* Close button (X) in top-right del sheet modal · UX bloccante senza, su mobile non c'e' backdrop tappabile fullscreen. */
.sheet { position: relative; }
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  border: 0;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.sheet-close:active { background: var(--line); }
.sheet-close .i { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.sheet h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sheet .sub-l { font-size: 13px; color: var(--ink-3); margin-top: 4px; margin-bottom: 18px; }
.sheet .machine-block { padding: 14px; background: var(--bg); border-radius: 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet .machine-block .id-circle { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.sheet .machine-block .id-circle .id-letter { position: absolute; bottom: -4px; right: -4px; background: var(--ink); color: #fff; font-weight: 800; font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; }
.sheet .machine-block .nm { font-size: 14px; font-weight: 700; }
.sheet .machine-block .sub-l2 { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.disclaimer-box { padding: 14px; background: #FFF8DB; border: 1px solid #FCE4A0; border-radius: 12px; font-size: 13px; color: #7A5C00; line-height: 1.55; display: flex; gap: 10px; align-items: flex-start; }
.disclaimer-box svg { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.disclaimer-box strong { color: #7A4F00; }

.grace-box { margin-top:10px;padding:12px;background:#ECFDF5;border:1px solid #BBF7D0;border-radius:12px;font-size:12.5px;color:#065F46;line-height:1.45;display:flex;gap:10px;align-items:flex-start; }
.grace-box svg { color: var(--ok); flex-shrink: 0; margin-top: 1px; }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn-confirm { padding: 15px; background: var(--brand); color: #fff; border-radius: 12px; font-size: 15px; font-weight: 800; }
/* CTA disabilitato in modo PERMANENTE (feature gated, es. prenotazione): grigio esplicito.
   NON stilare :disabled globale sui .btn-*: i flussi async (WebAuthn, fetch) disabilitano
   i bottoni per la durata dell'operazione e non devono cambiare aspetto. */
.btn-gated:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }
/* Annulla = neutro leggero (allineato a .btn-secondary del design system), non nero pieno. */
.btn-cancel { padding: 14px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 700; }
.btn-danger { padding: 15px; background: var(--danger); color: #fff; border-radius: 12px; font-size: 15px; font-weight: 800; }

/* Lost card modal */
.lost-info { padding: 14px 16px; background: var(--bg); border-radius: 12px; margin-bottom: 14px; }
.lost-info .row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.lost-info .row + .row { border-top: 1px solid var(--line); }
.lost-info .row .v { font-weight: 800; color: var(--ink); }
.lost-actions { display: flex; gap: 10px; margin-top: 18px; }
.lost-actions a { flex: 1; padding: 14px 12px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 800; }
.lost-actions a:active { transform: scale(0.97); }
.lost-actions .lost-call { background: var(--brand-soft); color: var(--brand); }
.lost-actions .lost-wa { background: var(--brand-soft); color: var(--brand); }

/* Movimento detail · link di aiuto inline (WhatsApp precompilato / chiamata gestore) */
.mov-help-link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mov-help-link:active { opacity: 0.7; }

/* Toast obsolete rule rimossa post-C7 (causava stretch height su iOS Safari per
   cascade con .toast top-positioned riga ~554). Regola attiva unica: top-positioned. */

/* Camera modal */
.camera-modal { position: fixed; inset: 0; background: #0a0a0a; display: none; flex-direction: column; z-index: 150; }
.camera-modal.open { display: flex; }
.camera-modal .cm-header { padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; color: #fff; }
.camera-modal .cm-header button { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,0.15); color: #fff; display: flex; align-items: center; justify-content: center; }
.camera-modal .cm-header .ttl { flex: 1; text-align: center; font-size: 15px; font-weight: 700; }
.camera-modal .viewport { margin: 0 18px; flex: 1; max-height: 380px; background: #1c1c1c; border-radius: 18px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.camera-modal .viewport .card-mock { width: 240px; aspect-ratio: 1.585; background: #fff; border-radius: 10px; position: relative; transform: rotate(-2deg); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.camera-modal .viewport .card-mock .uid { position:absolute;top:8px;right:10px;font-family:ui-monospace,monospace;font-size:11px;font-weight:700;color:var(--ink); }
.camera-modal .viewport .card-mock .lg { position:absolute;top:38%;left:50%;transform:translateX(-50%);font-size:18px;font-weight:800;letter-spacing:-0.04em;color:var(--ink); }
.camera-modal .viewport .ocr-frame { position: absolute; top: 24px; right: 36px; width: 130px; height: 28px; border: 2.5px solid var(--brand); border-radius: 6px; box-shadow: 0 0 30px rgba(140,0,20,0.5); animation: pulseGrow 2s infinite; }
@keyframes pulseGrow { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.camera-modal .viewport .corners > div { position: absolute; width: 24px; height: 24px; }
.camera-modal .viewport .corners .tl { top: 14px; left: 14px; border-top: 3px solid #fff; border-left: 3px solid #fff; border-radius: 6px 0 0 0; }
.camera-modal .viewport .corners .tr { top: 14px; right: 14px; border-top: 3px solid #fff; border-right: 3px solid #fff; border-radius: 0 6px 0 0; }
.camera-modal .viewport .corners .bl { bottom: 14px; left: 14px; border-bottom: 3px solid #fff; border-left: 3px solid #fff; border-radius: 0 0 0 6px; }
.camera-modal .viewport .corners .br { bottom: 14px; right: 14px; border-bottom: 3px solid #fff; border-right: 3px solid #fff; border-radius: 0 0 6px 0; }
.camera-modal .recognized { margin: 14px 18px 0; padding: 14px; background: rgba(22,163,74,0.15); border:1px solid rgba(22,163,74,0.4); border-radius: 12px; color:#fff; display:flex; gap:12px; align-items:center; }
.camera-modal .recognized .ic { width: 42px; height: 42px; background: var(--ok); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.camera-modal .recognized .lbl { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.camera-modal .recognized .code { font-size: 18px; font-weight: 800; letter-spacing: 0.1em; font-family: ui-monospace, monospace; margin-top: 2px; }
.camera-modal .actions { padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.camera-modal .actions button.primary { padding: 16px; background: var(--brand); color: #fff; border-radius: 14px; font-size: 15px; font-weight: 800; }
.camera-modal .actions button.ghost { padding: 12px; background: transparent; color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 600; }

