:root {
  --primary: #00367e;
  --primary-light: #0093d8;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 3px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.client-body {
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

/* ─── 입장 화면 ─── */
.client-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.client-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  box-shadow: 0 8px 40px rgba(0, 54, 126, 0.07);
  text-align: center;
}

.client-logo { margin-bottom: 16px; }
.client-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.client-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }

.client-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 3px;
  margin-bottom: 16px;
  font-size: 13px;
}

.client-form { text-align: left; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-enter {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 8px;
  transition: background 0.2s;
}
.btn-enter:hover { background: #002a63; }
.btn-agree-all {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--bg-white);
  color: var(--success);
  border: 2px solid var(--success);
  border-radius: 3px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
  transition: background 0.2s, color 0.2s;
}
.btn-agree-all:hover { background: var(--success); color: #fff; }

/* ─── 동의 안내 ─── */
.intro-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.intro-content {
  width: 100%;
  max-width: 500px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  box-shadow: 0 8px 40px rgba(0, 54, 126, 0.07);
  text-align: center;
}
.intro-icon { margin-bottom: 16px; }
.intro-title { font-size: 1.3rem; margin-bottom: 10px; }
.intro-desc {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}
.intro-guide {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.intro-guide strong { color: var(--text); font-weight: 700; }

.intro-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
}
.intro-thumb {
  width: 56px;
  height: 56px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.intro-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── 동의 화면 ─── */
.consent-wrap {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.consent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.consent-progress {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}
.consent-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.consent-nav-btn:hover:not(:disabled) { background: #f1f5f9; }
.consent-nav-btn:disabled { opacity: 0.3; cursor: default; }
.consent-name {
  color: var(--text-secondary);
  font-size: 14px;
  margin-left: auto;
}

/* 게이지바 */
.consent-gauge {
  height: 4px;
  background: var(--border);
  width: 100%;
}
.consent-gauge-bar {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease;
  border-radius: 0 3px 3px 0;
}
.consent-gauge-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0 0;
}

.consent-image-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  min-height: 0;
  overflow: hidden;
}
.consent-image {
  max-width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
}
.consent-filename {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
  flex-shrink: 0;
  padding: 0 8px;
}
.consent-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 60px 20px;
}

.consent-buttons {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}
.consent-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 3px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-white);
}
.consent-btn--next {
  border-color: var(--primary);
  color: var(--primary);
}
.consent-btn--next:hover {
  background: #eff6ff;
}
.consent-btn--next .consent-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.consent-btn--disagree {
  border-color: var(--danger);
  color: #991b1b;
}
.consent-btn--disagree:hover {
  background: #fef2f2;
}
.consent-btn--disagree .consent-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

/* ─── 버튼 활성 상태 ─── */
.consent-btn--disagree.consent-btn--active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.consent-btn--disagree.consent-btn--active .consent-btn-icon {
  background: #fff;
  color: var(--danger);
}

/* ─── 이미지 위 상태 배지 ─── */
.consent-image-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.consent-image-wrap .consent-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.consent-status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.consent-status-badge--agree { background: var(--success); }
.consent-status-badge--disagree { background: var(--danger); }

/* ─── 동의 완료 모달 ─── */
.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.consent-modal-content {
  position: relative;
  background: var(--bg-white);
  border-radius: 3px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.consent-modal-icon { margin-bottom: 12px; }
.consent-modal-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.consent-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.consent-modal-buttons {
  display: flex;
  gap: 10px;
}
.consent-modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 3px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.consent-modal-btn--finish {
  background: #f1f5f9;
  color: var(--text);
}
.consent-modal-btn--finish:hover { background: #e2e8f0; }
.consent-modal-btn--continue {
  background: var(--primary);
  color: #fff;
}
.consent-modal-btn--continue:hover { background: #002a63; }

/* ─── 결과 화면 ─── */
.result-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.result-header {
  text-align: center;
  margin-bottom: 24px;
}
.result-check-icon { margin-bottom: 12px; }
.result-header h2 { font-size: 1.3rem; margin-bottom: 8px; }
.result-summary {
  color: var(--text-secondary);
  font-size: 14px;
}
.result-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text);
}
.result-section-title--muted { color: var(--text-muted); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.result-thumb {
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.15s;
}
.result-thumb:hover { transform: scale(1.02); }

.result-thumb--disagreed .result-thumb-img-wrap img {
  opacity: 0.4;
  filter: grayscale(30%);
}

.result-thumb-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f1f5f9;
}
.result-thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.result-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-badge--check { background: var(--success); }
.result-badge--x { background: var(--danger); }

.result-thumb-filename {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.result-footer {
  text-align: center;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn-retry {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-retry:hover { opacity: 0.85; }
.btn-back {
  display: inline-block;
  padding: 12px 28px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-back:hover { background: #f1f5f9; }

/* ─── 풀스크린 뷰어 ─── */
.fullscreen-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
.fullscreen-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fullscreen-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 3px;
}
.fullscreen-filename {
  margin-top: 12px;
  color: #fff;
  font-size: 13px;
  opacity: 0.8;
}
.fullscreen-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}
