/* ============================================================
   메타 신청폼 — 다크 풀스크린 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="4"] .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: 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); }

/* ===== 허니팟(봇 차단) — 화면/스크린리더 모두에서 숨김 ===== */
.mlf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ===== 개인정보 수집·이용 동의 ===== */
.mlf-consent { margin: 18px 0 2px; }
.mlf-consent-row { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.mlf-consent-check { flex-shrink: 0; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--mlf-accent); cursor: pointer; }
.mlf-consent-text { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.72); }
.mlf-consent-text b { color: var(--mlf-accent); font-weight: 700; }
.mlf-consent-link { color: rgba(255,255,255,0.5); text-decoration: underline; margin-left: 2px; }
.mlf-consent-detail { margin: 10px 0 0 27px; padding: 12px 14px; background: var(--mlf-surface); border-radius: 12px; font-size: 12px; line-height: 1.7; color: rgba(255,255,255,0.56); }
.mlf-consent .mlf-err { margin-left: 27px; }

/* ===== 행사 소개 (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); }
