/* ===== 리셋 & 기본 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #154281;
  --primary-dark: #0f2d5e;
  --primary-light: #eaf0fb;
  --secondary: #127bca;
  --secondary-light: #dceefb;
  --accent: #d91920;
  --danger: #d91920;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --navbar-height: 64px;
  --sidebar-width: 240px;
}

body {
  font-family: 'Noto Sans KR', 'Noto Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 레이아웃 ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.page-wrap { max-width: 480px; margin: 72px auto; padding: 0 16px; }

/* ===== 네비게이션 ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), var(--shadow-sm);
}
.navbar > a.navbar-brand,
.navbar > div:first-child { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.navbar > .navbar-actions { flex: 0 0 auto; }
.navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
}
.navbar-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.navbar-logos img { height: 32px; width: auto; object-fit: contain; }
.navbar-logos img[alt*="과학기술정보통신부"] { height: 39px; }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: inherit;
}
.lang-toggle button.active {
  background: var(--primary);
  color: white;
  border-radius: 18px;
}

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: 0.01em;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #154281, #0f2d5e);
  color: white;
  box-shadow: 0 2px 8px rgba(21,66,129,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0f2d5e, #0a1f40);
  box-shadow: 0 4px 16px rgba(21,66,129,0.4);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
  transform: translateY(-1px);
}
.btn-sm { padding: 6px 14px; font-size: 0.82rem; border-radius: 6px; }
.btn-lg { padding: 14px 36px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== 카드 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* ===== 폼 ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-error { color: var(--danger); font-size: 0.82rem; margin-top: 4px; display: none; }
.form-error.show { display: block; }

/* ===== 라디오 그룹 ===== */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card {
  flex: 1;
  min-width: 140px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.radio-card:hover { border-color: var(--primary); background: var(--primary-light); }
.radio-card input[type="radio"] { display: none; }
.radio-card.selected { border-color: var(--primary); background: var(--primary-light); }
.radio-card-icon { font-size: 1.8rem; margin-bottom: 6px; }
.radio-card-label { font-size: 0.88rem; font-weight: 600; color: var(--text); }

/* ===== 알림 ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  border: 1px solid transparent;
}
.alert.show { display: block; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ===== 배지 ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-developer { background: #dbeafe; color: #1d4ed8; }
.badge-translator { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-accepted { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* ===== 랜딩 페이지 ===== */
.hero {
  background: linear-gradient(135deg, #0a1f40 0%, #154281 55%, #127bca 100%);
  color: white;
  padding: 100px 20px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.hero p {
  font-size: 1.05rem;
  opacity: 0.8;
  margin-bottom: 44px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-buttons .btn-seeker {
  background: white;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero-buttons .btn-seeker:hover {
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  text-decoration: none;
  color: var(--primary);
}
.hero-buttons .btn-company {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 2px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
}
.hero-buttons .btn-company:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
  text-decoration: none;
  color: white;
}

.features { padding: 72px 20px; }
.features h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 40px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* ===== 인증 페이지 ===== */
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}
.auth-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.auth-link { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--text-muted); }

/* ===== 사이드바 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--navbar-height));
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  overflow-y: auto;
  padding: 16px 0;
}
.sidebar-menu { list-style: none; padding: 0 10px; }
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.sidebar-menu li a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.sidebar-menu li a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-menu li a .menu-icon { font-size: 1rem; width: 22px; flex-shrink: 0; }
.main-content { margin-left: var(--sidebar-width); padding: 32px; }

/* ===== 목록 ===== */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar input { flex: 1; }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: inherit;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.list-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c7d7fe; }
.list-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.list-card-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; }

/* ===== 상세 페이지 ===== */
.detail-section { margin-bottom: 24px; }
.detail-section h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.detail-section p { font-size: 0.93rem; color: var(--text); line-height: 1.75; white-space: pre-wrap; }

/* ===== 테이블 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* ===== 빈 상태 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.5; }
.empty-state p { font-size: 0.93rem; margin-bottom: 20px; }

/* ===== 모달 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
body:has(.modal-overlay.open) { overflow: hidden; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 540px;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); }

/* ===== 페이지 헤더 ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-title { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }

/* ===== 통계 카드 (관리자) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-number { font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===== 합격률 바 ===== */
.rate-bar { display: flex; align-items: center; gap: 8px; }
.rate-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rate-fill { height: 100%; background: linear-gradient(90deg, var(--secondary), #059669); border-radius: 3px; transition: width 0.6s ease; }
.rate-text { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; font-weight: 600; min-width: 34px; text-align: right; }

/* ===== 히어로 로고 ===== */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.hero-logos img { height: 48px; width: auto; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.92; }
.hero-logos img[alt*="과학기술정보통신부"] { height: 58px; }
.hero-logos .logo-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.3); }

/* ===== 푸터 ===== */
.footer {
  background: #0a1f40;
  color: rgba(255,255,255,0.6);
  padding: 32px 24px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer-logos {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-logos img { height: 36px; width: auto; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.75; }
.footer-logos img[alt*="과학기술정보통신부"] { height: 44px; }
.footer-logos .logo-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.25); }
.footer-text { font-size: 0.82rem; line-height: 1.7; }
.footer-text strong { color: rgba(255,255,255,0.85); font-weight: 600; }

/* ===== 카드 알림 뱃지 ===== */
.card { position: relative; }
.card-badge {
  position: absolute; top: 10px; right: 10px;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: var(--danger); color: white;
  font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ===== 대시보드 공용 ===== */
.menu-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.menu-cards-4 { grid-template-columns: repeat(4, 1fr); }
.menu-cards .card { padding: 16px 20px; }
.menu-cards .card > div:first-child { font-size: 1.6rem !important; margin-bottom: 4px !important; }
.menu-cards .card p { margin-bottom: 0; }
@media (max-width: 768px) {
  .menu-cards-4 { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-rows { display: flex; flex-direction: column; gap: 8px; }
.dashboard-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dashboard-row:hover { border-color: #c7d7fe; box-shadow: var(--shadow-sm); }
.dashboard-row-primary { font-size: 0.95rem; font-weight: 700; flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.dashboard-row-sub { font-size: 0.82rem; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dashboard-row-end { font-size: 0.82rem; color: var(--text-muted); flex-shrink: 0; text-align: right; }
.dashboard-row-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .navbar-brand { font-size: 0.92rem; }
  .navbar-logos { gap: 8px; margin-right: 10px; padding-right: 10px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 72px 20px 60px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 300px; }
  .auth-card { padding: 28px 20px; }
  .page-wrap { margin: 40px auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
