/* ============================================================
   IR 투자심사 시스템 — 프로토타입 공통 스타일
   ============================================================ */
:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #dbeafe;
  --navy: #1e3a8a;
  --navy-deep: #172554;
  --bg: #f1f4f9;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.07);
}

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

html, body { height: 100%; }

body {
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--ink); }
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.btn-mini:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- 입력 필드 ---------- */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field-label .required { color: var(--danger); }
.field-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input::placeholder { color: #9ca3af; }
.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field-row { display: flex; gap: 8px; }
.field-row .field-input { flex: 1; min-width: 0; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-msg { font-size: 13px; margin-top: 6px; min-height: 1em; }
.msg-ok { color: var(--success); }
.msg-err { color: var(--danger); }
.field-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-section {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin: 22px 0 14px;
}
select.field-input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%2364748b" stroke-width="2" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
select.field-input:invalid { color: #9ca3af; }
select.field-input option { color: var(--ink); }

/* ---------- 로그인 / 회원가입 ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 40px 36px 32px;
}
.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-deep);
}
.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 26px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}
.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-deep);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.topbar-user strong { color: var(--ink); }

/* ---------- 공통 페이지 레이아웃 ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}
.page-title { font-size: 24px; font-weight: 700; color: var(--navy-deep); }
.page-desc { font-size: 14px; color: var(--muted); margin: 6px 0 28px; }
.profile-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.profile-line:empty { display: none; }
.profile-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 3px 12px;
}
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 대시보드 ---------- */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.event-card {
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.event-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.event-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}
.event-title { font-size: 18px; font-weight: 700; color: var(--navy-deep); }
.event-date {
  display: inline-block;
  margin: 6px 0 8px;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
}
.event-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.event-progress { font-size: 13px; color: var(--muted); }
.event-progress span { display: inline-block; margin-top: 6px; }
.event-card-empty {
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
  min-height: 180px;
}
.event-card-empty:hover { border-color: var(--line); transform: none; box-shadow: none; }

/* ---------- 진행률 ---------- */
.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s;
}
.progress-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 220px;
  font-size: 13px;
  color: var(--muted);
}
.progress-box .progress-track { margin-top: 8px; }

/* ---------- 기업 목록 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.date-chip {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
}
.company-list { display: flex; flex-direction: column; gap: 10px; }
.company-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.company-row:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.company-no {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.company-info { display: flex; flex-direction: column; min-width: 0; }
.company-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.company-item {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-sector {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ---------- 뱃지 ---------- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge-info { background: var(--primary-light); color: var(--navy); }

/* ---------- 심사 화면 (2분할) ---------- */
.eval-body { overflow: hidden; }
.eval-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 58px;
}
.eval-topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.eval-company {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.eval-company strong { font-size: 17px; color: var(--navy-deep); white-space: nowrap; }
.eval-item {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-pill {
  background: var(--primary-light);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}

.split {
  display: flex;
  height: calc(100vh - 59px);
  overflow: hidden;
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}
.pane-pdf { width: 46%; }
.pane-eval { flex: 1; }
.pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.pane-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.pane-tools { display: flex; align-items: center; gap: 6px; }
.score-sum { font-size: 13px; font-weight: 600; color: var(--primary); }

.divider {
  width: 7px;
  cursor: col-resize;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  transition: background 0.15s;
}
.divider:hover { background: var(--primary-light); }
body.dragging { cursor: col-resize; user-select: none; }
body.dragging .pdf-holder { pointer-events: none; }

/* PDF 영역 */
.pdf-holder { flex: 1; min-height: 0; background: #525659; }
.pdf-object { width: 100%; height: 100%; border: 0; display: block; }
.mock-scroll { height: 100%; overflow-y: auto; padding: 18px; background: #525659; }
.mock-note {
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12.5px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.mock-slide {
  background: #fff;
  border-radius: 6px;
  padding: 28px 30px;
  margin: 0 auto 16px;
  max-width: 560px;
  aspect-ratio: 16 / 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.mock-slide h3 { font-size: 26px; color: var(--navy-deep); margin: 14px 0 6px; }
.mock-slide h4 {
  font-size: 16px;
  color: var(--navy);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.mock-slide p { font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.mock-slide small { color: var(--muted); font-size: 12px; }
.mock-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
}
.mock-line {
  height: 11px;
  border-radius: 6px;
  background: #e5e7eb;
  margin-bottom: 10px;
}
.mock-line.w80 { width: 80%; }
.mock-line.w70 { width: 70%; }
.mock-line.w60 { width: 60%; }
.mock-box-row { display: flex; gap: 10px; margin: 14px 0; }
.mock-box {
  flex: 1;
  height: 64px;
  border-radius: 8px;
  background: #eef2f7;
  border: 1px solid #e5e7eb;
}
.mock-chart {
  height: 90px;
  border-radius: 8px;
  margin-top: 14px;
  background: repeating-linear-gradient(90deg, var(--primary-light) 0 36px, #eef2f7 36px 72px);
}

/* 심사 폼 */
.eval-form {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 26px;
  background: #fafbfd;
}
.eval-section {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 22px 0 10px;
}
.eval-section:first-child { margin-top: 0; }
.eval-section small { font-size: 12px; font-weight: 500; color: var(--muted); }
.q-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.q-card.q-missing { border-color: var(--danger); background: #fffafa; }
.q-text { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.q-text em { font-style: normal; font-size: 12px; color: var(--danger); font-weight: 500; }
.q-no {
  display: inline-block;
  background: var(--primary-light);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  padding: 1px 8px;
  margin-right: 8px;
  vertical-align: 1px;
}
.q-card textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  resize: vertical;
  min-height: 72px;
  background: var(--surface);
}
.q-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 5점 척도 / 추천 선택 */
.scale { display: flex; gap: 6px; }
.scale-opt { flex: 1; position: relative; }
.scale-opt input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.scale-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 4px;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
}
.scale-box b { font-size: 15px; font-weight: 700; color: var(--ink); }
.scale-box small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.scale-opt:hover .scale-box { border-color: var(--muted); }
.scale-opt input:checked + .scale-box {
  border-color: var(--primary);
  background: var(--primary-light);
}
.scale-opt input:checked + .scale-box b,
.scale-opt input:checked + .scale-box small { color: var(--navy); }
.scale-opt input:focus-visible + .scale-box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 하단 액션 바 */
.eval-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.status-note { font-size: 12.5px; color: var(--muted); }
.eval-actions-btns { display: flex; gap: 8px; }

/* ---------- 작은 화면 보조 ---------- */
@media (max-width: 760px) {
  .split { flex-direction: column; }
  .pane-pdf { width: 100% !important; height: 45%; }
  .divider { display: none; }
  .company-row { grid-template-columns: 44px 1fr auto; }
  .company-sector { display: none; }
  .eval-item { display: none; }
}
