/* Infinit DOOH Studio — KT 바로광고 UI 스타일 재현 */
:root {
  --accent: #E60012;
  --accent-dark: #c1000f;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --card: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --ok: #059669;
  --warn: #d97706;
}
html[data-theme="dark"] {
  --bg: #0b0d10;
  --surface: #101317;
  --card: #14171c;
  --fg: #f3f4f6;
  --muted: #9aa3af;
  --border: #262b33;
  --glass: rgba(20, 23, 28, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.25s, color 0.25s;
  word-break: keep-all;  /* 한글이 음절 중간에서 꺾이지 않게 */
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── 상단 내비 ─────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: 76px; pointer-events: none;
  /* 스크롤 시 아래 콘텐츠 글자와 겹쳐 보이지 않도록 헤더 전용 배경 —
     테마 배경색 60% + 블러라 다크 히어로 위에서도, 흰 콘텐츠 위에서도 자연스럽다 */
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar > * { pointer-events: auto; }
.brand {
  position: absolute; left: 28px; top: 22px;
  font-weight: 800; font-size: 17px; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 9px;
}
.brand .logo-slot {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 900;
}
.nav-pill {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 999px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.nav-item { position: relative; }
.nav-item > a {
  display: block; padding: 10px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--fg); white-space: nowrap;
}
.nav-item > a:hover { background: rgba(128, 128, 128, 0.12); }
.nav-item > a.active { background: var(--accent); color: #fff; }
.nav-drop {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  min-width: 190px; padding: 8px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 16px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; translate: 0 -6px; transition: 0.18s;
}
.nav-item:hover .nav-drop { opacity: 1; visibility: visible; translate: 0 0; }
.nav-drop a { display: block; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--fg); }
.nav-drop a:hover { background: rgba(128, 128, 128, 0.14); }
.nav-drop .drop-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.top-right { position: absolute; right: 24px; top: 20px; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--glass-border); background: var(--glass);
  backdrop-filter: blur(12px); font-size: 16px; color: var(--fg);
  display: grid; place-items: center;
}
.profile {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(12px);
}
.profile .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6a3d);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
}

/* ── 서브페이지 히어로 ─────────────────────── */
.hero {
  position: relative; min-height: 320px; padding: 120px 8vw 48px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff; overflow: hidden;
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(230, 0, 18, 0.35), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(60, 90, 220, 0.25), transparent 60%),
    linear-gradient(160deg, #14161c 0%, #1d2129 55%, #14161c 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1.4px);
  background-size: 26px 26px; opacity: 0.35;
  mask-image: linear-gradient(to bottom, transparent, #000 45%);
}
.hero .caption {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 0.22em; text-transform: lowercase; color: rgba(255,255,255,0.75);
}
.hero .caption::before { content: ""; width: 3px; height: 16px; background: var(--accent); }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); font-weight: 800; margin: 14px 0 10px; }
.hero .desc { font-size: 16px; color: rgba(255,255,255,0.8); max-width: 560px; }
.hero .hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 34px; }
.breadcrumb { font-size: 13px; color: rgba(255,255,255,0.65); }
.breadcrumb b { color: #fff; font-weight: 600; }
.btn-cta {
  background: var(--accent); color: #fff; border: none;
  padding: 14px 28px; border-radius: 12px; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(230, 0, 18, 0.35); transition: 0.15s;
}
.btn-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ── 콘텐츠 공통 ───────────────────────────── */
.container { max-width: 1240px; margin: 0 auto; padding: 44px 24px 90px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px;
}
h2.section { font-size: 20px; font-weight: 800; margin-bottom: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; }
.field label .req { color: var(--accent); margin-left: 2px; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 14.5px; font-family: inherit;
  background: var(--surface); color: var(--fg);
  border: 1.5px solid var(--border); border-radius: 11px; outline: none; transition: 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.btn {
  padding: 12px 20px; border-radius: 11px; font-size: 14.5px; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--card); color: var(--fg); transition: 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 선택 카드 (규격/톤) */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 10px; }
.opt-card {
  position: relative; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 13px 14px; cursor: pointer; background: var(--surface); transition: 0.15s;
  font-size: 13.5px; font-weight: 600;
}
.opt-card small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; font-size: 12px; }
.opt-card.selected { border-color: var(--accent); background: rgba(230, 0, 18, 0.05); }
.opt-card.disabled { opacity: 0.5; cursor: not-allowed; }
.badge-soon {
  position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 700;
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px;
  background: var(--card);
}

