/* Clover Earth — QR カメラスキャン オーバーレイ */

/* ── カメラアイコンボタン（入力行に挿入） ── */
.cea-qr-cam-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1a5fa8;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, color 0.15s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.cea-qr-cam-btn:focus-visible {
  outline: 2px solid #1a5fa8;
  outline-offset: 2px;
}

.cea-qr-cam-btn:not(:disabled):active {
  transform: scale(0.94);
  opacity: 0.8;
}

.cea-qr-cam-btn:disabled {
  cursor: not-allowed;
  color: #b0b8c0;
  opacity: 0.45;
}

.cea-qr-cam-icon {
  display: block;
  pointer-events: none;
}

/* ── オーバーレイ背景 ── */
#cea-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

.cea-qr-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* ── ビューファインダー ── */
.cea-qr-viewfinder-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12);
}

.cea-qr-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 四隅の枠（CSS で疑似 QR ファインダー） */
.cea-qr-viewfinder-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cea-qr-viewfinder-frame::before,
.cea-qr-viewfinder-frame::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: #fff;
  border-style: solid;
  opacity: 0.82;
}

.cea-qr-viewfinder-frame::before {
  top: 16px;
  left: 16px;
  border-width: 3px 0 0 3px;
  border-radius: 4px 0 0 0;
}

.cea-qr-viewfinder-frame::after {
  bottom: 16px;
  right: 16px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 4px 0;
}

/* 右上・左下の 2 隅は追加要素で表現 */
#cea-qr-overlay .cea-qr-corner-tr,
#cea-qr-overlay .cea-qr-corner-bl {
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: #fff;
  border-style: solid;
  opacity: 0.82;
  pointer-events: none;
}

#cea-qr-overlay .cea-qr-corner-tr {
  top: 16px;
  right: 16px;
  border-width: 3px 3px 0 0;
  border-radius: 0 4px 0 0;
}

#cea-qr-overlay .cea-qr-corner-bl {
  bottom: 16px;
  left: 16px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 4px;
}

/* ── ステータステキスト ── */
.cea-qr-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: rgba(0,0,0,0.56);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}

/* ── 閉じるボタン ── */
.cea-qr-close-btn {
  background: rgba(255,255,255,0.12);
  border: 0.5px solid rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.cea-qr-close-btn:active {
  background: rgba(255,255,255,0.22);
}
