/*
 * 공용 로그인 모달
 * 홈과 모든 서브 페이지에서 js/login_modal.js가 동일한 마크업을 생성합니다.
 * 페이지별 스타일과 충돌하지 않도록 모든 선택자는 login_modal 범위로 제한합니다.
 */
.login_modal_active,
.mobile_menu_active {
  overflow: hidden;
}

.login_modal,
.login_modal *,
.login_modal *::before,
.login_modal *::after {
  box-sizing: border-box;
}

.login_modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--font_body, "Noto Serif KR", "Gowun Batang", serif);
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms ease, visibility 350ms ease;
}

.login_modal.login_modal_open {
  opacity: 1;
  visibility: visible;
}

.login_modal_backdrop {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(13, 20, 37, 0.68);
  backdrop-filter: blur(5px);
}

/* 예전 배경 이미지용 요소입니다. 마크업 호환성을 위해 남기되 표시하지 않습니다. */
.login_modal_scenery {
  display: none;
}

.login_modal_panel {
  position: relative;
  z-index: 2;
  isolation: isolate;
  width: min(450px, calc(100vw - 48px));
  max-height: calc(100svh - 48px);
  overflow: auto;
  padding: 24px 46px 34px;
  border: 1px solid rgba(112, 85, 54, 0.3);
  color: #17223d;
  background: linear-gradient(rgba(255, 252, 244, 0.97), rgba(247, 239, 221, 0.98));
  box-shadow: 0 24px 70px rgba(8, 13, 25, 0.34);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 350ms ease,
    transform 500ms var(--motion_ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.login_modal_panel::before {
  position: absolute;
  z-index: -1;
  inset: 9px;
  border: 1px dashed rgba(112, 85, 54, 0.45);
  content: "";
  pointer-events: none;
}

.login_modal_open .login_modal_panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.login_modal_top {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 38px;
  margin-bottom: -2px;
  align-items: center;
  justify-content: space-between;
}

.login_modal_brand {
  color: #9d3938;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.login_modal_close {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  color: rgba(23, 34, 61, 0.72);
  background: transparent;
  cursor: pointer;
  transition:
    color 200ms ease,
    transform 200ms ease;
}

.login_modal_close::before,
.login_modal_close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.login_modal_close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.login_modal_close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.login_modal_close:hover,
.login_modal_close:focus-visible {
  color: #9d3938;
  outline: none;
  transform: rotate(90deg);
}

.login_modal_heading {
  text-align: center;
}

.login_modal_logo {
  display: block;
  width: 86px;
  height: 86px;
  margin: -18px auto 7px;
  background: url("../images/logo/intro_ju_circle.png") center / contain no-repeat;
  transform: scale(1.18);
}

.login_modal_kicker {
  margin: 0 0 6px;
  color: #9d3938;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login_modal_panel h2 {
  margin: 0 0 8px;
  color: #17223d;
  font-family: var(--font_title, "Noto Serif KR", serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login_modal_description {
  margin: 0 0 24px;
  color: #65645f;
  font-size: 13px;
  line-height: 1.7;
}

.login_modal_form {
  display: grid;
  gap: 18px;
}

.login_modal_form label,
.login_modal_form label span {
  display: block;
}

.login_modal_form label span {
  margin-bottom: 7px;
  color: #5f5b52;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.login_modal_form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(112, 85, 54, 0.24);
  border-radius: 0;
  outline: none;
  color: #17223d;
  background: rgba(255, 255, 255, 0.42);
  font: inherit;
  font-size: 14px;
  transition: border-color 250ms ease, box-shadow 250ms ease;
}

.login_modal_form input::placeholder {
  color: rgba(77, 74, 68, 0.48);
}

.login_modal_form input:focus {
  border-color: #9d3938;
  box-shadow: 0 0 0 2px rgba(157, 57, 56, 0.1);
}

.login_modal_password {
  position: relative;
}

.login_modal_password input {
  padding-right: 58px;
}

.login_password_toggle {
  position: absolute;
  right: 10px;
  bottom: 11px;
  padding: 3px 0 3px 12px;
  border: 0;
  color: #9d3938;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.login_modal_submit {
  min-height: 48px;
  margin-top: 7px;
  border: 1px solid #17223d;
  border-radius: 0;
  color: #fff;
  background: #17223d;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 250ms ease, border-color 250ms ease, transform 250ms ease;
}

.login_modal_submit:hover,
.login_modal_submit:focus-visible {
  border-color: #9d3938;
  background: #9d3938;
  transform: translateY(-2px);
}

.login_modal_demo_message {
  margin: -4px 0 0;
  color: #777064;
  font-size: 11px;
  text-align: center;
}

.login_modal_demo_message[hidden] {
  display: none;
}

.login_modal_join_area {
  display: flex;
  margin-top: 20px;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login_modal_join_text {
  margin: 0;
  color: #777064;
  font-size: 11px;
}

.login_modal_join {
  border-bottom: 1px solid rgba(157, 57, 56, 0.4);
  color: #9d3938;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 520px) {
  .login_modal {
    padding: 18px;
  }

  .login_modal_panel {
    width: 100%;
    max-height: calc(100svh - 36px);
    padding: 20px 25px 28px;
  }

  .login_modal_logo {
    width: 76px;
    height: 76px;
    margin-top: -14px;
  }

  .login_modal_panel h2 {
    font-size: 32px;
  }

  .login_modal_join_area {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login_modal,
  .login_modal_panel,
  .login_modal_submit {
    transition-duration: 0.01ms;
  }
}
