/* =====================================================
   capture.css — Receipt Capture Page
   Expense Tracker v0.5.1
   ===================================================== */

/* ── Step label ── */
.capture-step-label {
  font-size: 11px; font-weight: 800; letter-spacing: .6px;
  color: var(--c-text3); text-transform: uppercase;
  margin-bottom: 10px;
}
.capture-step-label span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 10px; font-weight: 900; margin-right: 6px;
}
/* PC에서 카메라 스텝 라벨 숨김, 갤러리 라벨 표시 */
.step-select { display: none; }

/* ── Type selector — 3-column card grid ── */
.expense-type-tabs {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin-bottom: var(--sp-5);
}
.type-tab {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 6px; border-radius: var(--r-md);
  font-weight: 800; cursor: pointer; text-align: center;
  background: var(--c-surface); border: 2px solid var(--c-border);
  color: var(--c-text2); transition: all var(--t-base);
  box-shadow: var(--shadow-sm);
}
.type-tab:active { transform: scale(.96); }
.tab-emoji { font-size: 30px; line-height: 1; }
.tab-label { font-size: 13px; line-height: 1.2; }
.type-tab.active { border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.type-tab[data-type="법인카드"].active  { background: var(--c-primary); }
.type-tab[data-type="교통비"].active    { background: var(--c-success); }
.type-tab[data-type="직원경비"].active  { background: var(--c-warning); }

/* ── Camera zone (PRIMARY — 모바일) ── */
.capture-zone { margin-bottom: var(--sp-3); }
.capture-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 20px;
  background: var(--c-primary); border: 2px solid var(--c-primary);
  border-radius: var(--r-lg); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base); color: #fff;
}
.capture-btn:active { transform: scale(.98); }
.capture-btn:hover  { filter: brightness(1.1); }
.capture-btn-icon  { font-size: 32px; line-height: 1; }
.capture-btn-text  { text-align: left; }
.capture-btn-title { font-size: 15px; font-weight: 800; display: block; }
.capture-btn-sub   { font-size: 11px; color: rgba(255,255,255,.8); display: block; margin-top: 2px; }

/* ── Camera overlay (전체화면) ── */
.camera-overlay {
  display: none; position: fixed; inset: 0;
  background: #000; z-index: 9000;
  flex-direction: column;
}
.camera-overlay.show { display: flex; }
#cameraVideo { flex: 1; width: 100%; object-fit: cover; }
.camera-controls {
  display: flex; align-items: center; justify-content: space-around;
  padding: 20px 24px 44px; background: rgba(0,0,0,.7);
}
.cam-btn {
  background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.5);
  border-radius: 50%; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.cam-btn:active { background: rgba(255,255,255,.4); }
.cam-close   { width: 48px; height: 48px; font-size: 18px; }
.cam-capture { width: 72px; height: 72px; font-size: 30px; border-width: 4px; }
.cam-flip    { width: 48px; height: 48px; font-size: 20px; }

/* ── Gallery button (차선책) ── */
.gallery-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 16px 20px;
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--r-lg); cursor: pointer;
  margin-bottom: var(--sp-4); box-shadow: var(--shadow-sm);
  transition: all var(--t-base); text-decoration: none; color: var(--c-text);
}
.gallery-btn:active { transform: scale(.98); }
.gallery-btn:hover { border-color: var(--c-primary); background: var(--c-primary-l); }
.gallery-btn-icon  { font-size: 28px; line-height: 1; }
.gallery-btn-text  { text-align: left; }
.gallery-btn-title { font-size: 14px; font-weight: 800; display: block; }
.gallery-btn-sub   { font-size: 11px; color: var(--c-text2); display: block; margin-top: 2px; }

/* ── Guide popup ── */
.guide-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 8000;
  align-items: center; justify-content: center; padding: 24px;
}
.guide-overlay.show { display: flex; animation: fadeIn .2s ease; }
.guide-box {
  background: var(--c-surface); border-radius: 20px;
  padding: 28px 24px; width: 100%; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.guide-title { font-size: 18px; font-weight: 900; text-align: center; margin-bottom: 22px; }
.guide-steps { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.guide-step  { display: flex; align-items: flex-start; gap: 14px; }
.guide-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.guide-step-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.guide-step-desc  { font-size: 12px; color: var(--c-text2); line-height: 1.5; }
.guide-actions { display: flex; gap: 8px; }
.guide-actions .btn { flex: 1; }

/* ── Preview ── */
.preview-wrap { display: none; position: relative; margin-bottom: var(--sp-3); }
.preview-img {
  width: 100%; max-height: 260px; object-fit: contain;
  border-radius: var(--r-lg); background: var(--c-surface2);
  border: 1px solid var(--c-border);
}
.preview-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.preview-close:hover { background: rgba(0,0,0,.75); }

/* ── Loading ── */
.loading-box {
  display: none; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 28px 20px; text-align: center;
  margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm);
}
.loading-box.show { display: block; }
.loading-text { font-size: 13px; color: var(--c-text2); }
.loading-sub  { font-size: 11px; color: var(--c-text3); margin-top: 4px; }

/* ── OCR Form Card ── */
.ocr-card {
  display: none; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm);
}
.ocr-card.show { display: block; animation: fadeIn .2s ease; }
.ocr-head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-4); }
.ocr-head .ocr-icon { font-size: 22px; }
.ocr-head h3 { font-size: 15px; font-weight: 800; }
.ocr-head .ocr-type { margin-left: auto; }

/* ── Dynamic fields (교통비/직원경비 extras) ── */
.field-group-traffic   { display: none; }
.field-group-meal      { display: none; }
.field-group-traffic.show { display: block; }
.field-group-meal.show    { display: block; }

/* ── Save button ── */
#saveBtn { margin-top: 4px; }

/* ══════════════════════════════════════════════
   PC (≥768px): 카메라 숨김, 갤러리 버튼 크기 조정
   ══════════════════════════════════════════════ */
@media (min-width: 768px) {
  .capture-zone { display: none !important; }
  .step-capture { display: none; }
  .step-select  { display: block; }
  .gallery-btn  { padding: 20px 24px; }
  .gallery-btn-icon  { font-size: 32px; }
  .gallery-btn-title { font-size: 15px; }
}
