/* =====================================================
 * NEXA 22" 설문 키오스크 데모 — 공통 스타일
 * 키오스크/대시보드: 1920×1080 고정 스테이지 + 자동 스케일
 * ===================================================== */
:root {
  --bg: #0b1220;
  --bg2: #0e1729;
  --panel: #141f36;
  --panel2: #1a2845;
  --line: rgba(148, 180, 255, .14);
  --text: #eaf1fb;
  --muted: #8fa3c4;
  --accent: #22d3ee;
  --accent-deep: #0891b2;
  --violet: #818cf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(2, 8, 20, .55);
}

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

html, body { height: 100%; }

body {
  font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 고정 스테이지 (1920×1080) ---------- */
body.kiosk-body {
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 15% -10%, rgba(34, 211, 238, .12), transparent 60%),
    radial-gradient(900px 600px at 90% 110%, rgba(129, 140, 248, .12), transparent 60%),
    var(--bg);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.stage {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  display: flex;
  flex-direction: column;
}

/* ---------- 키오스크 공통 헤더/푸터 ---------- */
.k-top {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .5px;
}
.brand .logo {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #06121f;
}
.brand small { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.k-top .badge {
  font-size: 20px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(20, 31, 54, .6);
}
.k-bottom {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: 19px;
}

/* ---------- 대기(어트랙트) 화면 ---------- */
.attract {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 34px;
  cursor: pointer;
}
.attract .big-icon { font-size: 130px; animation: float 3.2s ease-in-out infinite; }
.attract .hero-img {
  width: 360px; height: 360px;
  object-fit: cover;
  border-radius: 48px;
  border: 1px solid rgba(148, 180, 255, .18);
  box-shadow: 0 30px 80px rgba(2, 8, 20, .6), 0 0 90px rgba(34, 211, 238, .12);
  animation: float 3.2s ease-in-out infinite;
}
.attract h1 { font-size: 84px; font-weight: 900; line-height: 1.2; }
.attract h1 .hl {
  background: linear-gradient(90deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.attract p { font-size: 30px; color: var(--muted); }
.tap-hint {
  margin-top: 26px;
  font-size: 32px;
  font-weight: 800;
  color: #06121f;
  background: linear-gradient(90deg, var(--accent), #67e8f9);
  padding: 26px 74px;
  border-radius: 999px;
  box-shadow: 0 18px 46px rgba(34, 211, 238, .35);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* ---------- 설문 화면 (키오스크 1) ---------- */
.survey { flex: 1; display: flex; flex-direction: column; padding: 0 120px; }
.progress-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 40px;
}
.progress-label { font-size: 26px; font-weight: 800; color: var(--accent); min-width: 110px; }
.progress-track {
  flex: 1; height: 14px; border-radius: 999px;
  background: rgba(148, 180, 255, .15);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}
.q-title { font-size: 58px; font-weight: 900; line-height: 1.3; margin-bottom: 56px; min-height: 150px; }
.q-title .qno { color: var(--accent); margin-right: 18px; }

.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.opt-btn {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 140px;
  padding: 30px 40px;
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .15s;
  font-family: inherit;
}
.opt-btn .oi {
  width: 74px; height: 74px; flex: none;
  display: grid; place-items: center;
  font-size: 38px;
  border-radius: 20px;
  background: rgba(34, 211, 238, .12);
}
.opt-btn:active { transform: scale(.97); }
.opt-btn.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(129, 140, 248, .14));
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .18), 0 16px 42px rgba(34, 211, 238, .18);
}
.opt-btn.selected .oi { background: var(--accent); color: #06121f; }

.nav-row {
  margin-top: auto;
  padding: 46px 0 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-btn {
  font-size: 30px;
  font-weight: 800;
  padding: 26px 66px;
  border-radius: 999px;
  border: 3px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: opacity .15s, transform .12s;
  font-family: inherit;
}
.nav-btn:active { transform: scale(.96); }
.nav-btn.primary {
  border: none;
  color: #06121f;
  background: linear-gradient(90deg, var(--accent), #67e8f9);
  box-shadow: 0 14px 38px rgba(34, 211, 238, .3);
}
.nav-btn:disabled { opacity: .28; pointer-events: none; }

/* ---------- 완료 화면 ---------- */
.done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
}
.done .check {
  width: 170px; height: 170px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 92px;
  background: rgba(52, 211, 153, .14);
  border: 4px solid var(--ok);
  animation: pop .5s cubic-bezier(.22, 1.4, .36, 1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done h2 { font-size: 66px; font-weight: 900; }
.done p { font-size: 30px; color: var(--muted); line-height: 1.6; }
.done .countdown { font-size: 24px; color: var(--accent); font-weight: 700; }

/* ---------- 키오스크 2 : 특장점 탭 ---------- */
.k2-layout {
  flex: 1;
  display: flex;
  gap: 44px;
  padding: 0 64px 30px;
}
.k2-left {
  flex: 1.25;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
}
.tab-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 17, 32, .5);
}
.tab-btn {
  padding: 24px 6px 20px;
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  background: none;
  border: none;
  border-bottom: 5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s, background .15s;
}
.tab-btn .ti { display: block; font-size: 34px; margin-bottom: 8px; }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: rgba(34, 211, 238, .07);
}
.tab-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 56px 64px;
  gap: 48px;
}
.tab-body .tb-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.tab-body .tb-img {
  width: 340px; height: 340px;
  flex: none;
  object-fit: cover;
  border-radius: 40px;
  border: 1px solid rgba(148, 180, 255, .18);
  box-shadow: 0 24px 60px rgba(2, 8, 20, .55);
}
.tab-body .f-icon {
  width: 130px; height: 130px;
  display: grid; place-items: center;
  font-size: 68px;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .2), rgba(129, 140, 248, .18));
}
.tab-body h3 { font-size: 52px; font-weight: 900; }
.tab-body p { font-size: 27px; line-height: 1.75; color: #c3d2ea; }
.tab-nav { display: flex; gap: 14px; margin-top: 12px; }
.tab-nav .dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(148, 180, 255, .25);
}
.tab-nav .dot.on { background: var(--accent); width: 44px; border-radius: 999px; }

