/* ──────────────────────────────────────────────────────────────
   Screen: Scanner (onglet Scanner du bottom-nav)
   Extrait du mono-fichier index.html (J5b).
   Regroupe :
   - Formulaire de saisie manuelle (scan-form, btn-scan-main, scan-divider, btn-scan, btn-camera)
   - Modale caméra (scanner-modal, scanner-wrap, scanner-video, scanner-frame, scanner-hint, btn-scanner-close)
   - Résultat après scan/recherche (client-card-result, ccr-*, btn-redeem)
   ────────────────────────────────────────────────────────────── */

/* ── Formulaire de saisie manuelle ──────────────────────────── */

.scan-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.scan-form input { min-width: 0; }

.scan-form input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--separator);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 2px;
  outline: none;
  background: #FAFAFA;
  transition: border-color 0.15s;
}

.scan-form input:focus { border-color: var(--blue); background: #fff; }

.btn-scan-main {
  width: 100%;
  padding: 16px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-scan-main:active { opacity: 0.85; transform: scale(0.98); }

.scan-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--secondary);
  font-size: 13px;
}

.scan-divider::before,
.scan-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--separator);
}

.btn-scan {
  padding: 12px 18px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn-scan:disabled { opacity: 0.5; cursor: default; }

.btn-camera {
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--separator);
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-camera:hover { background: var(--separator); }

/* ── Modale caméra plein écran ──────────────────────────────── */

.scanner-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.scanner-modal.hidden { display: none !important; }

.scanner-wrap {
  position: relative;
  width: min(90vw, 360px);
  aspect-ratio: 1;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.scanner-frame {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
}

.scanner-frame::before,
.scanner-frame::after,
.scanner-frame > span::before,
.scanner-frame > span::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #fff;
  border-style: solid;
}

.scanner-frame::before        { top:0;    left:0;  border-width:3px 0 0 3px; border-radius:4px 0 0 0; }
.scanner-frame::after         { top:0;    right:0; border-width:3px 3px 0 0; border-radius:0 4px 0 0; }
.scanner-frame > span::before { bottom:0; left:0;  border-width:0 0 3px 3px; border-radius:0 0 0 4px; }
.scanner-frame > span::after  { bottom:0; right:0; border-width:0 3px 3px 0; border-radius:0 0 4px 0; }

.scanner-hint {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  text-align: center;
}

.btn-scanner-close {
  padding: 12px 32px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Résultat après scan / recherche client ─────────────────── */

.client-card-result {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
}

.ccr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ccr-pts {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.ccr-label {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 500;
}

.ccr-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-redeem {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--green), #30D158);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  text-align: left;
}

.btn-redeem:active   { opacity: 0.85; transform: scale(0.98); }
.btn-redeem:disabled { opacity: 0.4;  cursor: default; transform: none; }
