/* =========================================================
   [1] /css/style.css 에 추가 (어느 페이지에서든 뜨는 공통 모달)
       색상·버튼 값은 기존 안내 팝업(alert-modal)과 같은 값 사용
   ========================================================= */

/* ---------- 체험 종료 모달 (횟수 소진 모달도 같은 틀 사용) ---------- */
.trial-end-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    letter-spacing: -0.07em;
    word-break: keep-all;
}

.trial-end-modal[hidden] {
    display: none;
}

.trial-end-modal *,
.trial-end-modal *::before,
.trial-end-modal *::after {
    box-sizing: border-box;
}

.trial-end-modal__dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.trial-end-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 40px 30px 30px;
    border: 1px solid #E5E5E5;
    border-radius: 16px;
    background: #fff;
    color: #1F2420;
}

.trial-end-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

/* 상단 */
.trial-end-modal__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.trial-end-modal__badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #F2F2F2;
    color: #777777;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.trial-end-modal__title {
    margin: 0;
    padding: 0; /* style.css h2 padding-top 해제 */
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.trial-end-modal__desc {
    margin: 0;
    color: #8A8A8A;
    font-size: 14px;
    line-height: 1.5;
}

/* 체험 중 사용 기록 */
.trial-end-usage {
    padding: 18px 16px;
    border-radius: 12px;
    background: #F2F8EF;
}

.trial-end-usage[hidden] {
    display: none;
}