.k2-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.vote-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 44px 46px;
}
.vote-card h3 { font-size: 36px; font-weight: 900; line-height: 1.4; margin-bottom: 30px; }
.vote-list { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.vote-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  background: var(--panel2);
  border: 2.5px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, border-color .15s, background .15s;
}
.vote-btn:active { transform: scale(.97); }
.vote-btn .vi { font-size: 30px; }
.vote-btn.mine {
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(34, 211, 238, .2), rgba(129, 140, 248, .12));
}

/* 결과 바 */
.result-list { display: flex; flex-direction: column; gap: 20px; flex: 1; justify-content: center; }
.result-item { display: flex; flex-direction: column; gap: 10px; }
.result-head { display: flex; justify-content: space-between; font-size: 23px; font-weight: 700; }
.result-head .pct { color: var(--accent); font-weight: 900; }
.result-head .cnt { color: var(--muted); font-weight: 600; font-size: 20px; margin-left: 12px; }
.result-track {
  height: 26px;
  border-radius: 999px;
  background: rgba(148, 180, 255, .12);
  overflow: hidden;
}
.result-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.result-item.mine .result-fill { background: linear-gradient(90deg, #6d28d9, var(--violet)); }
.result-item.mine .result-head .name::after {
  content: ' ✓ 내 선택';
  color: var(--violet);
  font-size: 19px;
}
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ok);
}
.live-chip::before {
  content: '';
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok);
  animation: blink 1.1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- 대시보드 ---------- */
