/* coupang_link_share — style.css
   모바일 우선, 신뢰감 있는 클린 디자인. 브랜드 컬러 #ff5a3c */

:root {
  --brand: #ff5a3c;
  --brand-2: #ff3a57;
  --ink: #1b1b1f;
  --muted: #6b7280;
  --line: #ececf0;
  --bg: #fff7f4;
  --card: #ffffff;
  --ok: #1aa260;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(255, 90, 60, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  line-height: 1.55;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

/* ── 히어로 ── */
.hero {
  text-align: center;
  padding: 18px 0 6px;
}
.hero .icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto 16px;
}
.hero h1 {
  font-size: 1.5rem;
  margin: 6px 0 8px;
  letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--brand); }
.hero p.sub {
  color: var(--muted);
  margin: 0 auto;
  font-size: 1rem;
  max-width: 22em;
}

/* ── 카드 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin: 18px 0;
}
.card h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

/* ── 혜택 리스트 ── */
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
}
.benefits li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.97rem;
}
.benefits li:last-child { border-bottom: 0; }
.benefits .em { font-size: 1.2rem; line-height: 1.3; }

/* ── CTA 버튼 ── */
.cta {
  display: block;
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(255, 90, 60, 0.35);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.cta:active { transform: translateY(1px) scale(0.995); }
.cta.secondary {
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand);
  box-shadow: none;
}
.btn-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* ── 안내(가이드) 박스 ── */
.guide {
  background: #fff8e6;
  border: 1px solid #ffe2a8;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 0.95rem;
}
.guide strong { color: #b45309; }
.guide ol { margin: 8px 0 0; padding-left: 20px; }
.guide li { margin: 4px 0; }

.note-ok {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  font-weight: 600;
}

/* ── 환경 힌트 ── */
#envHint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 8px 0 2px;
}

/* ── 미설정 경고(운영자) ── */
.owner-warn {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin: 12px 0;
}

