/* ============================================================
   로그인 화면 이용가이드 — 좌: 현장 영상 / 우: 앱 화면 가이드
   2026-10-10 신규. 기준: assets/login-guide/login-guide-mockup.html
   색·글꼴은 시안 근사치 대신 실제 앱 토큰(style.css :root)과
   기존 .lp-side 네이비 팔레트를 사용한다.
   ============================================================ */

/* ── 1157px 이하에서는 좌·우 패널을 숨긴다 ─────────────────────
   3열이 들어가는 최소 폭 = 304 + 462 + 304 + gap 48 + padding 40 = 1158px.
   (preview_images.js 제거로 사라진 app_v38.js applyLayout()의 역할을 대신한다) */
@media (max-width: 1157px) {
  #lp-side-left, #lp-side-right { display: none !important; }
}

/* 1158~1199px 구간은 폭 여유가 2px뿐이고, 윈도우/리눅스의 세로 스크롤바(약 15px)까지
   감안하면 3열이 .app-container(overflow:hidden) 밖으로 밀린다.
   이 구간에서만 wrapper의 gap·좌우 padding을 줄여 24px 여유를 만든다. */
@media (min-width: 1158px) and (max-width: 1199px) {
  #loginPageWrapper { gap: 16px !important; padding-left: 16px !important; padding-right: 16px !important; }
}

/* ── 좌측: 현장 영상 ─────────────────────────────────────────── */
#lp-side-left { padding: 0; overflow: hidden; position: relative; }
#lgVideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  background: #2E4260;
}

/* ── 우측: 앱 화면 가이드 ────────────────────────────────────── */
#lp-side-right, #lgTour {
  --lg-num: "SF Mono", "Roboto Mono", ui-monospace, Menlo, monospace;
}
#lp-side-right {
  padding: 32px 22px 18px;
  gap: 0;
}

