/* ============================================================
   메타 신청폼 — 다크 풀스크린 4-스텝 (행사소개 → 방문희망일 → 전화번호 → 완료)
   메타(인스타·페북) 인앱 브라우저 최적화. 색/폰트는 :root에서 오버라이드.
   ============================================================ */
:root {
  --mlf-accent:    #fc1c49;   /* 포인트(버튼·선택) */
  --mlf-bg:        #14181c;   /* 시트 배경 */
  --mlf-surface:   #1e242b;   /* 입력칸·카드 */
  --mlf-surface-2: #232a31;   /* 입력 포커스·달력 네비 */
  --mlf-text:      #ffffff;
  --mlf-sat:       #5b9bff;   /* 토요일 */
  --mlf-sun:       #ff6b6b;   /* 일요일 */
  --mlf-font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* 안드로이드 WebView(인스타·페북 인앱) 폰트 자동확대 방지 → 크롬과 동일 크기 (전역, 필수) */
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }

.mlf-modal { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(0,0,0,0.55); }
.mlf-modal.is-open { display: block; }
body.mlf-open { overflow: hidden; }

.mlf-sheet {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  margin: 0 auto;                 /* ⚠️ transform 말고 margin 중앙정렬 → fixed CTA 기준 안 깨짐 */
  width: 100%; max-width: 480px;
  background: var(--mlf-bg);
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  font-family: var(--mlf-font);
  word-break: keep-all; overflow-wrap: break-word;
  animation: mlf-slide-down 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mlf-slide-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.mlf-top {
  position: sticky; top: 0; z-index: 2;
  background: var(--mlf-bg);
  padding: 0;                     /* 진행바를 브라우저 최상단에 붙임 */
}
.mlf-back {
  width: 30px; height: 30px; border: none; background: none; color: var(--mlf-text);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  margin: calc(12px + env(safe-area-inset-top, 0px)) 0 4px 14px;
}
.mlf-modal[data-step="5"] .mlf-back { visibility: hidden; }

.mlf-progress { width: 100%; height: 4px; border-radius: 0; background: rgba(255,255,255,0.12); overflow: hidden; }
.mlf-progress-fill {
  height: 100%; border-radius: 0;
  background: linear-gradient(90deg, #ff8a3d, var(--mlf-accent) 55%, #d6249f);
  width: 33%; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mlf-modal[data-step="2"] .mlf-progress-fill { width: 50%; }
.mlf-modal[data-step="3"] .mlf-progress-fill { width: 75%; }
.mlf-modal[data-step="4"] .mlf-progress-fill,
.mlf-modal[data-step="5"] .mlf-progress-fill { width: 100%; }

.mlf-body { flex: 1 0 auto; padding: 18px 24px calc(104px + env(safe-area-inset-bottom, 0px)); }  /* 고정 CTA 클리어 */
.mlf-modal.is-inapp .mlf-body { padding-bottom: 8px; }  /* 인앱: CTA 흐름 안 → 여백 최소 */
.mlf-step { display: none; animation: mlf-step-fade 0.28s ease; }
.mlf-step.is-active { display: block; }
@keyframes mlf-step-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.mlf-title { font-size: 21px; font-weight: 700; color: var(--mlf-text); line-height: 1.32; letter-spacing: -0.015em; margin: 4px 0 8px; }
.mlf-sub { font-size: 13.5px; font-weight: 400; color: rgba(255,255,255,0.56); line-height: 1.6; margin: 0 0 22px; }

.mlf-field { margin-bottom: 14px; }
.mlf-label { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.56); margin: 0 0 8px 4px; letter-spacing: 0.01em; }
.mlf-input {
  width: 100%; padding: 17px 18px;
  font-family: var(--mlf-font); font-size: 16px;   /* iOS 포커스 줌 방지: 16px 이상 유지 */
  font-weight: 500; color: var(--mlf-text); background: var(--mlf-surface);
  border: 1.5px solid rgba(255,255,255,0.10); border-radius: 14px;
  outline: none; -webkit-appearance: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.mlf-input::placeholder { color: rgba(255,255,255,0.40); }
.mlf-input:focus { border-color: var(--mlf-accent); background: var(--mlf-surface-2); }
.mlf-input.is-error { border-color: var(--mlf-accent); background: rgba(252,28,73,0.08); }
.mlf-err { display: none; margin: 7px 0 0 4px; font-size: 12.5px; color: var(--mlf-accent); font-weight: 500; }
.mlf-err.is-visible { display: block; }
.mlf-fineprint { margin: 16px 4px 0; font-size: 11.5px; line-height: 1.6; color: rgba(255,255,255,0.40); }

/* ===== 행사 소개 (STEP 1) — 디자인 없이 가운데 정렬 평문 ===== */
.mlf-intro { text-align: center; }
.mlf-intro-heading {
  margin: 4px 0 16px; font-size: 24px; font-weight: 800;
  color: var(--mlf-text); line-height: 1.32; letter-spacing: -0.015em;
}
.mlf-intro-sub {
  margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.5;
  color: var(--mlf-text);
}
.mlf-intro-text {
  margin: 26px 0 0; font-size: 15px; font-weight: 500; line-height: 1.7;
  color: var(--mlf-text);
}
.mlf-intro-strong { font-weight: 700; }

/* ===== 방문 희망일 셀렉 버튼 ===== */
.mlf-choice { display: grid; gap: 12px; }
.mlf-choice-btn {
  width: 100%; padding: 20px 22px; text-align: left;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--mlf-surface); color: var(--mlf-text);
  border: 1.5px solid rgba(255,255,255,0.10); border-radius: 16px;
  font-family: var(--mlf-font); cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
  -webkit-appearance: none;
}
.mlf-choice-btn:active { transform: scale(0.99); }
.mlf-choice-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mlf-choice-day { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.mlf-choice-wd { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.5); }

/* 우측 라디오 표시 */
.mlf-choice-radio {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.30); position: relative;
  transition: border-color 0.18s ease;
}
.mlf-choice-btn.is-selected { border-color: var(--mlf-accent); background: rgba(252,28,73,0.10); }
.mlf-choice-btn.is-selected .mlf-choice-wd { color: var(--mlf-accent); }
.mlf-choice-btn.is-selected .mlf-choice-radio { border-color: var(--mlf-accent); }
.mlf-choice-btn.is-selected .mlf-choice-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--mlf-accent);
}

