/* =========================================================================
   이벤트 — 상세 · 목록 · 신청 모달. 라이트/다크 모두 따른다.
   히어로 전용 색은 .ev 에 모아 두고 다크에서 값만 갈아끼운다.
   ========================================================================= */

.ev {
  /* 시안 폰트. 파일이 붙기 전까지는 var(--font-sans) 로 떨어진다. */
  --ev-font-display: "Paperlogy", var(--font-sans);
  --ev-font-num: "Typo_SsangmunDong", var(--font-sans);
  --ev-font-label: "SB AggroOTF", var(--font-sans);

  /* 영상에 알파가 없고 배경이 단색으로 박혀 있다 — 히어로 배경이 그 색과 어긋나면
     영상 사각형 테두리가 보인다. 값은 브라우저가 디코딩한 실측치라 시안(#E5F1FF)과 한두 단계
     다르다. 영상을 다시 뽑으면 이 값도 같이 맞춰야 한다. */
  --ev-hero-bg: #e4f0fd;
  --ev-mark: #2173d4;
  --ev-grad-eyebrow: linear-gradient(90deg, #00d9e9 0%, #0080ff 50%, #0020d4 100%);
  --ev-grad-title: linear-gradient(90deg, #00d9e9 0%, #0080ff 50%, #0037ed 100%);
  --ev-cta: #007fff;
  --ev-cta-hover: #0067d6;
  --ev-cta-glow: 0 0 30px rgba(77, 148, 219, 0.5);
  --ev-card-bg: rgba(255, 255, 255, 0.2);
  --ev-card-shadow: 0 0 20px rgba(77, 148, 219, 0.2), inset 0 0 12.8px rgba(255, 255, 255, 0.15);
  --ev-unit-label: rgba(79, 81, 85, 0.8);
  --ev-sep-shadow: 0 0 20px rgba(0, 127, 255, 0.3);
}

:root[data-theme="dark"] .ev {
  --ev-hero-bg: #0c0f1a;
  --ev-mark: #ffffff;
  --ev-grad-eyebrow: linear-gradient(90deg, #00fff2 0%, #007bef 50%, #0052d5 100%);
  --ev-grad-title: linear-gradient(90deg, #00fff2 0%, #007bef 50%, #0052d5 100%);
  --ev-cta: #006cef;
  --ev-cta-hover: #0058c4;
  --ev-cta-glow: 0 0 30px rgba(0, 108, 239, 0.5);
  --ev-card-bg: rgba(0, 0, 0, 0.2);
  --ev-card-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 12.8px rgba(255, 255, 255, 0.15);
  --ev-unit-label: rgba(255, 255, 255, 0.5);
  --ev-sep-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* ---------- 상세: 히어로 ---------- */
.ev-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(72px + clamp(40px, 6vh, 64px)); /* 고정 GNB 높이 + 여백 */
  padding-bottom: clamp(48px, 7vh, 76px);
  padding-inline: var(--gutter);
  overflow: hidden;
  background: var(--ev-hero-bg);
}

/* 배경에 깔리는 큰 글씨. 영상이 알파 없이 배경째 덮어 글자가 끊기므로 영상 위에 올린다
   — 5% 불투명도라 로봇 위를 지나도 결이 얹히는 정도다. */
.ev-hero__watermark {
  position: absolute;
  z-index: 2;
  top: clamp(52px, 7.7vh, 83px);
  left: 50%;
  transform: translateX(calc(-50% - 15px));
  margin: 0;
  color: var(--ev-mark);
  opacity: 0.05;
  font-family: var(--ev-font-display);
  font-weight: 700;
  font-size: clamp(56px, 11.6vw, 134px);
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.ev-hero__visual {
  position: relative;
  z-index: 1;
  width: min(376px, 64vw);
  aspect-ratio: 376 / 352;
  overflow: hidden;
  background: var(--ev-hero-bg);
}

.ev-hero__visual video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  outline: 0;
}
/* 영상을 못 받았거나 동작을 줄이는 설정이면 포스터만 남는다. */
.ev-hero__poster {
  position: absolute;
  inset: 0;
  background: url(../assets/event/openapi/openapi_light.webp) center / cover no-repeat;
}
:root[data-theme="dark"] .ev-hero__poster {
  background-image: url(../assets/event/openapi/openapi_dark.webp);
}

.ev-hero__visual[data-ev-playing] .ev-hero__poster { display: none; }

/* 영상 아래끝과 16px 겹친다 — 겹친 부분이 영상에 가리지 않도록 위로 쌓는다. */
.ev-hero__copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  margin-top: -16px;
  text-align: center;
}
.ev-hero__eyebrow,
.ev-hero__title {
  margin: 0;
  font-family: var(--ev-font-display);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.ev-hero__eyebrow {
  background-image: var(--ev-grad-eyebrow);
  font-weight: 400;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.3;
}
.ev-hero__title {
  max-width: 14em;
  background-image: var(--ev-grad-title);
  font-weight: 600;
  font-size: clamp(24px, 3.1vw, 36px);
  line-height: 1.45;
  letter-spacing: -0.03em;
}
.ev-hero__titles { display: flex; flex-direction: column; gap: 12px; }

.ev-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 60px;
  padding: 0 32px 1px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ev-cta);
  box-shadow: var(--ev-cta-glow);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--ev-font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.ev-hero__cta:hover:not(:disabled) { background: var(--ev-cta-hover); transform: translateY(-1px); }
.ev-hero__cta:active { transform: translateY(1px); }
.ev-hero__cta:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
.ev-hero__cta--ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  box-shadow: none;
  color: var(--text);
}
.ev-hero__cta--ghost:hover { background: var(--chip-bg); transform: none; }

/* ---------- 상세: 카운트다운 ---------- */
.ev-count {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(694px, 100%);
  margin-top: clamp(56px, 9.6vh, 104px);
}
.ev-count__label {
  margin: 0;
  color: var(--text);
  font-family: var(--ev-font-display);
  font-weight: 400;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.5;
}
.ev-count__grid { display: flex; align-items: center; gap: 20px; }

.ev-unit {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 32px 8px 0;
  min-height: 144px;
  border-radius: 19.2px;
  background: var(--ev-card-bg);
  box-shadow: var(--ev-card-shadow);
}
.ev-unit b {
  color: var(--text);
  font-family: var(--ev-font-num);
  font-weight: 700;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ev-unit i {
  color: var(--ev-unit-label);
  font-family: var(--ev-font-label);
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3;
}
.ev-count__sep {
  flex: none;
  color: rgba(255, 255, 255, 0.1);
  text-shadow: var(--ev-sep-shadow);
  font-family: var(--ev-font-num);
  font-weight: 700;
  font-size: clamp(34px, 3.8vw, 50px);
  line-height: 1.4;
  letter-spacing: 0.04em;
  user-select: none;
}

.ev-count__closed {
  margin: 0;
  padding: 30px 0;
  color: var(--text-dim);
  font-family: var(--ev-font-display);
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.5;
}

/* ---------- 상세: 안내사항 ---------- */
.ev-info { background: var(--bg-2); padding-block: 60px; }
.ev-info__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1000px;
}
.ev-info__title { margin: 0 0 12px; color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.45; }
.ev-list { margin: 0; padding: 0; list-style: none; }
.ev-list li {
  position: relative; padding-left: 15px;
  color: var(--text-dim); font-size: 13px; line-height: 1.9; letter-spacing: -0.06em;
}
.ev-list li::before { content: "\30FB"; position: absolute; left: 0; color: #888; }
.ev-info__seal { margin: 20px 0 0; color: var(--text); font-size: 13px; line-height: 1.9; letter-spacing: -0.06em; }

/* 예금자 비보호 도장 — 원본이 투명 배경이라 다크에서도 읽히도록 흰 바탕을 깐다. */
.ev-stamp {
  display: inline-block;
  width: 40px; height: 26px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 2px;
  background: #fff;
}

/* ---------- 목록 ---------- */
.ev-cards {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px;
}
.ev-card__link {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-2);
  text-decoration: none; transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.ev-card__link:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-float); }
.ev-card__thumb {
  display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center;
  background-image: linear-gradient(135deg, #0d1535 0%, #0c1a5e 55%, #0a0e1a 100%);
}
.ev-card__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; }
.ev-card__tags { display: flex; gap: 6px; }
.ev-card__state, .ev-card__badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 600;
}
.ev-card__state { background: rgba(0, 74, 246, 0.16); color: #58b9ff; }
.ev-card__badge { background: var(--chip-bg); color: var(--text-dim); }
.ev-card__title { color: var(--text); font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); }
.ev-card__summary { color: var(--text-dim); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }
.ev-card__period { margin-top: 4px; color: var(--text-inactive); font-size: var(--fs-code-chip); }

