/**
 * 로그인 모달 — 첨부 시안(stitch_mo_login_new) 기준
 *
 * 색은 테마 토큰(_tokens.css)을 우선 쓴다. 시안의 크림슨(#E52549)과
 * 테마 기본색(#e53935)이 미세하게 다른데, 사이트에 빨강이 두 종류 생기는 편이
 * 시안과 몇 포인트 어긋나는 것보다 나쁘다.
 *
 * z-index: 모바일 메뉴가 9998/9999 를 쓴다. 모달은 그 위에 와야 한다.
 */

.intra-lm {
  --lm-red: var(--color-primary, #e53935);
  --lm-ink: #1e2024;
  --lm-muted: #717680;
  --lm-line: #e5e7eb;
  --lm-placeholder: #b0b6c0;

  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}

.intra-lm[hidden] { display: none !important; }

.intra-lm__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .22s ease;
}

.intra-lm__panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 26px;
  background: var(--color-white, #fff);
  border-radius: 28px;
  box-shadow: 0 18px 40px -8px rgba(15, 23, 42, .32);
  color: var(--lm-ink);
  font-size: 14px;
  line-height: 1.6;
  transform: translateY(12px) scale(.97);
  opacity: 0;
  transition: transform .24s cubic-bezier(.2, .9, .3, 1), opacity .2s ease;
}

.intra-lm.is-open .intra-lm__scrim { opacity: 1; }
.intra-lm.is-open .intra-lm__panel { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .intra-lm__scrim,
  .intra-lm__panel { transition-duration: .01ms; }
}

/* 배경 스크롤 잠금 — 모바일 메뉴의 .mm-lock 과 같은 방식 */
body.intra-lm-lock {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* ── 공통 ── */
.intra-lm svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.intra-lm__sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intra-lm :focus-visible {
  outline: 2px solid var(--lm-red);
  outline-offset: 2px;
}

/* ── 닫기 ── */
.intra-lm__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  padding: 7px;
  border: 0;
  background: none;
  color: #b6bcc6;
  border-radius: 50%;
  cursor: pointer;
}
.intra-lm__close:hover { color: var(--lm-muted); }

/* ── 로고 ── */
.intra-lm__logo {
  margin: 4px 0 20px;
  padding: 0;
  border: 0;
  text-align: center;
  line-height: 0;
}
.intra-lm__logo img {
  height: 20px;
  width: auto;
  max-width: 78%;
  display: inline-block;
}

/* ── 진입 사유 ── */
.intra-lm__reason {
  margin: -10px 0 18px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lm-red);
}
.intra-lm__reason[hidden] { display: none !important; }

/* ── 입력 ── */
.intra-lm__field { margin-bottom: 13px; }

.intra-lm__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #3f4651;
}

.intra-lm__field input[type="text"],
.intra-lm__field input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;          /* 16px 미만이면 iOS 가 확대한다 — 아래 미디어쿼리에서 올린다 */
  color: var(--lm-ink);
  background: var(--color-white, #fff);
  border: 1px solid #dfe3e9;
  border-radius: 12px;
  box-shadow: none;
}

.intra-lm__field input::placeholder { color: var(--lm-placeholder); }

.intra-lm__field input:focus {
  outline: none;
  border-color: var(--lm-red);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .13);
}

/* iOS 는 폰트가 16px 미만인 입력칸에 포커스되면 화면을 확대한다 */
@media (max-width: 767px) {
  .intra-lm__field input[type="text"],
  .intra-lm__field input[type="password"] { font-size: 16px; }
}

.intra-lm__pw { position: relative; display: flex; align-items: center; }
.intra-lm__pw input { padding-right: 44px; }

.intra-lm__eye {
  position: absolute;
  right: 12px;
  width: 24px; height: 24px;
  padding: 2px;
  border: 0;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
}
.intra-lm__eye[aria-pressed="true"] { color: var(--lm-muted); }
.intra-lm__eye svg[hidden] { display: none !important; }

/* ── 옵션 줄 ── */
.intra-lm__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 16px;
  font-size: 12px;
}

.intra-lm__keep {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: #3f4651;
  cursor: pointer;
  margin: 0;
}

.intra-lm__keep input {
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--lm-red);
}

.intra-lm__find {
  font-weight: 700;
  color: var(--lm-red);
  text-decoration: none;
  white-space: nowrap;
}
.intra-lm__find:hover { text-decoration: underline; }

/* ── 제출 ── */
.intra-lm__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  background: var(--lm-red);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(229, 57, 53, .5);
  transition: transform .1s ease, opacity .15s ease;
}
.intra-lm__submit:active { transform: scale(.99); }
.intra-lm__submit[disabled] { opacity: .75; cursor: default; }

.intra-lm__spin {
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: intra-lm-spin .7s linear infinite;
}
@keyframes intra-lm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .intra-lm__spin { animation-duration: 2s; }
}

.intra-lm__error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fef2f3;
  color: #b4273f;
  font-size: 12px;
  font-weight: 600;
}
.intra-lm__error[hidden] { display: none !important; }

/* ── SNS ── */
.intra-lm__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
}
.intra-lm__divider::before,
.intra-lm__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--lm-line);
}
.intra-lm__divider span {
  font-size: 10.5px;
  font-weight: 600;
  color: #a7adb8;
}

.intra-lm__sns {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.intra-lm__sns-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  padding: 11px;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
  transition: transform .1s ease, opacity .15s ease;
}
.intra-lm__sns-btn:active { transform: scale(.95); }
.intra-lm__sns-btn:hover { opacity: .9; }

.intra-lm__sns-btn--kakao { background: #fee500; color: #191919; }
.intra-lm__sns-btn--kakao svg { fill: currentColor; stroke: none; }

.intra-lm__sns-btn--naver { background: #03c75a; color: #fff; padding: 13px; }
.intra-lm__sns-btn--naver svg { fill: currentColor; stroke: none; }

.intra-lm__sns-btn--google { background: #fff; border: 1px solid var(--lm-line); padding: 10px; }
.intra-lm__sns-btn--google svg { stroke: none; }

/* ── 푸터 ── */
.intra-lm__foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: #5b6472;
}
.intra-lm__foot a {
  margin-left: 4px;
  font-weight: 700;
  color: var(--lm-red);
  text-decoration: none;
  white-space: nowrap;
}
.intra-lm__foot a:hover { text-decoration: underline; }