/* ===== 달력 (다크 · is-sun/is-sat) ===== */
.mlf-cal-display {
  width: 100%; padding: 16px 18px;
  background: var(--mlf-surface); border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 14px; font-size: 16px; font-weight: 700; color: var(--mlf-text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
.mlf-cal-display::before {
  content: ''; display: inline-block; width: 18px; height: 18px; flex-shrink: 0; background: var(--mlf-accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 2a1 1 0 011 1v1h8V3a1 1 0 112 0v1h1a3 3 0 013 3v12a3 3 0 01-3 3H5a3 3 0 01-3-3V7a3 3 0 013-3h1V3a1 1 0 011-1zM5 8v11a1 1 0 001 1h12a1 1 0 001-1V8H5z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 2a1 1 0 011 1v1h8V3a1 1 0 112 0v1h1a3 3 0 013 3v12a3 3 0 01-3 3H5a3 3 0 01-3-3V7a3 3 0 013-3h1V3a1 1 0 011-1zM5 8v11a1 1 0 001 1h12a1 1 0 001-1V8H5z'/></svg>") center / contain no-repeat;
}
.mlf-cal-display.is-empty { color: rgba(255,255,255,0.40); font-weight: 500; }
.mlf-cal-display.is-error { border-color: var(--mlf-accent); background: rgba(252,28,73,0.08); }
.mlf-cal { background: var(--mlf-surface); border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; padding: 16px 14px 14px; }
.mlf-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }
.mlf-cal-nav { width: 38px; height: 38px; border: none; background: var(--mlf-surface-2); border-radius: 50%; color: var(--mlf-text); font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background 0.15s ease; }
.mlf-cal-nav:hover:not(:disabled) { background: #2c343c; }
.mlf-cal-nav:disabled { opacity: 0.28; cursor: not-allowed; }
.mlf-cal-month { font-size: 17px; font-weight: 700; color: var(--mlf-text); letter-spacing: -0.01em; }
.mlf-cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.mlf-cal-week span { text-align: center; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.56); padding: 8px 0; letter-spacing: 0.05em; }
.mlf-cal-week span:first-child { color: var(--mlf-accent); }
.mlf-cal-week span:last-child { color: var(--mlf-sat); }
.mlf-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mlf-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--mlf-font); font-size: 14px; font-weight: 600; color: var(--mlf-text);
  background: transparent; border: 1.5px solid transparent; border-radius: 10px;
  cursor: pointer; padding: 0; line-height: 1; -webkit-appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.mlf-cell:active:not(.is-disabled):not(.is-empty) { transform: scale(0.94); }
.mlf-cell.is-empty { pointer-events: none; cursor: default; }
.mlf-cell.is-sun { color: var(--mlf-sun); }
.mlf-cell.is-sat { color: var(--mlf-sat); }
.mlf-cell.is-today { border-color: var(--mlf-accent); }
.mlf-cell.is-selected { background: var(--mlf-accent); color: #fff; border-color: var(--mlf-accent); }
.mlf-cell.is-selected.is-sun, .mlf-cell.is-selected.is-sat { color: #fff; }
.mlf-cell.is-disabled { color: rgba(255,255,255,0.22); cursor: not-allowed; }
.mlf-cal-note { margin: 14px 4px 0; font-size: 12px; color: rgba(255,255,255,0.40); line-height: 1.55; }

/* ===== 하단 CTA =====
   기본: 화면 하단 고정(크롬·사파리·삼성인터넷은 키보드 위로 자동 상승).
   메타 인앱(.is-inapp): fixed가 키보드 위로 안 올라와 → 시트 흐름 안(static) + 포커스 시 .kb-open 스크롤 여백. */
.mlf-foot {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 1001;
  padding: 14px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--mlf-bg); border-top: 1px solid rgba(255,255,255,0.10);
}
.mlf-modal.is-inapp .mlf-foot { position: static; transform: none; left: auto; bottom: auto; max-width: none; z-index: auto; flex-shrink: 0; }
.mlf-kb-spacer { flex-shrink: 0; height: 0; transition: height 0.2s ease; }
.mlf-sheet.kb-open .mlf-body { flex: 0 0 auto; }
.mlf-sheet.kb-open .mlf-kb-spacer { height: 46vh; }
.mlf-cta {
  width: 100%; padding: 18px; border: none; border-radius: 16px;
  background: var(--mlf-accent); color: #fff;
  font-family: var(--mlf-font); font-size: 16.5px; font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer; box-shadow: 0 10px 26px rgba(252,28,73,0.34);
  transition: transform 0.2s ease; position: relative;
}
.mlf-cta:active { transform: scale(0.985); }
.mlf-cta.is-loading { color: transparent; pointer-events: none; }
.mlf-cta.is-loading::after {
  content: ''; position: absolute; width: 20px; height: 20px; top: 50%; left: 50%; margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: mlf-spin 0.7s linear infinite;
}
@keyframes mlf-spin { to { transform: rotate(360deg); } }

.mlf-success { text-align: center; padding: 28px 0 0; }
.mlf-success-icon { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%; background: var(--mlf-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; animation: mlf-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes mlf-pop { from { transform: scale(0); } to { transform: scale(1); } }
.mlf-success-title { font-size: 22px; font-weight: 800; color: var(--mlf-text); line-height: 1.4; margin: 0 0 20px; }
.mlf-success-desc { font-size: 14.5px; color: rgba(255,255,255,0.62); line-height: 1.72; margin: 0; }
.mlf-success-desc p { margin: 0 0 16px; }
.mlf-success-desc p:last-child { margin-bottom: 0; }
.mlf-success-thanks { font-weight: 700; color: var(--mlf-text); }

/* 완료 화면 — 혜택 목록/장소/주의문 */
.mlf-success-label { font-weight: 700; color: var(--mlf-text); margin-bottom: 8px !important; }
.mlf-success-list { list-style: none; margin: 0 0 16px; padding: 12px 14px; text-align: left; border-radius: 12px; background: rgba(255,255,255,0.06); }
.mlf-success-list li { position: relative; padding-left: 18px; margin: 0 0 6px; color: rgba(255,255,255,0.82); }
.mlf-success-list li:last-child { margin-bottom: 0; }
.mlf-success-list li::before { content: "✓"; position: absolute; left: 0; color: var(--mlf-accent); font-weight: 700; }
.mlf-success-place { font-weight: 700; color: var(--mlf-text); }
.mlf-success-note { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.6; }

/* 입력칸 아래 안내 힌트 */
.mlf-hint { margin: 8px 0 0 4px; font-size: 12.5px; line-height: 1.5; color: rgba(255,255,255,0.5); }

/* ===== STEP 1 히어로 (design-taste 정리본) =====
   한 화면 룰: 배지 → 제목 → 일시/장소 → 대표 혜택 타일 → 체크 리스트 8줄 → 신뢰 1줄 → CTA.
   액센트 1색(--mlf-accent), 라운드 14px 단일 체계, 구분선 없음, 이모지 없음. */
.mlf-modal[data-step="1"] .mlf-back { visibility: hidden; }
.mlf-modal[data-step="1"] .mlf-body { padding-top: 10px; }
.mlf-hero { text-align: center; }
.mlf-hero-badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--mlf-accent); background: rgba(252,28,73,0.12); border: 1px solid rgba(252,28,73,0.28);
}
.mlf-hero-title { margin: 12px 0 4px; font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; color: var(--mlf-text); }
.mlf-hero-meta { margin: 0 0 16px; font-size: 14px; font-weight: 500; line-height: 1.5; color: rgba(255,255,255,0.62); }
.mlf-hero-meta strong { color: var(--mlf-text); font-weight: 700; }
.mlf-hero-dot { margin: 0 7px; color: rgba(255,255,255,0.3); }

/* 대표 혜택 타일 */
.mlf-hero-feature {
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  padding: 12px 16px 13px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(252,28,73,0.16), rgba(252,28,73,0.08));
  border: 1px solid rgba(252,28,73,0.35);
}
.mlf-hero-feature-label { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.70); letter-spacing: -0.01em; }
.mlf-hero-feature-value { font-size: 17px; font-weight: 800; color: var(--mlf-text); letter-spacing: -0.02em; line-height: 1.25; }
.mlf-hero-feature-value em { font-style: normal; color: var(--mlf-accent); font-size: 21px; }

