/* Licence scan status + review card for the public booking form. Styled for the dark
   booking theme (cards rgba(39,39,39,.52), borders #737373, blue #275095 / #AAC1E9,
   green #34d399). */

/* ---- Status line ---- */
.asr-dl-status {
  margin-top: 14px; padding: 11px 15px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; font-weight: 500; border: 1px solid transparent;
}
.asr-dl-status:empty { display: none; }
.asr-dl-status--busy { background: rgba(170, 193, 233, 0.10); border-color: rgba(170, 193, 233, 0.28); color: #c9d8f2; }
.asr-dl-status--ok { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #7ff0c4; }
.asr-dl-status--warn { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); color: #f4cd7a; }

/* ---- Review card ---- */
.asr-dl-review { margin-top: 14px; }
.asr-dl-review:empty { display: none; }
.asr-dl-review--open {
  padding: 16px 18px; border-radius: 14px;
  background: rgba(16, 22, 32, 0.72);
  border: 1px solid #3568b8;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.asr-dl-review__head {
  font-weight: 700; font-size: 14.5px; color: #eaf1fb; margin-bottom: 2px;
}
.asr-dl-review__sub { font-size: 12px; color: #8b9dc3; margin-bottom: 12px; }

.asr-dl-review__row {
  display: grid; grid-template-columns: 108px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13.5px;
}
.asr-dl-review__row:first-of-type { border-top: 0; }
.asr-dl-review__label { color: #8b9dc3; }
.asr-dl-review__value { color: #f2f6fc; font-weight: 600; word-break: break-word; }

.asr-dl-review__src {
  justify-self: end; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 9px; border-radius: 999px;
}
.asr-dl-review__src--barcode { background: rgba(52, 211, 153, 0.16); color: #57e0ad; }
.asr-dl-review__src--ocr { background: rgba(170, 193, 233, 0.16); color: #b6ccf2; }
.asr-dl-review__row--conflict { border-left: 2px solid #fbbf24; padding-left: 10px; margin-left: -12px; }
.asr-dl-review__warn {
  justify-self: end; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: rgba(251, 191, 36, 0.18); color: #f4cd7a;
}

.asr-dl-review__actions { display: flex; gap: 10px; margin-top: 14px; }
.asr-dl-review__btn {
  padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid #4b587045; background: rgba(255, 255, 255, 0.05); color: #dbe6f7;
  transition: background .15s ease, border-color .15s ease;
}
.asr-dl-review__btn:hover { background: rgba(255, 255, 255, 0.1); }
.asr-dl-review__btn--primary {
  background: #275095; border-color: #275095; color: #fff;
}
.asr-dl-review__btn--primary:hover { background: #2f5fb0; border-color: #2f5fb0; }

/* ---- Full-screen scan overlay (shown while the barcode/OCR run) ---- */
.asr-dl-noscroll { overflow: hidden; }

.asr-dl-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 10, 18, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.asr-dl-overlay--show { opacity: 1; visibility: visible; pointer-events: auto; }

.asr-dl-overlay__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; }
.asr-dl-overlay__text { color: #eef4ff; font-size: 16px; font-weight: 600; }
.asr-dl-overlay__sub { color: #8b9dc3; font-size: 12.5px; margin-top: -8px; }

/* Licence-card silhouette with a sweeping scan beam */
.asr-dl-scan__card {
  position: relative; width: 236px; height: 148px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, rgba(39, 80, 149, 0.35), rgba(16, 22, 32, 0.65));
  border: 1px solid rgba(170, 193, 233, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.asr-dl-scan__photo {
  position: absolute; left: 18px; top: 22px; width: 46px; height: 62px; border-radius: 6px;
  background: rgba(170, 193, 233, 0.22);
}
.asr-dl-scan__line { position: absolute; left: 78px; height: 9px; border-radius: 5px; background: rgba(170, 193, 233, 0.22); }
.asr-dl-scan__line--a { top: 26px; width: 118px; }
.asr-dl-scan__line--b { top: 46px; width: 92px; }
.asr-dl-scan__line--c { top: 66px; width: 132px; }
.asr-dl-scan__card::after { /* soft bottom band, like a licence's coloured strip */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  background: linear-gradient(180deg, transparent, rgba(52, 211, 153, 0.10));
}
.asr-dl-scan__beam {
  position: absolute; left: -10%; right: -10%; top: -18%; height: 26px; z-index: 2;
  background: linear-gradient(90deg, transparent, #34d399 35%, #57a9ff 65%, transparent);
  filter: blur(1px);
  box-shadow: 0 0 20px 7px rgba(87, 169, 255, 0.45);
  animation: asr-dl-scan 1.5s ease-in-out infinite;
}
@keyframes asr-dl-scan {
  0%   { top: -18%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .asr-dl-scan__beam { animation: none; top: 45%; opacity: .85; }
  .asr-dl-overlay { transition: none; }
}

/* ---- Native-feeling camera viewfinder ---- */
.asr-cam { position: fixed; inset: 0; z-index: 100000; background: #000; overflow: hidden; }
.asr-cam__video { width: 100%; height: 100%; object-fit: cover; background: #000; }

.asr-cam__top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 14px 14px;
  padding-top: max(14px, env(safe-area-inset-top));
}
.asr-cam__title { color: #fff; font-size: 15px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.asr-cam__icon {
  width: 44px; height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center;
  justify-content: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, 0.42); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.asr-cam__icon svg { width: 22px; height: 22px; }
.asr-cam__icon.is-on { background: #34d399; color: #06231a; }

/* Reticle: dims everything outside a card-shaped window; corner brackets turn green on lock. */
.asr-cam__reticle {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: min(86vw, 440px); aspect-ratio: 1.585 / 1; border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);
}
.asr-cam__reticle i { position: absolute; width: 30px; height: 30px; border: 3px solid #fff; transition: border-color .2s ease; }
.asr-cam__reticle i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 15px; }
.asr-cam__reticle i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 15px; }
.asr-cam__reticle i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 15px; }
.asr-cam__reticle i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 15px; }
/* Scan-zone highlight: a green glow around the reticle that intensifies with progress. */
.asr-cam__reticle::after {
  content: ''; position: absolute; inset: -2px; border-radius: 18px;
  border: 3px solid #34d399; opacity: var(--p, 0);
  box-shadow: 0 0 calc(12px + var(--p, 0) * 26px) rgba(52, 211, 153, 0.6);
  pointer-events: none; transition: opacity .1s linear;
}
/* Locking: corners snap green + grow, and the whole zone pulses — clearly "capturing". */
.asr-cam__reticle.is-locking { animation: asr-cam-pulse 0.9s ease-in-out infinite; }
.asr-cam__reticle.is-locking i {
  border-color: #34d399; width: 42px; height: 42px;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}
.asr-cam__reticle.is-locked i { border-color: #34d399; width: 48px; height: 48px; }
.asr-cam__reticle.is-locked::after { opacity: 1; }
@keyframes asr-cam-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { .asr-cam__reticle.is-locking { animation: none; } }

.asr-cam__bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  align-items: center; gap: 13px; padding: 0 20px 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}
.asr-cam__hint { color: #fff; font-size: 15px; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.asr-cam__hint b { color: #7ff0c4; font-weight: 700; }
.asr-cam__shutter {
  width: 66px; height: 66px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 3px solid rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}
.asr-cam__shutter:active { transform: scale(0.93); }
.asr-cam__sec { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, 0.82); font-size: 12px; }
.asr-cam__sec svg { width: 13px; height: 13px; flex: 0 0 auto; }

.asr-cam__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.asr-cam__flash.is-on { animation: asr-cam-flash .24s ease; }
@keyframes asr-cam-flash { 0% { opacity: 0; } 28% { opacity: .85; } 100% { opacity: 0; } }

/* Confirm step: hidden until reviewing, then it freezes the still + shows Retake / Use. */
.asr-cam__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; z-index: 2; display: none; }
.asr-cam__top, .asr-cam__bottom, .asr-cam__flash { z-index: 3; }
.asr-cam.is-reviewing .asr-cam__preview { display: block; }
.asr-cam.is-reviewing .asr-cam__reticle,
.asr-cam.is-reviewing .asr-cam__shutter { display: none; }
.asr-cam__review { display: none; gap: 12px; width: 100%; max-width: 420px; }
.asr-cam.is-reviewing .asr-cam__review { display: flex; }
.asr-cam__rbtn {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 16px; border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.45); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.asr-cam__rbtn svg { width: 18px; height: 18px; }
.asr-cam__rbtn--use { background: #34d399; border-color: #34d399; color: #06231a; }

/* Form-level rescan (appears after a camera scan). */
.asr-dl-rescan {
  display: inline-flex; align-self: center; margin-top: 2px; padding: 8px 14px;
  border: 0; background: none; color: #AAC1E9; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.asr-dl-rescan:hover { color: #d3e1f7; }
