/* =========================================
   [공통(Common)]
   ========================================= */
.ms.container {
  padding-block: 95px;
  letter-spacing: -1px;
  font-family: "Malgun Gothic", sans-serif;
}
.ms.title {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-bottom: 20px;
}
.ms h1 {
  font-size: 32px;
  font-weight: 600;
}
.ms h2 {
  font-size: 28px;
  font-weight: 600;
}
.ms h3 {
  font-size: 20px;
  font-weight: 400;
}
.ms h4 {
  font-size: 18px;
  font-weight: 400;
}
.ms h5 {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

.mstpink {
  color: #ea3991;
}
.msbpink {
  background-color: #ea3991;
}
.msppink {
  background-color: #fef5f9;
}

.btn.msbpink {
  color: #fff;
}

.mstred {
  color: #f64c4c;
}

.mstgreen {
  color: #00c923;
}

.mstgrey {
  color: #939393;
}

.ms.action {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 14px;
}
.ms.action .btn {
  display: block;
  padding-block: 15px;
  font-size: 18px;
  border-radius: 5px;
  width: 290px;
  font-weight: 600;
  text-align: center;
}

button {
  all: unset;
}

.ms.action .btn.bl {
  background-color: #000;
  color: #fff;
}

.ms.action .btn.wh {
  border: 1px solid #dedede;
}

/* 공통 - 반응형 */
@media (max-width: 1024px) {
  .ms.container {
    padding-block: 72px;
    width: 95%;
  }
  .ms h1 {
    font-size: 28px;
  }
  .ms h2 {
    font-size: 24px;
  }
  .ms h3 {
    font-size: 18px;
  }
}
@media (max-width: 640px) {
  .ms.container {
    padding-block: 40px;
    width: 90%;
  }
  .ms.title {
    padding-bottom: 12px;
  }
  .ms h1 {
    font-size: 24px;
  }
  .ms h2 {
    font-size: 20px;
  }
  .ms h3 {
    font-size: 15px;
  }

  .ms.action {
    margin-top: 20px;
    gap: 8px;
  }
  .ms.action .btn {
    width: 100%;
    font-size: 16px;
    padding-block: 14px;
  }
}
@media (max-width: 360px) {
  .ms h1 {
    font-size: 22px;
  }
  .ms h2 {
    font-size: 20px;
  }
}

/* =========================================
   [페이지: 멤버십 신청 본문 영역]
   ========================================= */
.ms.subtitle h3 span {
  color: #454545;
}

.ms.box {
  border: 1px solid #f9c4de;
  border-radius: 10px;
  padding: 50px;
}
.ms.box h2 {
  display: flex;
  align-items: baseline;
}
.ms.box h2 span {
  font-size: 16px;
  padding-right: 2px;
}
.ms.box .title {
  display: flex;
  justify-content: space-between;
  padding-bottom: 15px;
}

.ms.card {
  display: flex;
  gap: 30px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.ms.card li {
  flex: 1;
  padding-block: 30px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.ms.box .notice {
  font-size: 12px;
  color: #787878;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

/* 본문 - 반응형 */
@media (max-width: 1024px) {
  .ms.box {
    padding: 36px;
  }
}
@media (max-width: 640px) {
  .ms.box {
    padding: 24px;
  }
  .ms.box .title {
    padding-bottom: 10px;
  }

  .ms.card {
    flex-direction: column;
    gap: 12px;
  }
  .ms.card li {
    flex-direction: row;
    padding: 18px;
    gap: 10px;
  }
  .ms.card img {
    max-width: 64px;
    height: auto;
  }

  .ms.card h5 {
    text-align: left;
  }
}

/* =========================================
   [모달]
   ========================================= */
.ms-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.ms-modal.is-open {
  display: block;
}

.ms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(1px);
}
.ms-modal__dialog {
  position: relative;
  max-width: 800px;
  margin: 60px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.ms-modal.is-open .ms-modal__dialog {
  transform: translateY(0);
  opacity: 1;
}
.ms-modal__content {
  padding: 50px;
  text-align: left;
}
.ms-modal__img {
  display: block;
  width: 100%;
  height: auto;
}
.ms-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  padding-bottom: 10px;
  cursor: pointer;
}

/* 모달 - 반응형 */
@media (max-width: 1024px) {
  .ms-modal__dialog {
    max-width: 680px;
    width: min(92vw, 680px);
    margin: 40px auto;
  }
  .ms-modal__content {
    padding: 36px;
  }
}
@media (max-width: 640px) {
  .ms-modal__dialog {
    width: 92vw;
    max-width: 560px;
    margin: 20px auto;
    border-radius: 8px;
  }
  .ms-modal__content {
    padding: 22px;
  }
  .ms-modal__close {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
  }
}

/* 스크롤 잠금 */
body.ms-modal-open {
  overflow: hidden;
}

/* =========================================
   [요약 표]
   ========================================= */
.ms-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  margin-bottom: 30px;
  font-size: 16px;
}
.ms-summary-table tr:first-child th,
.ms-summary-table tr:first-child td {
  border-top: 1px solid #000;
}
.ms-summary-table th,
.ms-summary-table td {
  border-bottom: 1px solid #dedede;
  padding: 15px 20px;
  text-align: left;
}
.ms-summary-table th {
  width: 20%;
  background: #f4f4f4;
  font-weight: 600;
  text-align: center;
}

/* 요약 표 - 반응형 */
@media (max-width: 1024px) {
  .ms-summary-table {
    font-size: 15px;
  }
  .ms-summary-table th,
  .ms-summary-table td {
    padding: 12px 14px;
  }
  .ms-summary-table th {
    width: 28%;
  }
}
@media (max-width: 640px) {
  .ms-summary-table {
    font-size: 14px;
    margin-top: 12px;
    margin-bottom: 18px;
  }
  .ms-summary-table th,
  .ms-summary-table td {
    padding: 10px 12px;
  }
  .ms-summary-table th {
    width: 30%;
    text-align: left;
  }
}
@media (max-width: 360px) {
  .ms-summary-table {
    font-size: 13px;
  }
  .ms-summary-table th,
  .ms-summary-table td {
    padding: 8px 10px;
  }
}

/* =========================================
   [유의사항 박스]
   ========================================= */
.ms-notice-box {
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin: 15px 0 25px;
  color: #787878;
  line-height: 1.6;
  font-size: 16px;
}
.ms-notice-box ul {
  list-style-position: outside;
  margin: 0;
  padding-left: 20px;
}
.ms-notice-box li {
  list-style-type: disc;
  margin-bottom: 8px;
}

/* 유의사항 - 반응형 */
@media (max-width: 1024px) {
  .ms-notice-box {
    padding: 16px 18px;
    font-size: 15px;
  }
}
@media (max-width: 640px) {
  .ms-notice-box {
    padding: 14px;
    margin: 12px 0 18px;
    font-size: 14px;
    line-height: 1.55;
  }
  .ms-notice-box ul {
    padding-left: 18px;
  }
  .ms-notice-box li {
    margin-bottom: 6px;
  }
}

/* =========================================
   [체크박스 + 링크]
   ========================================= */
.ms-check-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 16px;
}
.ms-check {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid #dedede;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  position: relative;
  background: #fff;
  transition: all 0.2s ease;
}
.ms-check input[type="checkbox"]:checked {
  background: #fef5f9;
  border-color: #ffe3f1;
}

.ms-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #ea3991;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ms-link {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .ms-check-wrap {
    font-size: 15px;
  }
  .ms-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}
