@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --bg: #121116;
  --surface: #1c1b22;
  --surface-2: #26252e;
  --line: #34333d;
  --text: #f3f0ea;
  --muted: #a19fab;
  --accent: #ff8a5b;
  --accent-ink: #1a0f0a;
  --danger: #ff6b6b;
  --ok: #5fd39a;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* hidden 속성이 붙은 요소는 display 지정과 상관없이 항상 숨김 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- 상단바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: rgba(18, 17, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 999px;
  font: inherit; font-weight: 700;
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 홈 ---------- */
.hero { padding: 72px 0 48px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .12em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.25; letter-spacing: -0.03em; margin: 0 0 16px; }
.lead { color: var(--muted); margin: 0 0 28px; }

.section-title { font-size: 20px; margin: 40px 0 16px; letter-spacing: -0.02em; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 16px 56px; position: relative;
  display: flex; flex-direction: column;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.steps span { color: var(--muted); font-size: 15px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card p { margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin-top: 6px !important; }

.cta-bottom { margin: 40px auto 56px; }

.footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

/* ---------- 신청 폼 ---------- */
.page-head { padding: 32px 0 8px; }
.page-head h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin: 0; }

.form-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; margin: 16px 0;
}
.form-section > h2 { font-size: 17px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.form-section > h2 .num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
}
.form-section > .desc { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

.field { margin-top: 16px; }
.field:first-of-type { margin-top: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.req { color: var(--accent); margin-left: 2px; }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }

input[type="text"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 16px; /* iOS 확대 방지 */
  outline: none;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
input[type="date"] { color-scheme: dark; }

.field-help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }

/* 선택 칩 (날짜, 성별) */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; text-align: center; font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.chip small { color: var(--muted); font-weight: 400; font-size: 12px; }
.chip input:checked + span { border-color: var(--accent); background: rgba(255, 138, 91, 0.12); }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 사진 업로드 */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-slot {
  position: relative; aspect-ratio: 3 / 4;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
  color: var(--muted); font-size: 13px; text-align: center;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1;
  cursor: pointer;
}
.photo-slot input { display: none; }

/* 동의 */
.notice {
  background: var(--surface-2); border-radius: 10px; padding: 14px; font-size: 14px; color: var(--muted);
}
.notice ul { margin: 0; padding-left: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
details { margin: 6px 0 0 30px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; }
details table { width: 100%; border-collapse: collapse; margin-top: 8px; }
details th, details td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
details th { width: 30%; font-weight: 600; color: var(--text); }

/* 허니팟 (봇 방지) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit-area { margin: 24px 0 56px; }
.form-message { margin-top: 12px; font-size: 14px; text-align: center; min-height: 1.4em; }
.form-message.error { color: var(--danger); }

/* 완료 화면 */
.done { text-align: center; padding: 80px 16px; }
.done .mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px;
  background: var(--ok); color: #0b1d14; display: grid; place-items: center; font-size: 30px; font-weight: 800;
}
.done h1 { font-size: 24px; margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0 0 28px; }

/* =========================================================
 * 단계별 신청 화면 (wizard)
 * ========================================================= */
.wizard-page { min-height: 100dvh; }
.step-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.progress { position: sticky; top: 53px; z-index: 9; height: 3px; background: var(--line); }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.step { padding: 28px 0 140px; animation: stepIn .25s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.step-title { font-size: 24px; line-height: 1.35; letter-spacing: -0.02em; margin: 0 0 8px; }
.step-desc { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.step .field { margin-top: 22px; }
.step .field:first-of-type { margin-top: 0; }

/* 하단 고정 이전/다음 */
.step-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr 2fr; gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(18,17,22,0));
  max-width: 640px; margin: 0 auto;
}
.step-nav.first { grid-template-columns: 1fr; }
.step-nav.first #prevBtn { display: none; }
.form-message { position: fixed; left: 0; right: 0; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 11; margin: 0; padding: 0 16px; }

/* 날짜 목록 */
.date-list { display: grid; gap: 8px; }
.date-week { color: var(--muted); font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.date-week:first-child { margin-top: 0; }
.date-option input { position: absolute; opacity: 0; pointer-events: none; }
.date-option > span {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s ease, background .15s ease;
}
.date-option strong { font-size: 17px; }
.date-option em { font-style: normal; font-size: 13px; color: var(--muted); }
.date-option em.few { color: var(--accent); }
.date-option input:checked + span { border-color: var(--accent); background: rgba(255,138,91,.12); }
.date-option input:disabled + span { opacity: .4; cursor: not-allowed; }
.date-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* MBTI 4쌍 */
.mbti { display: grid; gap: 8px; }
.mbti-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mbti-row .chip span { min-height: 48px; }
.mbti.disabled { opacity: .35; pointer-events: none; }
.check.small { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* 확인 화면 */
.review { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.review-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px 14px; background: none; border: 0; border-top: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.review-row:first-child { border-top: 0; }
.review-row .k { color: var(--muted); font-size: 13px; }
.review-row .v { word-break: break-all; }
.review-row .edit { color: var(--muted); font-size: 13px; }
.review-thumbs { display: flex; gap: 6px; }
.review-thumbs img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; }

.check.all { padding: 14px; margin: 16px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 700; }

.notice-inline { color: #ffd27a; background: rgba(255, 210, 122, .08); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }

/* =========================================================
 * 달력
 * ========================================================= */
.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px 14px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.cal-head strong { font-size: 17px; }
.cal-nav {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
}
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-dow .dow0 { color: #ff8f8f; }
.cal-dow .dow6 { color: #8fb8ff; }

.cal-cell {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  border-radius: 10px; font-size: 15px; color: #6f6d78;
  border: 1px solid transparent; background: none; font-family: inherit; padding: 0;
  position: relative;
}
.cal-cell.past { color: #4a4953; }
.cal-cell.today::after {
  content: ''; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--muted);
}
/* 신청 가능한 날: 파티 종류 색 */
.cal-cell.on {
  color: var(--c); font-weight: 800; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform .1s ease;
}
.cal-cell.on:active { transform: scale(.94); }
.cal-cell.on.selected { background: var(--c); color: #16141a; border-color: var(--c); }
.cal-cell.on.closed {
  color: #6f6d78; background: none; border: 1px dashed #4a4953; cursor: not-allowed;
  text-decoration: line-through; font-weight: 600;
}
.cal-cell:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i {
  width: 14px; height: 14px; border-radius: 4px;
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid var(--c);
}
.legend-item i.closed { background: none; border: 1px dashed #6f6d78; }

/* 선택한 날짜 상세 */
.date-detail {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  animation: stepIn .2s ease;
}
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.detail-top strong { font-size: 17px; }
.type-badge { background: var(--c); color: #16141a; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.detail-desc { color: var(--muted); font-size: 14px; margin: 8px 0 10px; }
.detail-desc:empty { display: none; }
.detail-gates { display: flex; gap: 6px; flex-wrap: wrap; }
.gate { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.gate.open { color: var(--ok); }
.gate.wait { color: #ffd27a; }
.gate.closed { color: var(--danger); }

.field-help.highlight { color: #ffd27a; margin: -2px 0 10px; }

.pub { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px; color: var(--accent); background: rgba(255, 138, 91, .12); }

/* 로고: DZE는 굵은 대문자, party는 소문자 + 포인트 색 */
.logo { display: inline-flex; align-items: baseline; gap: 5px; text-decoration: none; }
.logo-mark { font-weight: 900; font-size: 19px; letter-spacing: 0.06em; color: var(--text); }
.logo-sub { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; color: var(--text); }

/* 홈: 일정 카드 */
.schedule-card { display: grid; gap: 14px; justify-items: start; }
.party-kinds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: 100%; }
.party-kinds li { display: grid; grid-template-columns: 14px auto; column-gap: 10px; align-items: center; }
.party-kinds i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 25%, transparent); }
.party-kinds span { grid-column: 2; color: var(--muted); font-size: 14px; }
.schedule-card .hint { margin: 0 !important; }

.insta-link { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.insta-link:hover { text-decoration-color: var(--text); }

/* 운영 수칙 */
.rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.rules-intro { margin: 0 0 14px; font-size: 15px; color: var(--muted); }
.rules-intro strong { color: var(--text); font-size: 16px; }
.rule-list { list-style: none; counter-reset: rule; margin: 0; padding: 0; display: grid; gap: 14px; }
.rule-list li { counter-increment: rule; position: relative; padding-left: 30px; }
.rule-list li::before {
  content: counter(rule); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; display: grid; place-items: center; color: var(--muted);
}
.rule-list h3 { margin: 0 0 4px; font-size: 15px; }
.rule-list p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.rule-list p:last-child { margin-bottom: 0; }
.rule-list a { color: var(--text); }
.rule-note { font-size: 13px !important; }
.refund { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.refund th, .refund td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.refund th { font-weight: 600; width: 50%; background: var(--surface-2); }
.details-text { margin: 8px 0 0; }

.companion-box { margin-top: 12px; padding: 4px 0 0; display: grid; gap: 0; }
.companion-box .notice-inline { margin: 0; }
.chip span { line-height: 1.35; }

.step .companion-box .field { margin-top: 18px; }

/* 휴대폰 인증 */
.inline-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.inline-row .btn.small { padding: 0 14px; white-space: nowrap; min-width: 108px; font-variant-numeric: tabular-nums; }
.verify-row { margin-top: 8px; }
.verify-row .field-help { margin-top: 6px; }
.verify-row .field-help.err { color: var(--danger); }
input[readonly] { opacity: .75; }
.verified { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 14px; color: var(--ok); font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.turnstile-box:empty { display: none; }
.turnstile-box { margin-top: 8px; }