/* ── 파트너스 고지 / 푸터 ── */
.disclosure {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  margin: 26px 6px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer {
  text-align: center;
  color: #aab;
  font-size: 0.72rem;
  margin-top: 14px;
}

/* ── go(스플래시) ── */
.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(160deg, #fff, var(--bg));
  text-align: center;
  padding: 24px;
}
.splash .icon { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid #ffd9cf;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash a { color: var(--brand); }

/* ── 관리 대시보드 ── */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.kpi .v { font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.kpi .l { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: #fff; border-radius: 12px; overflow: hidden; }
table.tbl th, table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { background: #fafafc; color: var(--muted); font-weight: 600; }
.bar { height: 8px; background: var(--brand); border-radius: 4px; }

/* ── 홈화면 추가 안내 모달(안드로이드) ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* hidden 속성이 display:flex 를 확실히 이기도록(특정도 ↑) — 닫기/초기 숨김 보장 */
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 18px; max-width: 340px; width: 100%;
  padding: 24px 22px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 4px; font-size: 1.15rem; }
.modal p.s { color: var(--muted); margin: 2px 0 0; font-size: 0.9rem; }
.modal ol { margin: 14px 0 0; padding-left: 22px; }
.modal ol li { margin: 10px 0; font-size: 1.02rem; }
.modal .ok {
  width: 100%; margin-top: 18px; padding: 13px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
}
#menuPointer {
  position: fixed; top: 6px; right: 12px; z-index: 1001;
  background: #1b1b1f; color: #fff; padding: 8px 12px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  animation: ptr 1s ease-in-out infinite;
}
@keyframes ptr { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ── 안심 카드(서비스 신뢰 안내) ── */
.card.trust { background: #f3faf5; border-color: #bfe8cd; }
.card.trust h2 { color: #067647; }

/* ── 공식 제휴 배지 ── */
.badge-official {
  display: inline-block; margin-top: 12px; padding: 6px 14px;
  border-radius: 999px; background: #fff3ef; color: #c0392b;
  border: 1px solid #ffd3c7; font-size: 0.82rem; font-weight: 700; letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════════════════════
   이벤트 허브 (/events) — 아이콘 진입점
   ══════════════════════════════════════════════════════════ */
.events-hub { padding-top: 18px; }
.hub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hub-icon { width: 56px; height: 56px; border-radius: 16px; box-shadow: var(--shadow); flex: 0 0 auto; }
.hub-head-txt h1 { font-size: 1.25rem; margin: 0; letter-spacing: -0.02em; }
.hub-head-txt .hub-sub { color: var(--muted); margin: 2px 0 0; font-size: 0.86rem; }

.events-sec { margin-top: 22px; }
.events-sec h2 { font-size: 1.1rem; margin: 0 0 4px; }
.events-cap { color: var(--muted); font-size: 0.84rem; margin: 0 0 12px; }
.empty-note { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 0.95rem; }

/* 프로모션 카드 */
.promo {
  display: block; text-decoration: none; color: inherit;
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px; margin: 12px 0;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
a.promo:active { transform: translateY(1px) scale(0.995); }
a.promo:hover { box-shadow: 0 12px 28px rgba(255, 90, 60, 0.18); }
.promo-badge {
  display: inline-block; margin-bottom: 8px; padding: 3px 10px;
  border-radius: 999px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 0.74rem; font-weight: 800; letter-spacing: -0.01em;
}
.promo-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.promo-period { color: var(--muted); font-size: 0.84rem; margin-top: 4px; }
.promo-desc { margin-top: 8px; font-size: 0.92rem; color: #333; white-space: pre-line; }
.promo-img { width: 100%; border-radius: 12px; margin-top: 12px; display: block; }
.promo-go { margin-top: 12px; color: var(--brand); font-weight: 700; font-size: 0.92rem; }

/* 미설치 티저(잠금) 카드 */
.promo.locked { cursor: default; }
.promo-blur {
  height: 38px; margin-top: 12px; border-radius: 10px;
  background: repeating-linear-gradient(90deg, #f1f1f4 0, #f1f1f4 8px, #e9e9ee 8px, #e9e9ee 16px);
  filter: blur(1.5px); opacity: 0.85;
}
.promo-lock {
  margin-top: 10px; text-align: center; font-size: 0.84rem; font-weight: 700;
  color: #b45309; background: #fff8e6; border: 1px dashed #ffe2a8;
  border-radius: 10px; padding: 7px 10px;
}
/* 잠금 카드는 이제 클릭 가능 — 클릭 시 이벤트 상세(설치 유도)로 이동 */
a.promo.locked { cursor: pointer; }
a.promo.locked:hover { box-shadow: 0 12px 28px rgba(180, 83, 9, 0.16); }
a.promo.locked:hover .promo-lock { background: #fff1cc; border-style: solid; }

/* 전체 보기 / 최신만 보기 네비게이션 */
.events-more {
  display: block; text-align: center; text-decoration: none;
  margin: 16px 0 4px; padding: 13px 14px; border-radius: 14px;
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow); transition: transform 0.08s ease;
}
.events-more:active { transform: translateY(1px) scale(0.995); }
.events-more.is-back {
  color: var(--brand); background: #fff; border: 1px solid var(--line); box-shadow: none;
}

/* 이벤트 상세 페이지 */
.back-link {
  display: inline-block; margin: 2px 0 10px; text-decoration: none;
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
}
.back-link:hover { color: var(--brand); }
.promo.detail { margin-top: 6px; cursor: default; }
.detail-title { font-size: 1.28rem; line-height: 1.3; margin: 4px 0; }
.promo.detail .promo-blur + .promo-blur { height: 56px; }
/* 설치 카드(상세·이벤트 허브 공통)는 설치자에겐 불필요(본문·링크가 이미 보임) → 숨김 */
.is-installed .install-gate { display: none; }

/* 랜딩 이벤트 티저 — 이벤트 없으면 섹션 숨김 + 상태별 안내 문구 토글 */
.landing-events { margin: 18px 0 4px; }
body:not(.has-events) #landingEvents { display: none; }
.is-installed .teaser-cap { display: none; }
.is-teaser .installed-cap { display: none; }

/* 설치 게이팅 — 상태별 노출 제어 */
.is-installed .install-cta { display: none; }
.install-cta { background: #fff8e6; border-color: #ffe2a8; }
.install-cta h2 { color: #b45309; }
.install-cta p { font-size: 0.92rem; margin: 0 0 14px; }

/* ── 관리 대시보드: 이벤트/프로모션 관리 ── */
.promo-admin { margin-top: 32px; }
.promo-admin h2 { margin-bottom: 8px; }
.promo-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0;
}
.promo-form .full { grid-column: 1 / -1; }
.promo-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: #444; }
.promo-form input, .promo-form textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9rem; font-family: inherit;
}
.promo-form textarea { resize: vertical; min-height: 60px; }
.promo-form .row-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.promo-form .hint { color: var(--muted); font-size: 0.78rem; }
.promo-tbl td.actions { white-space: nowrap; }
.promo-tbl .inactive { opacity: 0.5; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.pill.on { background: #ecfdf3; color: #067647; }
.pill.off { background: #f3f4f6; color: #6b7280; }