@media (max-width: 640px) {
  .ms-check-wrap {
    gap: 12px;
    font-size: 15px;
  }
  .ms-check {
    gap: 8px;
    align-items: flex-start;
  }
  .ms-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
  }
  .ms-link {
    text-underline-offset: 2px;
    padding: 2px 0;
  }
}
@media (max-width: 360px) {
  .ms-check-wrap {
    font-size: 14px;
  }
}

.btn.msbpink.is-disabled {
  background-color: #e5e5e5 !important;
  color: #9e9e9e !important;
  border: 1px solid #dedede;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.msbpink.is-disabled:focus {
  outline: none;
  box-shadow: none;
}

/* =========================================
   [페이지: 멤버십 신청 완료 영역]
   ========================================= */

#mship-success .ms.title,
#mship-fail .ms.title,
#mship-cancel .ms.title {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 20px;
  margin-bottom: 50px;
}

.ms.text {
  display: flex;
  gap: 20px;
  flex-direction: column;
  align-items: center;
}

.ms.infobox {
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0px 30px;
}

.ms-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  color: #000;
}

.ms-info-table th,
.ms-info-table td {
  padding: 10px 15px;
  text-align: left;
  vertical-align: middle;
}

.ms-info-table th {
  font-weight: 600;
  width: 120px;
}

/* 태블릿 이하 */
@media (max-width: 1024px) {
  .ms-info-table {
    font-size: 15px;
  }

  .ms-info-table th,
  .ms-info-table td {
    padding: 8px 12px;
  }

  .ms-info-table th {
    width: 100px;
  }
}

/* 모바일 */
@media (max-width: 640px) {
  #mship-success .ms.title,
  #mship-fail .ms.title,
  #mship-cancel .ms.title {
    margin: 16px 0 24px;
  }

  .ms-info-table {
    font-size: 15px;
  }

  .ms-info-table th,
  .ms-info-table td {
    padding: 6px 10px;
  }

  .ms-info-table th {
    width: 90px;
  }
}

/* 초소형 (아이폰 SE 같은 화면) */
@media (max-width: 360px) {
  .ms-info-table {
    font-size: 13px;
  }

  .ms-info-table th,
  .ms-info-table td {
    padding: 5px 8px;
  }

  .ms-info-table th {
    width: 80px;
  }
}

/* =========================================
   [페이지: 멤버십 신청 실패 영역]
   ========================================= */
#mship-fail .ms.infobox {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =========================================
   [페이지: 멤버십 관리 영역]
   ========================================= */