/* 체크 리스트 (구분선 없음) */
.mlf-hero-offers { list-style: none; margin: 12px 0 0; padding: 10px 14px; text-align: left;
  display: grid; gap: 5px; border-radius: 14px; background: var(--mlf-surface); }
.mlf-hero-offers li { position: relative; padding-left: 22px; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,0.86); }
.mlf-hero-offers li::before {
  content: "\2713"; position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin-top: 1px;
  border-radius: 5px; font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
  color: var(--mlf-accent); background: rgba(252,28,73,0.14);
}
.mlf-hero-offers strong { color: var(--mlf-text); font-weight: 800; }
.mlf-hero-trust { margin: 10px 0 0; font-size: 12px; line-height: 1.55; color: rgba(255,255,255,0.48); }

/* 진입 모션: 순차 페이드 (동기: 위계 순서대로 시선 유도). 모션 최소화 환경에선 정지 */
@media (prefers-reduced-motion: no-preference) {
  .mlf-step[data-step="1"].is-active .mlf-hero > * { animation: mlf-hero-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .mlf-step[data-step="1"].is-active .mlf-hero > :nth-child(2) { animation-delay: 0.04s; }
  .mlf-step[data-step="1"].is-active .mlf-hero > :nth-child(3) { animation-delay: 0.08s; }
  .mlf-step[data-step="1"].is-active .mlf-hero > :nth-child(4) { animation-delay: 0.12s; }
  .mlf-step[data-step="1"].is-active .mlf-hero > :nth-child(5) { animation-delay: 0.16s; }
  .mlf-step[data-step="1"].is-active .mlf-hero > :nth-child(6) { animation-delay: 0.20s; }
}
@keyframes mlf-hero-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 메타 인앱 폭(360~430px) 최적화 =====
   측정: 360px 폭에서 혜택 8줄은 14.5px까지 한 줄 유지 → 본문 가독성 확보.
   신뢰 문구는 12px 한 줄로 짧게, 좁은 폭(≤400px)에선 좌우 여백 24→18px로 콘텐츠 폭 확보. */
.mlf-hero-offers li { font-size: 14.5px; line-height: 1.45; padding-left: 23px; }
.mlf-hero-offers li::before { width: 17px; height: 17px; line-height: 17px; font-size: 11px; margin-top: 2px; }
.mlf-hero-offers { gap: 6px; padding: 11px 14px; }
.mlf-hero-trust { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlf-hero-feature-label { font-size: 13px; }
.mlf-hero-feature-value { font-size: 18px; }
.mlf-hero-feature-value em { font-size: 22px; }
@media (max-width: 400px) {
  .mlf-body { padding-left: 18px; padding-right: 18px; }
  .mlf-foot { padding-left: 18px; padding-right: 18px; }
  .mlf-hero-title { font-size: 26px; }
}
@media (min-width: 401px) {
  .mlf-hero-offers li { font-size: 15px; }
}

/* ===== 변형 C: 첫 화면 날짜 칩 (?f=c) ===== */
.mlf-hero-dates { margin-top: 12px; text-align: left; }
.mlf-hero-dates-label { display: block; margin: 0 0 7px 2px; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.55); letter-spacing: -0.01em; }
.mlf-hero-dates-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mlf-chip {
  height: 46px; padding: 0 10px; border-radius: 14px;
  background: var(--mlf-surface); color: var(--mlf-text);
  border: 1.5px solid rgba(255,255,255,0.12);
  font-family: var(--mlf-font); font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  cursor: pointer; -webkit-appearance: none; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}
.mlf-chip small { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.55); margin-left: 2px; }
.mlf-chip:active { transform: scale(0.98); }
.mlf-chip.is-selected { border-color: var(--mlf-accent); background: rgba(252,28,73,0.12); }
.mlf-chip.is-selected small { color: var(--mlf-accent); }
.mlf-hero-dates .mlf-err { margin-left: 2px; }
.mlf-modal.is-variant-c .mlf-hero-trust { margin-top: 8px; }