/* 상태 뱃지 */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.done { background: rgba(5, 150, 105, 0.12); color: var(--ok); }
.badge.review_pending { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.badge.blocked, .badge.rejected, .badge.failed { background: rgba(230, 0, 18, 0.1); color: var(--accent); }
.badge.running { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

/* 스텝 UI */
.steps { display: flex; flex-direction: column; gap: 0; margin: 18px 0; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 0 0 22px 0; position: relative; }
.step::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--border);
}
.step:last-child::before { display: none; }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%; flex: none; z-index: 1;
  border: 2px solid var(--border); background: var(--card);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted);
}
.step.active .dot { border-color: var(--accent); color: var(--accent); animation: pulse 1.2s infinite; }
.step.doneStep .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step .st-label { font-size: 14px; font-weight: 700; padding-top: 4px; }
.step .st-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(230,0,18,0.3); } 50% { box-shadow: 0 0 0 7px rgba(230,0,18,0); } }

/* 프리뷰 프레임 */
.preview-frame {
  aspect-ratio: 9 / 16; width: 100%; max-width: 330px; margin: 0 auto;
  border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; position: relative;
  display: grid; place-items: center;
}
.preview-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-frame .skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(128,128,128,0.12) 50%, transparent 70%) var(--surface);
  background-size: 220% 100%; animation: shimmer 1.6s infinite;
}
@keyframes shimmer { to { background-position-x: -220%; } }
.preview-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 0 24px; z-index: 1; }

/* 빨간 언더라인 탭 */
.tabs { display: flex; gap: 26px; border-bottom: 1.5px solid var(--border); margin-bottom: 26px; }
.tab {
  padding: 13px 4px; font-size: 15px; font-weight: 700; color: var(--muted);
  background: none; border: none; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
}
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab .cnt { font-size: 12px; color: var(--muted); margin-left: 4px; }

/* KPI 카드 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; }
.kpi .k-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .k-value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.kpi .k-value small { font-size: 14px; color: var(--muted); font-weight: 600; }

/* 소재 카드 그리드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.creative-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; cursor: pointer; transition: 0.18s;
}
.creative-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.creative-card .thumb {
  aspect-ratio: 9 / 16; background: var(--surface);
  display: grid; place-items: center; color: var(--muted); font-size: 12.5px;
}
.creative-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.creative-card .cc-body { padding: 14px 16px; }
.creative-card .cc-title { font-weight: 800; font-size: 15px; }
.creative-card .cc-meta { font-size: 12.5px; color: var(--muted); margin: 4px 0 9px; }

/* 모달 */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200;
  display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  width: min(880px, 100%); padding: 28px;
}
.modal .m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal .m-close { background: none; border: none; font-size: 22px; color: var(--muted); }

/* 아코디언 */
.acc { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: var(--card); }
.acc summary {
  padding: 17px 20px; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.acc summary::after { content: "＋"; color: var(--muted); }
.acc[open] summary::after { content: "－"; }
.acc .acc-body { padding: 0 20px 18px; font-size: 14px; color: var(--muted); line-height: 1.7; }

/* 드래그 앤 드랍 존 */
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 26px 18px;
  text-align: center; font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; background: var(--surface); transition: 0.15s;
}
.dropzone:hover, .dropzone.dz-over { border-color: var(--accent); color: var(--fg);
  background: rgba(230, 0, 18, 0.04); }
.dropzone .dz-sub { display: block; font-weight: 400; font-size: 12px; margin-top: 5px; color: var(--muted); }

.alert { border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; margin: 14px 0; }
.alert.info { background: rgba(59, 130, 246, 0.09); color: #2563eb; }
.alert.ok { background: rgba(5, 150, 105, 0.09); color: var(--ok); }
.alert.warn { background: rgba(217, 119, 6, 0.1); color: var(--warn); }
.alert.danger { background: rgba(230, 0, 18, 0.08); color: var(--accent); }

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .nav-item > a { padding: 9px 14px; font-size: 13.5px; }
  .brand span.brand-text { display: none; }
}