#mship-manage .mgtitle {
  font-size: 24px;
  font-weight: 600;
  padding: 40px 0 10px;
  text-align: left;
}

#mship-manage .mg-card {
  border: 1px solid #f9c4de;
  background: #fff;
  border-radius: 10px;
}

#mship-manage .mg-subject {
  background: #fef5f9;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  padding: 24px 30px;
}

#mship-manage .mg-product {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
#mship-manage .mg-price {
  font-weight: 600;
}

#mship-manage .mg-box {
  padding: 24px 30px;
  font-size: 15px;
}

#mship-manage .info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 40px;
}

#mship-manage .info-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  align-items: center;
}

#mship-manage .info-item .title {
  text-align: left;
}

#mship-manage .info-item .text {
  display: flex;
  align-items: center;
}

#mship-manage .badge {
  font-size: 12px;
  border-radius: 3px;
  display: flex;
  padding: 5px 15px;
  margin-left: 15px;
}

#mship-manage .badge.cancel {
  background-color: #f4f4f4;
  color: #787878;
}

#mship-manage .badge.change {
  background-color: #fee4e4;
  color: #f64c4c;
}

#mship-manage .badge.resub {
  background-color: #0D9C0D;
  color: #FFFFFF;
}

/* 결제내역 테이블 */
#mship-manage .mg-history {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
#mship-manage .mg-history thead th {
  background: #f4f4f4;
  font-weight: 600;
  text-align: center;
  padding: 18px 14px;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
}
#mship-manage .mg-history tbody td {
  padding: 20px;
  border-bottom: 1px solid #efefef;
  vertical-align: middle;
}

/* 상태 컬러 (이미 있는 클래스와 호환) */
#mship-manage .mg-state-fail,
#mship-manage .mg-state-cancel {
  color: #f64c4c;
  font-weight: 600;
}

/* 영수증 버튼(a 태그) */
#mship-manage .rcpt {
  display: inline-flex;
  align-items: center;
  padding: 5px 15px;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

#mship-manage .rcpt.sales {
  background-color: #00c923;
  color: #fff;
}

#mship-manage .rcpt.cancel {
  background-color: #787878;
  color: #fff;
}

/* =========================
   [반응형: 멤버십 관리]
   ========================= */

/* 테이블 감싸기: 가로 스크롤 허용 + 칼럼 깨짐 방지 */
#mship-manage .mg-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#mship-manage .mg-history {
  min-width: 760px;
}

/* ── 태블릿 (≤1024px) ───────────────────────── */
@media (max-width: 1024px) {
  #mship-manage .mgtitle {
    padding: 28px 0 8px;
  }

  #mship-manage .mg-subject {
    padding: 20px 24px;
  }
  #mship-manage .mg-product img {
    width: 22px;
    height: auto;
  }

  #mship-manage .mg-box {
    padding: 18px 24px;
  }

  #mship-manage .info-grid {
    gap: 18px 30px;
  }

  #mship-manage .info-item {
    grid-template-columns: 90px 1fr;
    gap: 16px;
  }

  #mship-manage .mg-history thead th {
    padding: 14px 12px;
  }
  #mship-manage .mg-history tbody td {
    padding: 14px 12px;
  }
}

/* ── 모바일 (≤640px) ───────────────────────── */
@media (max-width: 640px) {
  /* 상단 배너(상품명/가격) 세로 스택 */
  #mship-manage .mg-subject {
    align-items: flex-start;
    gap: 6px;
    padding: 16px 18px;
  }

  /* 정보 박스: 2열 → 1열 스택 */
  #mship-manage .mg-box {
    padding: 16px 18px;
  }

  #mship-manage .info-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #mship-manage .info-item {
    grid-template-columns: 85px 1fr;
    gap: 12px;
  }

  #mship-manage .info-item .title {
    color: #666;
  }

  /* 배지/영수증 버튼 사이즈 다운 */
  #mship-manage .badge {
    padding: 4px 10px;
    font-size: 12px;
    margin-left: 10px;
  }
  #mship-manage .rcpt {
    padding: 4px 10px;
    font-size: 12px;
  }

  /* 테이블 타이포/패딩 축소 + 최소 너비 조정 */
  #mship-manage .mg-history {
    font-size: 14px;
    min-width: 640px;
  }
  #mship-manage .mg-history thead th,
  #mship-manage .mg-history tbody td {
    padding: 10px 10px;
  }
}

/* ── 초소형 (≤360px) ───────────────────────── */
@media (max-width: 360px) {
  #mship-manage .mg-price {
    font-size: 15px;
  }

  #mship-manage .info-item {
    grid-template-columns: 80px 1fr;
    gap: 10px;
  }

  /* 아주 작은 화면에서 테이블 최소폭 조금 더 줄임 */
  #mship-manage .mg-history {
    min-width: 580px;
  }
}

#mship-cancel .ms h5 {
  line-height: 1.75;
}

#mship-cancel .ms.infobox {
  padding: 45px;
}
