/* /assets/css/report.css
 * AI 법률 보고서 생성 페이지 스타일
 * review.css UI + sangdam/pdf.php 보고서 스타일 결합
 */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --line: #e7ebf3;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --soft: #f1f5ff;
  --shadow: 0 10px 30px rgba(15,23,42,0.06);
  --radius: 14px;
  --green: #22c55e;
  --red: #ef4444;
}

*,*::before,*::after { box-sizing: border-box; }

html {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====== 헤더 ====== */
.rv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.rv-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rv-logo {
  height: 28px;
  display: block;
}

.rv-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.rv-header-nav {
  display: flex;
  gap: 10px;
}

.rv-nav-link {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: background 0.15s;
}

.rv-nav-link:hover {
  background: var(--soft);
}

/* ====== 메인 ====== */
.rv-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.rv-card {
  width: 100%;
  max-width: 800px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ====== 섹션 공통 ====== */
.rv-section {
  display: none;
  padding: 32px 28px;
}
#secResult.rv-section {
  padding-top: 0;
}

.rv-section.visible {
  display: block;
}

.rv-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.rv-section-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

/* ====== 드래그앤드롭 업로드 영역 ====== */
.rv-dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.rv-dropzone:hover,
.rv-dropzone.drag-over {
  border-color: var(--blue);
  background: var(--soft);
}

.rv-dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--blue);
}

.rv-dropzone-text {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px;
}

.rv-dropzone-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.rv-file-input {
  display: none;
}

/* ====== 파일 목록 (복수 파일) ====== */
.rv-file-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.rv-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rv-file-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.rv-file-detail {
  flex: 1;
  min-width: 0;
}

.rv-file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rv-file-size {
  font-size: 12px;
  color: var(--muted);
}

.rv-file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}

.rv-file-remove:hover {
  color: var(--red);
}