/* 진행 표시 */
.lg-steps { display: flex; align-items: center; gap: 10px; }
.lg-stepnum { font: 600 11px/1 var(--lg-num); color: #94A3B8; font-variant-numeric: tabular-nums; min-width: 30px; }
.lg-bar { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lg-bar i { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.14); overflow: hidden; display: block; }
.lg-bar i b { display: block; height: 100%; width: 0; background: #60A5FA; }

/* 장면 공통 */
.lg-scenes { position: relative; flex: 1; margin-top: 20px; min-height: 0; }
.lg-scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity .55s ease; pointer-events: none;
}
.lg-scene.on { opacity: 1; }
.lg-eyebrow { font-size: 11px; font-weight: 600; color: #60A5FA; letter-spacing: 0.02em; }
.lg-scene h2 { font-size: 19px; line-height: 1.35; margin: 6px 0 4px; font-weight: 700; color: #F1F5F9; letter-spacing: -0.01em; }
.lg-sub { font-size: 12.5px; line-height: 1.5; color: #CBD5E1; margin: 0; }
.lg-sub.cta { color: #93C5FD; font-weight: 700; }
.lg-frag { margin-top: 16px; flex: 1; display: flex; align-items: flex-start; min-height: 0; }

/* 네이비 패널 위에 뜨는 흰 카드 */
.lg-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  color: #334155;
}
.lg-ct { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--secondary); }
.lg-ct b { font-size: 13px; color: #1e293b; }
.lg-num { font-family: var(--lg-num); font-variant-numeric: tabular-nums; }

/* 하단 문의 (고정) */
.lg-contact {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px; margin-top: 12px;
  font-size: 10px; line-height: 1.5; font-weight: 600;
  color: #94A3B8; text-align: center;
}
.lg-contact b { color: #F1F5F9; font-weight: 700; letter-spacing: 0.02em; }

/* ── 장면 1: 명세서 발행 ─────────────────────────────────────── */
.lg-sel {
  height: 34px; border: 1px solid var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; font-size: 12.5px; background: #f8fafc;
}
.lg-sel svg { width: 14px; height: 14px; stroke: var(--secondary); flex: none; }
.lg-rows { display: flex; flex-direction: column; }
.lg-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.lg-qty {
  min-width: 52px; height: 26px;
  border: 1px solid var(--border); border-radius: 4px;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 8px; font-size: 12.5px; color: var(--secondary);
  transition: border-color .2s, background .2s, color .2s;
}
.lg-qty.typing { border-color: var(--accent); background: #e8f7fe; color: #1e293b; }
.lg-qty.done { color: #1e293b; }
.lg-tot { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: #1e293b; }
.lg-btn {
  height: 38px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 600;
  background: var(--accent); color: #fff;
  transition: transform .15s, background .3s;
}
.lg-btn.press { transform: scale(.97); }
.lg-btn.ok { background: var(--success); }
.lg-btn svg { width: 15px; height: 15px; stroke: #fff; }

/* ── 장면 2: 명세서 목록 ─────────────────────────────────────── */
.lg-list { display: flex; flex-direction: column; }
.lg-li {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center;
  font-size: 12px; border-bottom: 1px solid var(--border);
  max-height: 0; opacity: 0; overflow: hidden; padding-block: 0;
  transition: max-height .45s ease, opacity .45s ease, padding .45s ease, background .8s;
}
.lg-li.show { max-height: 40px; opacity: 1; padding-block: 8px; }
.lg-li.fresh { background: #e8f7fe; }
.lg-li .t { color: var(--secondary); font-family: var(--lg-num); font-size: 11px; }
.lg-li .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-li .a { text-align: right; }

/* ── 장면 3: 월정산 발송 ─────────────────────────────────────── */
.lg-chk {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #cbd5e1; flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.lg-chk svg { width: 11px; height: 11px; stroke: #fff; opacity: 0; }
.lg-chk.on { background: var(--primary); border-color: var(--primary); }
.lg-chk.on svg { opacity: 1; }
.lg-mrow { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lg-mrow .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: #ecfdf5; color: var(--success); font-weight: 600; opacity: 0; transition: opacity .3s; }
.lg-badge.on { opacity: 1; }

/* ── 장면 4: 알림톡 ──────────────────────────────────────────── */
.lg-phone { width: 200px; margin: 0 auto; border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 10px; background: #b2c7d9; }
.lg-bar2 { font: 600 9.5px/1 var(--lg-num); color: #3b4a5a; display: flex; justify-content: space-between; padding: 2px 6px 10px; }
.lg-bubble {
  background: #fff; border-radius: 10px; overflow: hidden;
  font-size: 11px; line-height: 1.5;
  transform: translateY(14px); opacity: 0;
  transition: transform .5s ease, opacity .5s ease;
}
.lg-bubble.on { transform: none; opacity: 1; }
.lg-bh { background: #FEE500; color: #191600; font-weight: 700; padding: 7px 10px; font-size: 10.5px; }
.lg-bb { padding: 10px; color: #222; display: flex; flex-direction: column; gap: 4px; }
.lg-bb b { font-size: 11.5px; }
.lg-bt { margin: 0 10px 10px; border: 1px solid #e3e3e3; border-radius: 6px; text-align: center; padding: 7px 0; font-weight: 600; font-size: 11px; transition: background .2s; }
.lg-bt.tap { background: #eef0f2; }
.lg-recv {
  margin-top: 12px; display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: #334155;
}
.lg-st { font-size: 10.5px; padding: 2px 7px; border-radius: 4px; background: #f1f5f9; color: var(--secondary); font-weight: 600; transition: background .3s, color .3s; }
.lg-st.ok { background: #ecfdf5; color: var(--success); }

/* ── 장면 5: 매출 ────────────────────────────────────────────── */
.lg-big { font: 700 24px/1.1 var(--lg-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--primary); }
.lg-big small { font: 600 12.5px 'Pretendard', sans-serif; margin-left: 2px; color: var(--secondary); }
.lg-delta { font-size: 11px; color: var(--success); font-weight: 600; opacity: 0; transition: opacity .4s; }
.lg-delta.on { opacity: 1; }
.lg-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 118px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.lg-chart i { display: block; background: #cfe3f3; border-radius: 4px 4px 0 0; height: 0; }
.lg-chart i.last { background: var(--primary); }
.lg-axis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; font-size: 10.5px; color: var(--secondary); text-align: center; }

/* ── 모션 최소화 설정 ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lg-scene, .lg-bubble, .lg-li, .lg-qty, .lg-btn, .lg-badge, .lg-delta, .lg-st, .lg-bt, .lg-chk { transition: none !important; }
}


/* ============================================================
   모바일 "1분 둘러보기" — 버튼 + 스토리 오버레이
   2026-10-10. 기준: assets/login-guide/mobile-mockup.html 1번(스토리형)
   데스크톱(1158px 이상) 로그인 화면 동작에는 영향 없음.
   ============================================================ */

/* ── 로그인 버튼 아래 둘러보기 버튼 (1157px 이하에서만) ────── */
.lg-tour-btn { display: none; }

@media (max-width: 1157px) {
  .lg-tour-btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; margin-top: 10px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    font-family: inherit; color: inherit; text-align: left; cursor: pointer;
  }
  .lg-tour-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
.lg-tour-btn .lg-tour-play {
  width: 38px; height: 38px; border-radius: 50%; background: #2E4260;
  display: flex; align-items: center; justify-content: center; flex: none;
  animation: lgTourPulse 2.4s ease-in-out infinite;
}
.lg-tour-btn .lg-tour-play svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }
.lg-tour-btn b { display: block; font-size: 14px; font-weight: 700; color: #1e293b; }
.lg-tour-btn span.lg-tour-sub { display: block; font-size: 12px; color: var(--secondary); margin-top: 1px; }
@keyframes lgTourPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,168,232,0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(0,168,232,0); }
}

/* ── 스토리 오버레이 ─────────────────────────────────────── */
#lgTour {
  position: fixed; inset: 0; z-index: 10000;
  background: #0b1320; overscroll-behavior: contain;
}
#lgTour[hidden] { display: none !important; }
.lgt-frame {
  position: relative; height: 100%; width: 100%;
  max-width: 460px; margin: 0 auto; overflow: hidden; background: #0b1320;
}
.lgt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lgt-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(11,19,32,0.45) 0%, rgba(11,19,32,0) 18%, rgba(11,19,32,0) 34%,
    rgba(20,32,52,0.88) 56%, rgba(30,45,70,0.97) 100%);
}
.lgt-bars {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; z-index: 3;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.lgt-bars i { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); overflow: hidden; display: block; }
.lgt-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.lgt-who {
  position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 16px); left: 16px; z-index: 3;
  font-size: 12px; font-weight: 600; color: #fff; opacity: 0.9;
}
.lgt-close {
  position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 8px); right: 10px; z-index: 5;
  width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lgt-close svg { width: 22px; height: 22px; stroke: #fff; }
.lgt-close:focus-visible { outline: 2px solid #fff; border-radius: 8px; }
.lgt-zone {
  position: absolute; top: 90px; bottom: 0; z-index: 2;
  border: 0; background: transparent; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.lgt-zone:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: -4px; }
.lgt-prev { left: 0; width: 35%; }
.lgt-next { right: 0; width: 65%; }

.lgt-stack {
  position: absolute; left: 16px; right: 16px; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 1;
  height: 430px;
}
/* 데스크톱 패널에서 복제해 온 장면을 모바일 스토리용으로 재배치 */
#lgTour .lg-scene { position: absolute; inset: auto 0 0 0; }
#lgTour .lg-scene h2 { font-size: 21px; line-height: 1.3; margin: 4px 0 2px; }
#lgTour .lg-eyebrow { font-size: 12px; color: #7cc8f0; }
#lgTour .lg-sub { font-size: 13px; color: #c3cfdf; }
#lgTour .lg-sub.cta { color: #7cc8f0; }
#lgTour .lg-frag { flex: none; margin-top: 12px; }
#lgTour .lg-card { box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 10px 24px rgba(0,0,0,0.3); }
#lgTour .lg-phone { border-color: rgba(255,255,255,0.18); }

/* 마지막 화면 */
.lgt-end {
  position: absolute; inset: 0; z-index: 6; display: none;
  flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 0 20px max(34px, env(safe-area-inset-bottom));
  background: rgba(15,25,42,0.92);
}
.lgt-end.on { display: flex; }
.lgt-end h3 { margin: 0 0 4px; color: #fff; font-size: 22px; line-height: 1.35; font-weight: 700; }
.lgt-end p { margin: 0 0 10px; color: #c3cfdf; font-size: 13.5px; line-height: 1.6; }
.lgt-go {
  height: 50px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font: 700 15.5px 'Pretendard', sans-serif;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lgt-replay {
  height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.25);
  background: transparent; color: #fff; font: 600 14px 'Pretendard', sans-serif; cursor: pointer;
}
.lgt-go:focus-visible, .lgt-replay:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 스토리가 열려 있는 동안 뒤 화면 스크롤 차단 */
body.lg-tour-open { overflow: hidden !important; }

/* 화면이 짧을 때 카드가 잘리지 않도록 */
@media (max-height: 700px) {
  .lgt-stack { height: 380px; }
  #lgTour .lg-scene h2 { font-size: 19px; }
  #lgTour .lg-card { padding: 12px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-tour-btn .lg-tour-play { animation: none; }
  #lgTour .lg-scene { transition: none !important; }
}

/* ============================================================
   모바일(768px 이하) 로그인 화면 여백 정리 — 2026-10-10
   갤럭시(삼성 인터넷) 실기기 기준. 데스크톱(769px 이상)에는 영향 없음.
   인라인 style과 style.css의 !important 규칙을 덮어야 해서 !important를 쓴다.
   ============================================================ */
@media (max-width: 768px) {

  /* 1. 상단 헤더: 글자 크기는 두고 위아래 빈 공간만 절반으로
        (기존 padding 12px + h2 기본 margin 19.9px = 위아래 약 32px → 약 16px) */
  .header { padding: 6px 16px !important; }
  .header h2 { margin: 10px 0 !important; }

  /* 3. 바깥 여백 */
  .view { padding: 8px !important; }
  #loginPageWrapper { padding: 6px 12px 12px !important; }
  .login-box { padding: 18px 16px !important; }

  /* 3. 카드 안쪽 간격 */
  .login-box h3 { margin-bottom: 10px !important; }
  .login-box > p { margin: -4px 0 8px 0 !important; }

  /* 2. 안내 박스: 360px에서도 두 줄이 각각 한 줄에 들어가게 */
  .login-box .login-hint {
    padding: 9px 10px !important;
    margin-bottom: 10px !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  /* 3. 입력 요소 간격 — 손가락 터치 영역은 44px 이상 유지 */
  #customDropdown { margin-bottom: 8px !important; }
  #dropdownBtn { padding: 12px !important; }
  .login-box input[type="text"],
  .login-box input[type="password"] { margin: 6px 0 !important; padding: 13px 14px !important; }
  .login-box label { margin: 0 0 8px 2px !important; }

  /* style.css의 .btn { padding:6px 8px; font-size:10px } 가 로그인 화면 버튼까지
     줄여버려 높이가 24px밖에 안 됐다. 로그인 박스 안에서만 되돌린다. */
  .login-box .btn { padding: 13px !important; font-size: 15px !important; }
  .login-box .btn.btn-neutral[onclick*="openRegisterModal"] { padding: 13px !important; font-size: 13.5px !important; }

  /* 둘러보기 버튼 */
  .lg-tour-btn { margin-top: 8px !important; padding: 10px 12px !important; }
  .lg-tour-btn .lg-tour-play { width: 34px; height: 34px; }

  /* 비밀번호 찾기 */
  .login-box > div[style*="text-align:center"] { margin-top: 12px !important; }
}