.dash { flex: 1; display: flex; flex-direction: column; padding: 0 56px 34px; gap: 26px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px 36px;
}
.kpi .k-label { font-size: 21px; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.kpi .k-value { font-size: 58px; font-weight: 900; letter-spacing: -1px; }
.kpi .k-value small { font-size: 24px; color: var(--muted); font-weight: 700; }
.kpi.hero { background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(129, 140, 248, .12)); border-color: rgba(34, 211, 238, .35); }
.dash-grid { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; min-height: 0; }
.dash-col { display: flex; flex-direction: column; gap: 24px; min-height: 0; }
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 34px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.chart-card h4 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.chart-card .sub { font-size: 17px; color: var(--muted); margin-bottom: 18px; }
.mini-bars { display: flex; flex-direction: column; gap: 13px; flex: 1; justify-content: center; }
.mini-bar-item { display: flex; align-items: center; gap: 14px; }
.mini-bar-item .lb { width: 190px; font-size: 18px; font-weight: 600; color: #c3d2ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar-item .tk { flex: 1; height: 20px; border-radius: 999px; background: rgba(148, 180, 255, .1); overflow: hidden; }
.mini-bar-item .fl { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .8s cubic-bezier(.22,1,.36,1); }
.mini-bar-item.alt .fl { background: linear-gradient(90deg, #6d28d9, var(--violet)); }
.mini-bar-item .vl { width: 120px; font-size: 18px; font-weight: 800; text-align: right; }
.mini-bar-item .vl small { color: var(--muted); font-weight: 600; }

/* ---------- 일반 페이지 (런처/관리자) ---------- */
.page {
  min-height: 100vh;
  background:
    radial-gradient(1000px 620px at 12% -8%, rgba(34, 211, 238, .1), transparent 60%),
    radial-gradient(820px 540px at 95% 105%, rgba(129, 140, 248, .1), transparent 60%),
    var(--bg);
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 48px 28px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 38px; }
.page-head h1 { font-size: 34px; font-weight: 900; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 16px; line-height: 1.6; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.link-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px;
  transition: transform .16s ease, border-color .16s, box-shadow .16s;
}
.link-card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, .5);
  box-shadow: var(--shadow);
}
.link-card .ic {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(129, 140, 248, .16));
  margin-bottom: 20px;
}
.link-card h3 { font-size: 21px; font-weight: 800; margin-bottom: 10px; }
.link-card p { font-size: 15px; color: var(--muted); line-height: 1.65; }
.link-card .tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(34, 211, 238, .1);
  border: 1px solid rgba(34, 211, 238, .25);
  padding: 5px 12px;
  border-radius: 999px;
}

.note {
  margin-top: 40px;
  background: rgba(251, 191, 36, .07);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 16px;
  padding: 22px 26px;
  font-size: 14.5px;
  color: #e6d9b8;
  line-height: 1.8;
}
.note b { color: var(--warn); }

/* 버튼 (관리자) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, border-color .15s;
}
.btn:hover { border-color: rgba(34, 211, 238, .5); }
.btn:active { transform: scale(.97); }
.btn.primary {
  border: none;
  color: #06121f;
  background: linear-gradient(90deg, var(--accent), #67e8f9);
}
.btn.ghost-danger { color: var(--danger); border-color: rgba(248, 113, 113, .35); }

/* 관리자 테이블 */
.admin-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-toolbar .spacer { flex: 1; }
.filter-chip {
  font-size: 14px; font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.filter-chip.on { color: #06121f; background: var(--accent); border-color: var(--accent); }
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.table-scroll { overflow-x: auto; max-height: 560px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  position: sticky; top: 0;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(148, 180, 255, .07);
  color: #cbd8ec;
  white-space: nowrap;
}
tbody tr:hover td { background: rgba(34, 211, 238, .05); }
.pill {
  font-size: 12px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.pill.k1 { color: var(--accent); background: rgba(34, 211, 238, .12); }
.pill.k2 { color: var(--violet); background: rgba(129, 140, 248, .14); }
.empty-row td { text-align: center; color: var(--muted); padding: 46px 0; }

/* ---------- 모달 ---------- */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 9, 20, .72);
  backdrop-filter: blur(6px);
}
.modal {
  width: 860px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 60px 68px;
  box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.22, 1.2, .36, 1);
}
.modal h3 { font-size: 44px; font-weight: 900; margin-bottom: 26px; }
.modal p { font-size: 26px; line-height: 1.8; color: #c3d2ea; }
.modal .fine {
  margin-top: 22px;
  font-size: 21px;
  color: var(--muted);
  background: rgba(148, 180, 255, .07);
  border-radius: 14px;
  padding: 20px 24px;
  line-height: 1.7;
}
.modal-btns { display: flex; gap: 18px; margin-top: 44px; }
.modal-btns .nav-btn { flex: 1; }

/* ---------- 관리자 로그인 게이트 ---------- */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 38px;
  box-shadow: var(--shadow);
}
.login-card h2 { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.login-card .sub { font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.login-card label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 7px; }
.login-card input {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 26px; padding: 14px; font-size: 16px; }
.login-card .err { color: var(--danger); font-size: 13.5px; margin-top: 12px; min-height: 18px; }
.login-card .hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* 화면 전환 애니메이션 */
.fade-in { animation: fadein .4s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* 풀스크린/홈 버튼 (키오스크 코너) */
.corner-tools {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  z-index: 50;
  opacity: .35;
  transition: opacity .2s;
}
.corner-tools:hover { opacity: 1; }
.corner-tools a, .corner-tools button {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(20, 31, 54, .85);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
