/* ═══════════════════════════════════════════════
   Підтвердження особи — scan document page
   ═══════════════════════════════════════════════ */

#dia-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #f5f5f5;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: e-UkraineHead-Regular, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

#dia-scan-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ── Header ── */
.ds-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
  background: #f5f5f5;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ds-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.ds-back svg {
  width: 24px;
  height: 24px;
  stroke: #000;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ds-header-title {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

/* ── Big title ── */
.ds-big-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  padding: 8px 20px 20px;
  margin: 0;
  line-height: 1.2;
}

/* ── Carousel card ── */
.ds-carousel-card {
  background: #fff;
  border-radius: 16px;
  margin: 0 16px 12px;
  padding: 24px 20px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

.ds-slide-title {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  text-align: center;
  margin: 0 0 20px;
}

/* ── Carousel container ── */
.ds-carousel {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.ds-carousel-track {
  display: flex;
  transition: transform 0.35s ease;
  will-change: transform;
}

.ds-slide {
  min-width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Document image ── */
.ds-doc-img-wrap {
  width: 100%;
  max-width: 340px;
  background: #eef3f8;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.ds-doc-img-wrap img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ── MRZ highlight ── */
.ds-mrz-box {
  width: 100%;
  max-width: 340px;
  background: #eef3f8;
  border: 2px dashed #a0b4c8;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.6;
  color: #333;
  letter-spacing: 0.5px;
  text-align: center;
  word-break: break-all;
  margin-bottom: 12px;
}

.ds-mrz-label {
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* ── Dots ── */
.ds-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 4px;
}

.ds-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d0d0;
  transition: background 0.25s;
}

.ds-dot.active {
  background: #333;
}

/* ── Steps card ── */
.ds-steps-card {
  background: #fff;
  border-radius: 16px;
  margin: 12px 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ds-step {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.ds-step:last-child {
  margin-bottom: 0;
}

.ds-step-num {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  min-width: 20px;
  padding-top: 1px;
}

.ds-step-text {
  font-size: 16px;
  color: #000;
  line-height: 1.5;
  margin: 0;
}

/* ── Scan button ── */
.ds-btn-wrap {
  position: sticky;
  bottom: 0;
  padding: 12px 16px 24px;
  background: linear-gradient(transparent, #f5f5f5 30%);
}

.ds-btn {
  display: block;
  width: 100%;
  background: #000;
  color: #fff;
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 18px;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
}

.ds-btn:active {
  opacity: 0.85;
}

/* ── Safe area ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .ds-btn-wrap {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .ds-header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
}
