/* ==========================================================================
   마이페이지 — 레거시(frontend/php_website/html/mypage.php + m/mypage.php) 디자인 계승.
   결제카드 등록/비밀번호변경 등 모달 내부 공통 요소(.inputCover/.passwordToggle/.alertText/
   .btnArea/.cardForm/.customer-type-toggle/.form-mpRow/.modal-*)는 subscribe.css가 이미
   동일한 값으로 스코프 없이 정의해두었으므로 그대로 재사용한다(반드시 subscribe.css 다음에
   로드) — 여기서는 mypage 전용 레이아웃/토글스위치/모달 하단버튼만 추가한다.
   브레이크포인트는 사이트 전역 기준과 동일하게 960px 사용.
   ========================================================================== */

.mpLayout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  color: var(--sb-text);
}

.mpTitle {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 15px;
}

.mypageArea {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 2.5% auto 0;
}

.mypageArea > div > div {
  border-top: 1px solid var(--sb-border-light);
  padding-top: 10px;
  margin-bottom: 12px;
}

.mypageArea h5 {
  font-size: 16px;
  font-weight: 700;
  padding: 0 0 14px;
  margin: 0;
}

.mypageArea .mpRow {
  display: grid;
  grid-template-columns: 35% 60%;
  grid-gap: 5%;
  margin: 0 auto;
  justify-content: center;
  align-items: center;
}

.mypageArea .mpRow > div {
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.mypageArea .mpRow > div > h6 {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  margin: 0;
}

.mypageArea .mpRow > div > button { width: 100%; }
.mypageArea .mpRow > div:first-child > h6 { font-weight: 700; }

.mypageArea .mpBtnArea {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.mypageArea .mpBtnArea > a { text-decoration: none; }

.mypageArea button {
  padding: 7px 14px;
  border: 0;
  color: #fff;
  font-size: 14px;
  border-radius: 5px;
  background: var(--sb-text);
  cursor: pointer;
}

.mypageArea button:disabled { background: var(--sb-border-light); cursor: not-allowed; }

.mypageArea #downloadPaymentHistoryBtn,
.mypageArea #viewReceiptsBtn {
  display: inline-block;
  padding: 6px 14px;
  background-color: #fff;
  color: var(--sb-text);
  border: 1px solid var(--sb-input-border);
  margin-top: 13px;
  margin-right: 10px;
}

/* ---------------- 마케팅 정보 수신 설정 ---------------- */

.mp-consent-row { display: flex; align-items: center; justify-content: space-between; }
.mp-consent-note { font-size: 13px; color: var(--sb-text-soft); margin: 6px 0 0; }

/* 토글 스위치 (Bootstrap custom-switch 대체, 값은 실제 4.5.2 소스 기준) */
.mp-switch { position: relative; display: inline-block; width: 28px; height: 16px; flex: 0 0 auto; }
.mp-switch input {
  position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1;
}
.mp-switch .mp-switch-track {
  position: absolute; inset: 0; background: #fff; border: 1px solid #adb5bd; border-radius: 8px;
  transition: background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.mp-switch .mp-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #adb5bd; transition: transform .15s ease-in-out, background-color .15s ease-in-out;
}
.mp-switch input:checked + .mp-switch-track { background: #007bff; border-color: #007bff; }
.mp-switch input:checked + .mp-switch-track::after { background: #fff; transform: translateX(12px); }

/* ---------------- 휴대폰 번호 변경 모달 (#info-step 패턴과 동일한 구조) ---------------- */

#changePhoneNumberModal .formArea { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 16px; }
#changePhoneNumberModal .formArea:first-of-type { margin-top: 0; }
#changePhoneNumberModal .formArea > label { font-size: 14px; font-weight: 700; }

#changePhoneNumberModal .bnBox { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
#changePhoneNumberModal .bnBox input { flex: 1 1 0; min-width: 60px; }

#changePhoneNumberModal .formArea input {
  height: 42px; background: #fff; box-sizing: border-box; border: 1px solid var(--sb-input-border);
  border-radius: 5px; padding: 0 12px; font-size: 14px; font-family: inherit; text-align: center;
}
#changePhoneNumberModal .formArea input:disabled { background: #f3f3f3; }

#changePhoneNumberModal .authRow { display: flex; align-items: flex-start; gap: 8px; }
#changePhoneNumberModal .authRow > input { flex: 1 1 auto; min-width: 0; text-align: left; }
#changePhoneNumberModal .authRow > button,
#changePhoneNumberModal .bnBox + button {
  flex: 0 0 auto; height: 42px; border: 0; color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 5px; background: var(--sb-text); padding: 0 14px; box-sizing: border-box;
  white-space: nowrap; cursor: pointer;
}
#changePhoneNumberModal .formArea > button:disabled { background-color: var(--sb-input-border) !important; cursor: not-allowed; }
#changePhoneNumberModal .formArea > small.form-text { margin-top: -2px; }

.form-text { display: block; margin-top: 5px; font-size: 14px; }
.form-text.text-danger { color: var(--sb-red-alt); }
.form-text.text-success { color: var(--sb-blue); }

/* ---------------- 서비스 해지 확인 모달 (modal-footer 2버튼) ---------------- */

.mp-modal.modal-box { max-width: 440px; width: 92%; }
.mp-modal .modal-body { padding: 24px 26px 28px; }
.mp-modal .modal-body > p:first-child { margin-top: 0; }
/* 서비스 해지 모달만 modal-body 아래 별도 .mp-modal-footer가 바로 이어붙으므로
   본문 하단 여백을 좁혀 이중 여백(28px+16px)을 방지 */
.mp-modal .modal-body:has(+ .mp-modal-footer) { padding-bottom: 4px; }
.mp-cancel-detail { font-size: 14px; line-height: 1.7; margin: 12px 0 0; color: #444; }

.mp-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 26px 22px;
}
.mp-btn-sm {
  padding: 6px 14px; font-size: 14px; border: 0; border-radius: 4px; color: #fff; cursor: pointer;
}
.mp-btn-secondary { background: #6c757d; }
.mp-btn-danger { background: #dc3545; }

/* ==========================================================================
   데스크톱 (960px~) — 레거시 PC 레이아웃(2열 그리드) 재현
   ========================================================================== */
@media (min-width: 960px) {
  .mpLayout { padding: 48px 24px 96px; }
  .mpTitle { font-size: 25px; font-weight: 700; margin-bottom: 0; }

  .mypageArea {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 80px;
    margin: 40px auto 0;
  }

  .mypageArea > div > div { margin-bottom: 35px; padding-bottom: 35px; padding-top: 0; border-top: 0; border-bottom: 1px solid var(--sb-border-light); }
  .mypageArea > div > div:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

  .mypageArea h5 { font-size: 23px; padding: 0 0 20px; }

  .mypageArea .mpRow > div,
  .mypageArea .mpRow > div > h6 { font-size: 18px; line-height: 20px; }

  .mypageArea .mpBtnArea { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
  .mypageArea .mpBtnArea.row2 { grid-template-columns: repeat(2, 1fr); }

  .mypageArea button { padding: 10px 20px; font-size: 18px; border-radius: 5px; }

  .mypageArea #downloadPaymentHistoryBtn,
  .mypageArea #viewReceiptsBtn { padding: 8px 20px; margin-top: 19px; }
}