.trial-end-usage__title {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.trial-end-usage__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trial-end-usage__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 6px;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.trial-end-usage__value {
    color: #42BC74;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.trial-end-usage__label {
    color: #8A8A8A;
    font-size: 12px;
}

/* 무료회원 안내 */
.trial-end-free {
    padding: 0 4px;
}

.trial-end-free__title {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.trial-end-free__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trial-end-free__list li {
    position: relative;
    padding-left: 10px;
    color: #6B6E6B;
    font-size: 13px;
    line-height: 1.5;
}

.trial-end-free__list li::before {
    content: "·";
    position: absolute;
    left: 0;
}

/* 버튼 : 멤버십 전환이 메인이라 세로 배치 (위 : 메인 / 아래 : 보조) */
.trial-end-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.trial-end-modal__confirm,
.trial-end-modal__cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: inherit;
    text-decoration: none;
    cursor: pointer;
}

.trial-end-modal__confirm {
    border: 1px solid #42BC74;
    background: #42BC74;
    color: #fff;
}

.trial-end-modal__confirm:hover {
    background: #3DAE6A;
}

.trial-end-modal__cancel {
    border: 1px solid #E5E5E5;
    background: #fff;
    color: #1F2420;
}

.trial-end-modal__cancel:hover {
    background: #F5F5F5;
}


/* ---------- 횟수 소진 모달 (무료회원 하루 3회를 다 썼을 때) ----------
   체험 종료 모달과 같은 틀(.trial-end-modal) + 아래 modifier 만 추가 */

/* 오늘 남은 횟수 : 회색 상자 · 2칸 */
.trial-end-usage--quota {
    background: #F5F5F3;
}

.trial-end-usage--quota .trial-end-usage__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trial-end-usage--quota .trial-end-usage__item {
    border: 1px solid #E5E5E5;
}

/* 0회 남은 항목 : 숫자 빨강 */
.trial-end-usage__item--empty .trial-end-usage__value {
    color: #C23434;
}

/* 혜택 목록 : 굵게 강조한 기능 이름 */
.trial-end-free__list strong {
    color: #1F2420;
    font-weight: 700;
}

/* 보조 버튼을 글자만 (내일 다시 쓸게요) */
.trial-end-modal__cancel--text {
    height: 40px;
    border-color: transparent;
    background: none;
    color: #777777;
}

.trial-end-modal__cancel--text:hover {
    background: none;
    color: #1F2420;
}


/* ---------- 플랜 고르기 + 오픈 혜택 (12/2 추가) ----------
   쓰는 곳 : 올프리 종료 예정 모달(trial-ending-modal.html) · 횟수 소진 모달(quota-end-modal.html)
   틀은 그대로 .trial-end-modal, 아래 블록만 추가 */

/* 제목 안 강조 (남은 시간 · 곧 끝나요) */
.trial-end-modal__title em {
    color: #C23434;
    font-style: normal;
}

/* 사용 횟수 · 남은 횟수 : 제목 · 흰 칸 없이 한 줄 (칸 수는 항목 개수만큼 자동) */
.trial-end-usage.trial-end-usage--flat {
    padding: 10px 8px;
}

.trial-end-usage--flat .trial-end-usage__list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

.trial-end-usage--flat .trial-end-usage__item {
    padding: 0;
    border: 0;
    background: none;
}

.trial-end-usage--flat .trial-end-usage__value {
    font-size: 16px;
}

.trial-end-usage--flat .trial-end-usage__label {
    font-size: 11px;
}

/* 제안 영역 : 한 줄 문구 + 플랜 카드 */
.trial-end-offer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trial-end-offer__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.trial-end-offer__title em {
    color: #2FA862;
    font-style: normal;
}

/* 플랜 카드 : 라디오 + label (고른 카드는 초록 테두리 · 연초록 바탕) */
.trial-end-plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.trial-end-plan {
    position: relative;
    display: block;
    cursor: pointer;
}

.trial-end-plan__radio {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.trial-end-plan__box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    background: #fff;
}

.trial-end-plan__radio:checked + .trial-end-plan__box {
    border-color: #42BC74;
    background: #F2F8EF;
    box-shadow: 0 0 0 0.5px #42BC74; /* 테두리 1.5px (크기 변화 없이) */
}

.trial-end-plan__radio:focus-visible + .trial-end-plan__box {
    outline: 2px solid #42BC74;
    outline-offset: 2px;
}

.trial-end-plan__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.trial-end-plan__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

/* 작은 이름표 (추천 · 오픈 혜택) : 기존 배지(.trial-end-modal__badge)에 modifier 만 추가 */
.trial-end-modal__badge--sm {
    flex: none;
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
}

.trial-end-modal__badge--green {
    background: #42BC74;
    color: #fff;
}

.trial-end-modal__badge--brown {
    background: #9A5B15;
    color: #fff;
}

/* "선택됨" : 고른 카드에만 */
.trial-end-plan__state {
    display: none;
    color: #2FA862;
    font-size: 12px;
    font-weight: 700;
}

.trial-end-plan__radio:checked + .trial-end-plan__box .trial-end-plan__state {
    display: inline;
}

.trial-end-plan__price {
    flex: none;
    font-size: 15px;
    font-weight: 700;
}

.trial-end-plan__desc {
    color: #3D403D;
    font-size: 13px;
    line-height: 1.5;
}

/* "고르면 N 포인트를 돌려받아요" : 안 고른 카드에만 */
.trial-end-plan__note {
    color: #6B6E6B;
    font-size: 12px;
    line-height: 1.5;
}

.trial-end-plan__note strong {
    color: #C26A00;
    font-weight: 700;
}

.trial-end-plan__radio:checked + .trial-end-plan__box .trial-end-plan__note {
    display: none;
}

/* 고른 플랜에 따라 바뀌는 글자 (오픈 혜택 포인트 · 버튼의 플랜 이름)
   · 기본 : 스탠다드 글자만 보임
   · 베이직을 고르면 베이직 글자로 바뀜 (:has 지원 브라우저는 스크립트 없이 동작)
   · 스크립트로 처리할 때는 .trial-end-modal__content 에 data-plan="basic" / "standard" */
.trial-end-for--basic {
    display: none;
}

.trial-end-modal__content:has(.trial-end-plan__radio[value="basic"]:checked) .trial-end-for--standard {
    display: none;
}

.trial-end-modal__content:has(.trial-end-plan__radio[value="basic"]:checked) .trial-end-for--basic {
    display: inline;
}

.trial-end-modal__content[data-plan="basic"] .trial-end-for--standard {
    display: none;
}

.trial-end-modal__content[data-plan="basic"] .trial-end-for--basic {
    display: inline;
}

/* 오픈 혜택 (12월 26일부터 hidden) */
.trial-end-payback {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid #F1DFA6;
    border-radius: 10px;
    background: #FFF4D6;
}

.trial-end-payback[hidden] {
    display: none;
}

.trial-end-payback__main {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.trial-end-payback__main strong {
    color: #C26A00;
    font-size: 17px;
    font-weight: 700;
}

.trial-end-payback__sub {
    margin: 0;
    color: #6B5A2A;
    font-size: 12px;
    line-height: 1.5;
}

/* 버튼 영역 : 오픈 혜택 + 버튼 (하단 닫기 링크 없음 · 닫기는 X 만) */
.trial-end-modal__footer--offer {
    gap: 12px;
    margin-top: 0;
}

/* 초록 테두리 버튼 (베이직 멤버십 시작하기 · 하루 1,833원) : 기존 보조 버튼(.trial-end-modal__cancel)에 modifier 만 추가 */
.trial-end-modal__cancel--line {
    border-color: #42BC74;
    color: #2FA862;
}

.trial-end-modal__cancel--line:hover {
    background: #F2F8EF;
}

/* 써볼 기능 목록 (올프리 종료 예정 · 3회 이하로 쓴 회원) */
.trial-end-feature {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 4px 14px;
    border-radius: 12px;
    background: #F2F8EF;
    list-style: none;
}

.trial-end-feature__item + .trial-end-feature__item {
    border-top: 1px solid #DDE9D6;
}

.trial-end-feature__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
}

.trial-end-feature__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.trial-end-feature__name {
    font-size: 14px;
    font-weight: 700;
}

.trial-end-feature__desc {
    color: #3D403D;
    font-size: 12px;
    line-height: 1.5;
}

.trial-end-feature__arrow {
    flex: none;
}


/* =========================================================
   [2] /css/responsive.css 에 추가 (새 구역)
   ========================================================= */

/* ------------------------------------------------------------
   체험 종료 모달 — 모바일
------------------------------------------------------------ */

@media (max-width: 480px) {

  .trial-end-modal {
    padding: 16px;
  }

  .trial-end-modal__content {
    gap: 16px;
    padding: 36px 20px 20px;
  }

  .trial-end-modal__title {
    font-size: 18px;
  }

  .trial-end-usage {
    padding: 16px 12px;
  }

  .trial-end-usage__value {
    font-size: 18px;
  }
}
