/* ============================================================
   메타 신청폼 — 다크 풀스크린 4-스텝 (행사소개 → 방문희망일 → 전화번호 → 완료)
   메타(인스타·페북) 인앱 브라우저 최적화. 색/폰트는 :root에서 오버라이드.
   ============================================================ */
/* Pretendard 웹폰트 로드 — 기기 기본폰트 대신 선명한 한글 본문 폰트 (dynamic-subset: 쓰인 글자만 다운로드) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
: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;
}
/* STEP 1(행사소개)·STEP 4(완료)에서는 뒤로가기 숨김 + 자리도 접음 (상단 빈 공간 제거) */
.mlf-modal[data-step="1"] .mlf-back,
.mlf-modal[data-step="4"] .mlf-back { display: none; }

.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: 66%; }
.mlf-modal[data-step="3"] .mlf-progress-fill,
.mlf-modal[data-step="4"] .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; font-family: var(--mlf-font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; word-break: keep-all;
  padding: 26px 0 22px;           /* 진행바 아래·CTA 위 여백을 비슷하게 → 상하 균형 */
}
/* 위계: 제목(흰·800) > 부제(흰·600, 핵심은 강조색) > 🤍소제목(흰·700) > 목록(흰·500) > 보조 문단(연한 흰) > ※안내(더 연함·작게) */
.mlf-intro-heading {
  margin: 0 0 12px; font-size: 25px; font-weight: 800;
  color: var(--mlf-text); line-height: 1.3; letter-spacing: -0.015em;
}
.mlf-intro-sub {
  margin: 0; font-size: 16px; font-weight: 600; line-height: 1.55;
  color: var(--mlf-text);
}
.mlf-intro-em { color: var(--mlf-accent); font-weight: 800; }            /* 핵심 문구 강조(50쌍 한정 등) */
.mlf-intro-text {
  margin: 22px 0 0; font-size: 15.5px; font-weight: 500; line-height: 1.7;
  letter-spacing: -0.01em; color: var(--mlf-text);
}
.mlf-intro-desc { font-size: 15px; color: rgba(255,255,255,0.78); }      /* 보조 설명 문단: 한 톤 낮춤 */
.mlf-intro-strong {
  margin-top: 30px; font-weight: 700; font-size: 16.5px; line-height: 1.5; letter-spacing: -0.005em;
  color: var(--mlf-text);
}
.mlf-intro-strong + .mlf-intro-text { margin-top: 8px; line-height: 1.55; }  /* 소제목 바로 아래 평문 목록(예비) */
/* 혜택 목록 카드(B안): 반투명 박스 + 빨간 체크 불릿, 좌측 정렬 */
.mlf-benefits {
  list-style: none; margin: 12px 0 0; padding: 14px 16px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  text-align: left; font-size: 15.5px; font-weight: 500; line-height: 1.6; letter-spacing: -0.01em;
  color: var(--mlf-text);
}
.mlf-benefits li { display: flex; align-items: flex-start; gap: 10px; }
.mlf-benefits li + li { margin-top: 3px; }
.mlf-benefits li::before { content: "✓"; flex: 0 0 auto; color: var(--mlf-accent); font-weight: 800; }
.mlf-intro-notice {
  margin-top: 30px; font-size: 13px; font-weight: 500; line-height: 1.65;
  color: rgba(255,255,255,0.62);
}

/* ===== 방문 희망일 셀렉 버튼 ===== */
.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; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mlf-choice-wd { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.5); }
/* 특별 주말 배지 (브랜드웨딩데이 등) */
.mlf-choice-badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.2; letter-spacing: 0;
  color: #fff; background: linear-gradient(90deg, var(--mlf-accent), #d6249f);
}
/* 휴무 주말: 선택 불가 + 흐리게 + 라디오 숨김 */
.mlf-choice-btn.is-closed { opacity: 0.45; cursor: not-allowed; }
.mlf-choice-btn.is-closed:active { transform: none; }
.mlf-choice-btn.is-closed .mlf-choice-day { text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.5); }
.mlf-choice-btn.is-closed .mlf-choice-radio { visibility: hidden; }

/* 우측 라디오 표시 */
.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); } }
/* 완료 헤더(V3): 제목은 가벼운 라벨, 이름·날짜가 메인 정보 */
.mlf-success-title { font-size: 17px; font-weight: 600; color: rgba(255,255,255,0.7); line-height: 1.4; margin: 0 0 10px; }
.mlf-success-date { margin: 0; font-size: 21px; font-weight: 800; color: var(--mlf-text); line-height: 1.35; letter-spacing: -0.01em; }
.mlf-success-date small { display: block; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.45); margin-top: 6px; letter-spacing: 0; }
.mlf-success-date small:empty { display: none; }
/* 완료 안내 표: 라벨(좌) + 내용(우), 얇은 구분선. 색은 ✓·CTA에만 */
.mlf-next { margin-top: 28px; text-align: left; border-top: 1px solid rgba(255,255,255,0.10); border-bottom: 1px solid rgba(255,255,255,0.10); }
.mlf-next-row { display: flex; gap: 14px; padding: 14px 2px; align-items: flex-start; }
.mlf-next-row + .mlf-next-row { border-top: 1px solid rgba(255,255,255,0.07); }
.mlf-next-k { flex: 0 0 64px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.42); padding-top: 2px; }
.mlf-next-v { flex: 1; font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,0.9); }
.mlf-next-v b { color: var(--mlf-text); font-weight: 700; }
.mlf-next-v small { display: block; font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.mlf-next-v a { color: rgba(255,255,255,0.78); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.3); }
.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); }