.rv-file-count {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ====== 분석 요청 입력 ====== */
.rv-prompt-label {
  font-size: 14px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.rv-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s;
}

.rv-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.rv-textarea::placeholder {
  color: #94a3b8;
}

/* ====== 제출 버튼 ====== */
.rv-submit-wrap {
  margin-top: 20px;
}

.rv-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.rv-submit:hover {
  background: var(--blue2);
}

.rv-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ====== 결제 정보 박스 ====== */
.rv-pricing-box {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.rv-pricing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.rv-pricing-tag {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ====== 샘플 보고서 CTA ====== */
.rv-sample-cta {
  margin-top: 28px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.rv-sample-cta::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.rv-sample-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.rv-sample-cta-text {
  flex: 1;
  min-width: 0;
}

.rv-sample-cta-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  background: #1d4ed8;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.rv-sample-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.rv-sample-cta-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.rv-sample-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}

.rv-sample-cta-btn:hover {
  background: var(--blue2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.rv-sample-cta-btn:active {
  transform: translateY(0);
}

.rv-sample-cta-btn svg {
  flex-shrink: 0;
}

/* ====== 변호사 신뢰 콘텐츠 ====== */
.rv-trust-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
}

.rv-trust-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  background: var(--soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}

.rv-trust-content {
  flex: 1;
  min-width: 0;
}

.rv-trust-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.rv-trust-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.rv-trust-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.rv-trust-stat {
  text-align: center;
  padding: 18px 12px;
  background: var(--soft);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.rv-trust-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
  line-height: 1;
}

.rv-trust-stat-num span {
  font-size: 16px;
  font-weight: 600;
}

.rv-trust-stat-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  font-weight: 500;
}

.rv-pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
  gap: 16px;
}

.rv-pricing-info {
  flex: 1;
  min-width: 0;
}

.rv-pricing-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.rv-pricing-desc2 {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.rv-pricing-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
  flex-shrink: 0;
}

.rv-pricing-won {
  font-size: 16px;
  font-weight: 600;
}

.rv-pricing-features {
  list-style: none;
  margin: 0;
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.rv-pricing-features li {
  font-size: 13px;
  color: #475569;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}

.rv-pricing-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}

/* ====== 약관 동의 ====== */
.rv-agree-group {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}

.rv-agree-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
}

.rv-agree-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.rv-agree-all-label span {
  font-weight: 600;
}

.rv-agree-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.rv-agree-check a {
  color: var(--blue);
  text-decoration: none;
}

.rv-agree-check a:hover {
  text-decoration: underline;
}

/* ====== 결제 버튼 ====== */
.rv-pay-notice {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 0;
}

/* ====== 토스 결제 위젯 ====== */
.rv-toss-widget { margin: 16px 0; min-height: 50px; }
.rv-order-summary { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; }
.rv-order-summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.rv-order-amount { font-size: 18px; font-weight: 700; color: var(--blue); }
.rv-pay-back { width: 100%; padding: 12px; margin-top: 10px; font-size: 14px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.rv-pay-back:hover { background: var(--soft); color: var(--text); }

/* ====== 처리 중 (프로그레스) ====== */
.rv-progress-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 16px;
}

.rv-progress-time {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px 0;
}

.rv-elapsed-time {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  margin: 0 0 16px 0;
  font-variant-numeric: tabular-nums;
}

.rv-progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.rv-progress-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.rv-progress-mark {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
}

.rv-mark-done {
  color: var(--green);
  font-weight: 700;
}

.rv-mark-pending {
  opacity: 0.4;
}

@keyframes rvSpin {
  to { transform: rotate(360deg); }
}

.rv-spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: text-top;
  animation: rvSpin 1s linear infinite;
}

/* ====== 보고서 본문 (sangdam/pdf.php 스타일) ====== */
#reportContent {
  max-width: 780px;
  margin: 24px auto;
  background: #fff;
  padding: 48px 52px;
  line-height: 1.8;
  font-size: 13px;
  color: #111;
}

/* 표지 */
.cover {
  text-align: center;
  padding: 80px 0 60px;
  border-bottom: 3px solid #1e293b;
  margin-bottom: 40px;
}
.cover-label {
  font-size: 12px; letter-spacing: 4px; color: #64748b;
  text-transform: uppercase; margin-bottom: 24px;
}
.cover-title {
  font-size: 26px; font-weight: 800; color: #0f172a;
  margin: 0 0 12px; line-height: 1.4;
}
.cover-sub {
  font-size: 15px; color: #475569; margin: 0 0 32px;
}
.cover-meta {
  font-size: 12px; color: #94a3b8;
}
.cover-meta span { margin: 0 8px; }

/* 목차 */
.toc {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 24px 28px; margin-bottom: 36px;
}
.toc-head { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 3px; font-size: 12.5px; line-height: 1.6; }

/* 섹션 */
.sec { margin-bottom: 32px; page-break-inside: avoid; }
.sec-title {
  font-size: 16px; font-weight: 700; color: #1e40af;
  padding-bottom: 8px; border-bottom: 2px solid #2563eb;
  margin: 0 0 16px;
}
.sec h3 {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  margin: 20px 0 8px;
}
.sec h3:first-of-type { margin-top: 0; }
.sec p { margin: 0 0 10px; }
.sec ul, .sec ol { margin: 0 0 10px 18px; padding: 0; }
.sec li { margin-bottom: 4px; }
.sec strong { font-weight: 600; }

/* 박스 */
.box-warn {
  background: #fffbeb; border-left: 3px solid #f59e0b;
  padding: 10px 14px; border-radius: 0 4px 4px 0;
  margin: 12px 0; font-size: 12.5px; line-height: 1.7;
}
.box-info {
  background: #eff6ff; border-left: 3px solid #3b82f6;
  padding: 10px 14px; border-radius: 0 4px 4px 0;
  margin: 12px 0; font-size: 12.5px; line-height: 1.7;
}
.box-critical {
  background: #fef2f2; border-left: 3px solid #ef4444;
  padding: 10px 14px; border-radius: 0 4px 4px 0;
  margin: 12px 0; font-size: 12.5px; line-height: 1.7;
}

/* 테이블 */
#reportContent table {
  width: 100%; border-collapse: collapse;
  margin: 10px 0; font-size: 12px;
}
#reportContent th, #reportContent td {
  border: 1px solid #e2e8f0;
  padding: 7px 10px; text-align: left;
  vertical-align: top; line-height: 1.6;
}
#reportContent th { background: #f1f5f9; font-weight: 600; white-space: nowrap; }