.ev-card--closed .ev-card__link { opacity: 0.55; }
.ev-card--closed .ev-card__state { background: var(--chip-bg); color: var(--text-inactive); }
.ev-empty { padding: 80px 0; text-align: center; color: var(--text-dim); }

/* ---------- 팝업 내용: 신청 폼 (공용 껍데기에 주입) ---------- */
.ev-apply { width: min(480px, 92vw); padding: 44px 36px 32px; color: var(--text); }
.ev-apply__title { margin: 0 0 12px; font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; }
.ev-apply__desc { margin: 0; color: var(--text-dim); font-size: var(--fs-text-sm); line-height: 1.7; }
.ev-apply__period { margin: 8px 0 26px; color: var(--text-inactive); font-size: var(--fs-code-chip); }
.ev-apply__field { display: flex; flex-direction: column; gap: 8px; }
.ev-apply__label { color: var(--text-dim); font-size: var(--fs-text-sm); }
.ev-apply__field input {
  width: 100%; padding: 12px 16px; border-radius: var(--r-xs);
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.06);
  color: var(--text); font-size: var(--fs-input); font-family: inherit; outline: none;
}
.ev-apply__field input:focus { border-color: #58b9ff; }
.ev-apply__agree {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; cursor: pointer;
  color: var(--text-dim); font-size: var(--fs-text-sm); line-height: 1.5;
}
.ev-apply__agree input { margin-top: 2px; accent-color: #004af6; }
.ev-apply__error { margin: 14px 0 0; color: var(--color-rose); font-size: var(--fs-text-sm); }
.ev-apply__actions { display: flex; gap: 12px; margin-top: 28px; }
.ev-apply__btn {
  flex: 1; padding: 14px 0; border-radius: var(--r-pill); cursor: pointer;
  font-family: inherit; font-size: var(--fs-text-md); font-weight: 600;
  transition: background-color 0.15s var(--ease);
}
.ev-apply__btn--ghost { border: 1px solid var(--border-strong); background: transparent; color: var(--text-dim); }
.ev-apply__btn--ghost:hover { background: var(--chip-bg); }
.ev-apply__btn--primary { flex: 2; border: 0; background: #004af6; color: #fff; }
.ev-apply__btn--primary:hover { background: #0035d4; }
.ev-apply__check {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43, 214, 110, 0.14); color: var(--color-success);
}
.ev-apply__check svg { width: 26px; height: 26px; }
.ev-apply__pane[data-ev-pane="done"] { text-align: center; }

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .ev-hero { padding-top: calc(72px + 32px); }
  .ev-hero__watermark { transform: translateX(-50%); }
  .ev-hero__copy { gap: 26px; }
  /* 320px 대에서도 제목 한 줄이 통째로 들어가는 크기. */
  .ev-hero__title { font-size: clamp(18px, 5.6vw, 24px); }
  .ev-hero__cta { min-width: 180px; min-height: 52px; }
  /* 좁은 화면에서는 구분 콜론을 빼고 2×2 로 접는다. */
  .ev-count__grid { flex-wrap: wrap; gap: 12px; }
  .ev-count__sep { display: none; }
  .ev-unit { flex-basis: calc(50% - 6px); min-height: 118px; padding-top: 24px; gap: 8px; }
  .ev-info { padding-block: 44px; }
  .ev-apply { padding: 36px 24px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ev-hero__cta { transition: none; }
}
