@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --primary: #635BFF;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99,91,255,.08);
  --text: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #f3f4f6;
  --danger: #dc2626;
  --danger-light: rgba(220,38,38,.08);
  --success: #16a34a;
  --success-light: rgba(22,163,74,.08);
  --warning: #d97706;
  --warning-light: rgba(217,119,6,.08);
  --nav-bg: #1e1b4b;

  /* legacy aliases */
  --primary-color: var(--primary);
  --border-color: var(--border);
}

* { box-sizing: border-box; }

html { height: 100%; }
body {
  margin: 0; padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  letter-spacing: -0.01em;
}
.main-content { flex: 1; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.navbar-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 62px;
}
.navbar-brand {
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em;
  color: #fff; display: flex; align-items: center;
  text-decoration: none !important;
}
.navbar-brand .brand-cn {
  color: #fff;
  font-style: italic;
}
.navbar-brand .brand-dollar {
  color: #a78bfa;
  font-size: 1.35rem;
  font-weight: 700;
  margin-left: 1px;
}
.navbar-menu {
  list-style: none; display: flex; gap: 0.15rem; margin: 0; padding: 0; align-items: center;
}
.navbar-menu a {
  color: #c4b5fd; font-weight: 500; font-size: 0.84rem;
  padding: 0.32rem 0.75rem; border-radius: 6px;
  transition: color .15s, background .15s;
}
.navbar-menu a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.navbar-menu a.active { color: #fff; font-weight: 700; background: rgba(255,255,255,.12); }

/* ── Layout ─────────────────────────────────────────── */
.main-content { padding: 2rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.page-header { margin-bottom: 1.5rem; }
.page-title { margin: 0; font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }
.page-description { margin: 0.3rem 0 0; color: var(--text-secondary); font-size: 0.925rem; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
a.card {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
a.card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(99,91,255,.13);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.card-title { margin: 0; font-size: 1.05rem; font-weight: 600; }

/* ── Grid ────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* ── Utilities ───────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gap-2 { gap: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }

/* ── Table ───────────────────────────────────────────── */
.table-container { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem 1rem; border-top: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
th { color: var(--text-tertiary); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
tr:hover td { background: rgba(0,0,0,.02); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 6px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.825rem; border-radius: 6px; }
.btn-primary,
a.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover,
a.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-outline,
a.btn-outline {
  background: transparent; border-color: var(--border); color: var(--text);
}
.btn-outline:hover,
a.btn-outline:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger,
a.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover,
a.btn-danger:hover { filter: brightness(.93); color: #fff; text-decoration: none; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 700;
  border: 1px solid transparent;
}
.badge-primary { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.badge-success { background: rgba(22,163,74,.10);  color: #15803d; border-color: rgba(22,163,74,.25); }
.badge-warning { background: rgba(217,119,6,.10);  color: #b45309; border-color: rgba(217,119,6,.25); }
.badge-danger  { background: rgba(220,38,38,.10);  color: #b91c1c; border-color: rgba(220,38,38,.25); }

/* ── Stats ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1.25rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.stat-info h3 { margin: 0; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-info p  { margin: 0.25rem 0 0; font-weight: 700; font-size: 1.75rem; letter-spacing: -0.02em; }
.stat-icon { font-size: 1.5rem; }

/* ── Charts ──────────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 1.25rem;
}

/* ── Select / Option fix ── */
select.field-input option { background: #ffffff; color: #111827; }
.chart-title {
  margin: 0 0 0.875rem;
  font-size: 0.875rem; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em;
}

/* ── Toast ───────────────────────────────────────────── */
#toastRoot {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast {
  min-width: 280px; max-width: 380px;
  background: #ffffff; color: #111827;
  padding: 14px 16px; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  animation: slideIn .2s ease;
  border: 1px solid var(--border);
}
.toast small { opacity: .55; font-size: 0.75rem; }
.toast.success { background: #f0fdf4; border-color: rgba(22,163,74,.3); color: #14532d; }
.toast.error   { background: #fef2f2; border-color: rgba(220,38,38,.3); color: #7f1d1d; }
.toast.warn    { background: #fffbeb; border-color: rgba(217,119,6,.3);  color: #78350f; }

/* ── Form Inputs ─────────────────────────────────────── */
.field-input {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 0.9rem;
  background: #ffffff; color: var(--text);
  transition: border-color .15s;
  font-family: inherit;
}
.field-input:focus {
  outline: none;
  border-color: var(--primary);
}
.field-label {
  display: block; margin-bottom: 0.4rem;
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
}

/* ── Misc ────────────────────────────────────────────── */
.section-title {
  font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-tertiary); margin-bottom: 0.75rem;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.region-btn { background:transparent; border-color:var(--border); color:var(--text-secondary); font-weight:500; }
.region-btn:hover { border-color:var(--primary); color:var(--primary); }
.active-region { background:var(--primary) !important; color:#fff !important; border-color:var(--primary) !important; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2, .grid-3, .two-col { grid-template-columns: 1fr; }
  .navbar-container { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .main-content { padding: 1.25rem 0; }
}
@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.3rem; }
  .container { padding: 0 0.85rem; }
  .card { padding: 1.1rem; }
  th, td { padding: 0.65rem 0.75rem; font-size: 0.85rem; }
  .stat-info p { font-size: 1.45rem; }
}


/* ═══════════════════════════════════════════════════════
   쉬운 모드 (easy-mode)
   - 다크 테마 유지 (색 건드리지 않음)
   - 글씨만 크게
   - index 전용 show/hide
   - 손가락 애니메이션
   - 접기/펼치기 버튼
════════════════════════════════════════════════════════ */

/* 기본 글씨 크기 */
body.easy-mode { font-size: 1.25rem; line-height: 2; }

/* 제목 */
body.easy-mode h1 { font-size: 2.4rem !important; }
body.easy-mode h2 { font-size: 1.9rem !important; }
body.easy-mode h3 { font-size: 1.55rem !important; }
body.easy-mode h4 { font-size: 1.3rem !important; }

/* 본문 텍스트 */
body.easy-mode p,
body.easy-mode li,
body.easy-mode td,
body.easy-mode th,
body.easy-mode label { font-size: 1.2rem !important; }
body.easy-mode small  { font-size: 1rem !important; }

/* 네브바는 크기 유지 (너무 커지면 깨짐) */
body.easy-mode .navbar-menu a {
  font-size: 0.9rem !important;
  padding: 0.5rem 0.6rem !important;
}

/* 버튼 */
body.easy-mode .btn {
  font-size: 1.1rem !important;
  padding: 0.8rem 1.5rem !important;
  min-height: 50px;
}
body.easy-mode .btn-sm {
  font-size: 1rem !important;
  padding: 0.6rem 1rem !important;
  min-height: 42px;
}

/* 입력 필드 */
body.easy-mode input,
body.easy-mode select,
body.easy-mode textarea {
  font-size: 1.1rem !important;
  padding: 0.8rem 1rem !important;
  min-height: 50px;
}

/* 카드 패딩 */
body.easy-mode .card { padding: 1.75rem !important; }

/* 테이블 */
body.easy-mode table th,
body.easy-mode table td {
  padding: 0.9rem 1rem !important;
  font-size: 1.05rem !important;
}

/* 배지 */
body.easy-mode .badge {
  font-size: 0.9rem !important;
  padding: 0.35rem 0.8rem !important;
}

/* ── index 전용 show/hide ── */
body.easy-mode #statsStrip   { display: none !important; }
body.easy-mode #heroSection  { display: none !important; }
body.easy-mode #normalMain   { display: none !important; }
#easyMain                    { display: none; }
body.easy-mode #easyMain     { display: block !important; }

/* ── trials 전용 show/hide ── */
body.easy-mode #normalTableView { display: none !important; }
body.easy-mode #easyCardList    { display: block !important; }

/* heroEasy 안 텍스트 — 히어로 bg(#F5F3FF)에 맞는 어두운 색 */
#easyNotLoggedIn p,
#easyLoggedIn p,
#easyWelcome {
  color: #4b5563;
  font-size: 1.35rem !important;
  line-height: 2;
}
#easyNotLoggedIn b,
#easyLoggedIn b { color: #635BFF; }

/* 로그인/회원가입 버튼 크기 */
#easyNotLoggedIn a[href="register.html"],
#easyLoggedIn   a[href="trials.html"] {
  font-size: 1.5rem !important;
}
#easyNotLoggedIn a[href="login.html"] {
  font-size: 1.15rem !important;
}

/* ── 손가락 애니메이션 ── */
@keyframes pointDown {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

/* ── 접기/펼치기 버튼 ── */
.easy-collapse-wrapper  { margin-bottom: 1rem; }
.easy-collapse-btn {
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  margin-bottom: 0.5rem;
  transition: background .15s;
}
.easy-collapse-btn:hover { background: #e9eaeb; }
body.easy-mode .easy-collapse-btn {
  font-size: 1.15rem;
  padding: 1rem 1.4rem;
  min-height: 52px;
}
.easy-collapse-icon { font-size: 1.1rem; margin-right: 0.4rem; }

/* ── trial-detail 쉬운모드 신청버튼 ── */
body.easy-mode #easyApplyArea .btn-primary {
  font-size: 1.35rem !important;
  padding: 1rem 2rem !important;
  width: 100%;
  border-radius: 8px !important;
  min-height: 58px;
}

/* ── easySimpleCard 텍스트 ── */
#easySimpleCard h2 { font-size: 1.9rem !important; }
#easySimpleCard p  { font-size: 1.15rem !important; }
#easySimpleCard #easyTime,
#easySimpleCard #easyComp { font-size: 1.3rem !important; }

/* 쉬운모드 실험 카드 그리드 — 항상 1열 */
body.easy-mode #easyCards {
  grid-template-columns: 1fr !important;
}

/* 쉬운모드 — 중도탈락율/거절율 힌트 텍스트 확대 */
body.easy-mode #dropoutRateHint,
body.easy-mode #rejectRateHint {
  font-size: 1rem !important;
  margin-top: 0.5rem;
  line-height: 1.7;
}

/* 쉬운모드 — 로그인 페이지 버튼 */
body.easy-mode #sendOtpBtn,
body.easy-mode #verifyOtpBtn,
body.easy-mode #completeRegBtn {
  font-size: 1.2rem !important;
  padding: 1rem 1.5rem !important;
  min-height: 56px;
  border-radius: 8px !important;
}

/* 쉬운모드 — OTP 입력 필드 */
body.easy-mode #otpInput {
  font-size: 2rem !important;
  letter-spacing: 0.4em !important;
  text-align: center;
}

/* 쉬운모드 — 통계 카드 더 크게 */
body.easy-mode #statApplied,
body.easy-mode #statCompleted,
body.easy-mode #statWithdrawn {
  font-size: 2.5rem !important;
}

/* 쉬운모드 — 진행률 바 두껍게 */
body.easy-mode #progressBar {
  height: 14px !important;
  border-radius: 999px;
}

/* 쉬운모드 — 프로필 저장 버튼 */
body.easy-mode #profileForm .btn-primary {
  width: 100%;
  font-size: 1.2rem !important;
  padding: 1rem !important;
  min-height: 56px;
  border-radius: 8px !important;
  margin-top: 0.5rem;
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: #1e1b4b;
  border-top: none;
  padding: 1.25rem 0 1rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}
.footer-brand:hover { text-decoration: none; color: #fff; }
.footer-brand span { color: #a78bfa; }
.footer-tagline {
  font-size: 0.78rem;
  color: #7c73b5;
  margin-top: 0.35rem;
}
.footer-links {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.footer-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 0.65rem;
}
.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: #a5a0d4;
  margin-bottom: 0.4rem;
  text-decoration: none;
  font-weight: 400;
  transition: color .15s;
}
.footer-col a:hover { color: #e0d9ff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-copy {
  font-size: 0.75rem;
  color: #8b86bd;
}
.footer-info {
  font-size: 0.72rem;
  color: #8b86bd;
  line-height: 1.7;
}
@media (max-width: 600px) {
  .footer-top { flex-direction: column; gap: 1.5rem; }
  .footer-links { gap: 1.5rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Skeleton loader ─────────────────────────────────── */
@keyframes skeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, #e0e0e0 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
.skeleton-title  { height: 18px; width: 65%; margin-bottom: 12px; }
.skeleton-line   { height: 13px; width: 100%; margin-bottom: 9px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

/* ── Form error state ────────────────────────────────── */
.field-input.error,
.field-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

/* ── Mobile hamburger ────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: #c4b5fd;
  flex-direction: column;
  gap: 5px;
  border-radius: 6px;
  transition: background .15s;
  flex-shrink: 0;
}
.nav-hamburger:hover { background: rgba(255,255,255,.1); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .22s ease, opacity .15s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .navbar-menu {
    display: none !important;
    position: absolute;
    top: 62px; left: 0; right: 0;
    background: #1e1b4b;
    flex-direction: column !important;
    padding: 0.5rem 0.75rem 0.85rem;
    gap: 0.15rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .navbar-menu.open { display: flex !important; }

  body.easy-mode .navbar-menu { display: none !important; }

  .navbar-menu li { width: 100%; }
  .navbar-menu a {
    display: block !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.875rem !important;
    border-radius: 6px;
  }
  /* 드롭다운 메뉴 모바일 인라인 처리 */
  .navbar-menu ul[id$="Menu"] {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: rgba(255,255,255,.06) !important;
    margin: 0.15rem 0 0 0.75rem !important;
    padding: 0.15rem 0 !important;
    display: block !important;
  }
  .navbar-menu button[id$="Btn"] {
    display: block !important;
    width: 100%;
    text-align: left !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.875rem !important;
    border-radius: 6px;
  }
}