/* 면책 */
.disclaimer {
  text-align: center; font-size: 11px; color: #94a3b8;
  padding: 24px 0 0; border-top: 1px solid #e2e8f0; margin-top: 40px;
}

/* ====== 다운로드 바 ====== */
.dl-bar {
  position: sticky; top: 0; z-index: 100;
  background: #1e293b; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; gap: 12px;
  margin: 0 -28px;
}
.dl-bar-title { font-size: 14px; font-weight: 600; }
.dl-bar-actions { display: flex; gap: 8px; align-items: center; }
.dl-btn {
  padding: 8px 20px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; text-decoration: none;
}
.dl-btn-primary { background: #2563eb; color: #fff; }
.dl-btn-primary:hover { background: #1d4ed8; }
.dl-btn-primary:disabled { background: #64748b; cursor: wait; }
.dl-btn-secondary { background: #334155; color: #fff; }
.dl-btn-secondary:hover { background: #475569; }
.dl-progress {
  display: none; align-items: center; gap: 8px;
  font-size: 13px; color: #94a3b8;
}
.dl-progress.show { display: flex; }
@keyframes dlSpin { to { transform: rotate(360deg); } }
.dl-spin {
  width: 16px; height: 16px;
  border: 2px solid #475569; border-top-color: #2563eb;
  border-radius: 50%;
  animation: dlSpin 0.8s linear infinite;
}

/* ====== 에러 ====== */
.rv-error-box {
  text-align: center;
  padding: 48px 24px;
}

.rv-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--red);
}

.rv-error-msg {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ====== 푸터 ====== */
.rv-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.rv-footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rv-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.rv-footer-links a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.rv-footer-links span {
  color: var(--line);
}

.rv-footer-biz {
  margin-bottom: 4px;
  font-size: 11px;
}

.rv-footer-copy {
  font-size: 11px;
}

/* ====== 토스트 ====== */
.rv-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

.rv-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ====== 인쇄 ====== */
@media print {
  .dl-bar { display: none !important; }
  .rv-header, .rv-footer, .rv-result-header { display: none !important; }
  body { background: #fff; }
  .rv-card { border: none; box-shadow: none; }
  #reportContent {
    max-width: none; margin: 0; padding: 20px 24px;
    box-shadow: none;
  }
  .sec { page-break-inside: avoid; }
  p, li, tr, h1, h2, h3, h4, h5, blockquote { page-break-inside: avoid; }
  .box-warn, .box-info, .box-critical { page-break-inside: avoid; }
  .toc, .cover, .disclaimer { page-break-inside: avoid; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; page-break-after: auto; }
}

/* ====== 반응형 ====== */
@media (max-width: 640px) {
  .rv-header {
    padding: 10px 14px;
  }

  .rv-header-title {
    font-size: 14px;
  }

  .rv-nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  .rv-main {
    padding: 16px 10px;
  }

  .rv-section {
    padding: 24px 16px;
  }

  .rv-section-title {
    font-size: 17px;
  }

  .rv-dropzone {
    padding: 32px 16px;
  }

  .rv-textarea {
    min-height: 100px;
  }

  .rv-sample-cta {
    padding: 20px 16px;
  }

  .rv-sample-cta-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .rv-sample-cta-btn {
    justify-content: center;
    padding: 14px 20px;
  }

  .rv-sample-cta-title {
    font-size: 14px;
  }

  .rv-trust-bar {
    padding: 16px;
  }

  .rv-trust-title {
    font-size: 13px;
  }

  .rv-trust-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rv-trust-stat {
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .rv-trust-stat-num {
    font-size: 20px;
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 60px;
  }

  .rv-pricing-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .rv-pricing-amount {
    font-size: 24px;
  }

  .rv-pricing-features {
    grid-template-columns: 1fr;
  }

  .rv-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px 0;
  }

  .rv-result-actions {
    width: 100%;
  }

  .rv-btn-outline {
    flex: 1;
    text-align: center;
  }

  #reportContent {
    padding: 24px 16px;
    margin: 12px;
  }

  .cover {
    padding: 40px 0 30px;
  }

  .cover-title {
    font-size: 20px;
  }

  .dl-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    margin: 0 -16px;
  }

  .dl-bar-actions {
    width: 100%;
    justify-content: center;
  }
}


.rv-header .inner{width: 100%; max-width: 798px; margin:0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}