/* ===== 후원가입안내 폼 페이지 ===== */
/* 팔레트: 다크블루 #0D132D, 골드 #C9A86A, 회색계열 #444/#777/#999 */

/* ── 히어로 배경 커스텀 ── */
.page-sub .join-hero {
    background-image: url("/test/img/sub/intro-hero-bg.webp");
}

/* ── 폼 콘텐츠 영역 ── */
.page-sub .join-content {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: clamp(60px, 8vw, 120px) 20px clamp(80px, 10vw, 120px);
}

.page-sub .join-content .inner-content {
    max-width: 800px;
    margin: 0 auto;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ── 섹션 구분 ── */
.join-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.join-section__heading {
    font-size: 23px;
    font-weight: 500;
    color: #444;
    margin: 0 0 0;
    padding-bottom: 0;
    letter-spacing: -0.02em;
}

/* ── 공통 테이블 행 ── */
.join-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 8px;
}

.join-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
}

.join-row__label {
    flex: 0 0 156px;
    width: 156px;
    padding: 10px 0 14px;
    font-size: 16px;
    font-weight: 500;
    color: #444;
    line-height: 24px;
    white-space: nowrap;
}

.join-row__label .req,
.join-consent__item-label .req {
    color: #ff3131;
}

.join-consent__item-label .opt {
    font-size: 13px;
    color: #aaa;
    font-weight: 300;
}

.join-row__data {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── 토글 버튼 그룹 (정기회비|일시후원, 개인|기업단체 등) ── */
.join-toggle {
    display: flex;
    width: 100%;
    height: 48px;
}

.join-toggle__btn {
    flex: 1 0 0;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    color: #444;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.join-toggle__btn:first-child {
    margin-right: 6px;
}

.join-toggle__btn:last-child {
    margin-left: 6px;
}

.join-toggle__btn.active {
    background: var(--main, #0d132d);
    color: #fff;
    border-color: var(--main, #0d132d);
    font-weight: 500;
}

/* ── 후원금액 버튼 그리드 (2행 3열) ── */
.join-amount-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.join-amount-row {
    display: flex;
    width: 100%;
    height: 60px;
    align-items: flex-end;
    gap: 8px;
}

.join-amount-btn {
    flex: 1 0 0;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 300;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    color: #444;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.join-amount-btn.active {
    background: var(--main, #0d132d);
    color: #fff;
    border-color: var(--main, #0d132d);
}

.join-amount-btn--input {
    color: #999;
    font-weight: 300;
}

.join-amount-btn--input.has-value {
    color: #444;
}

/* 직접입력: input 숨기고 버튼처럼 */
.join-amount-custom {
    flex: 1 0 0;
    min-width: 0;
    height: 48px;
    font-size: 16px;
    font-weight: 300;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    color: #999;
    padding: 0 12px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.join-amount-custom:focus {
    border-color: #999;
    color: #444;
}

.join-amount-custom::placeholder {
    color: #999;
}

/* ── 일반 텍스트 입력 ── */
.join-input {
    width: 100%;
    height: 48px;
    border: 1px solid #999;
    border-radius: 2px;
    background: #fff;
    padding: 0 18px;
    font-size: 16px;
    font-weight: 300;
    color: #444;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.join-input::placeholder {
    color: #999;
    font-weight: 300;
}

.join-input:focus {
    border-color: var(--main, #0d132d);
}

/* ── 이름 행: 인풋 + 만14세 체크박스 + 보기 버튼 ── */
.join-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
}

.join-name-wrap .join-input {
    flex: 1 0 0;
    min-width: 0;
    margin-right: 0;
}

.join-name-aside {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.join-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.join-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.join-view-btn {
    height: 24px;
    padding: 0 8px;
    background: #bbb;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 안내 박스 ── */
.join-notice {
    background: #f8f8f8;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 2px;
}

.join-notice__item {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 15px;
    font-weight: 300;
    color: #777;
    line-height: 2;
}

.join-notice__bullet {
    flex-shrink: 0;
    line-height: 2;
}

/* ── 결제수단 2×2 버튼 그리드 ── */
.join-payment-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.join-payment-row {
    display: flex;
    width: 100%;
    height: 60px;
    align-items: flex-end;
    gap: 0;
}

.join-payment-btn {
    flex: 1 0 0;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 300;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    color: #444;
    padding: 0 8px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.join-payment-row .join-payment-btn:first-child { margin-right: 6px; }
.join-payment-row .join-payment-btn:last-child  { margin-left: 6px; }

/* 일시후원 첫 번째 행: 3개 버튼 */
.join-payment-row:not(.join-payment-row--half) .join-payment-btn:nth-child(2) {
    margin-left: 6px;
    margin-right: 6px;
}
/* 일시후원 두 번째 행: 2개 버튼 (50%씩) */
.join-payment-row--half .join-payment-btn {
    flex: 0 0 calc(50% - 6px);
}

.join-payment-btn.active {
    background: var(--main, #0d132d);
    color: #fff;
    border-color: var(--main, #0d132d);
}

.join-payment-btn img {
    height: 18px;
    max-width: 110px;
    object-fit: contain;
}

/* ── select 드롭다운 ── */
.join-select-wrap {
    position: relative;
    width: 100%;
    height: 48px;
}

.join-select {
    width: 100%;
    height: 48px;
    border: 1px solid #999;
    border-radius: 2px;
    background: #fff;
    padding: 0 40px 0 18px;
    font-size: 16px;
    font-weight: 300;
    color: #444;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
}

.join-select-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 8px;
}

.join-select-arrow::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #666;
}

/* ── 계좌번호: 인풋 + 눈 아이콘 ── */
.join-input-icon-wrap {
    position: relative;
    width: 100%;
}

.join-input-icon-wrap .join-input {
    padding-right: 48px;
}

.join-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.join-input-icon:hover {
    opacity: 1;
}

.join-input-icon svg {
    width: 22px;
    height: 22px;
    fill: #666;
}

/* ── 구분선 ── */
.join-separator {
    width: 100%;
    height: 1px;
    background: #e1e1e1;
    flex-shrink: 0;
}

/* ── 동의 섹션 ── */
.join-consent {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.join-consent__all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
    margin-bottom: 2px;
}

.join-consent__all-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.join-consent__all-label {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
}

.join-consent__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 4px 0;
}

.join-consent__item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 50%;
    min-width: 260px;
    padding: 4px 0;
}

.join-consent__item-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.join-consent__item-label {
    font-size: 16px;
    font-weight: 300;
    color: #444;
    cursor: pointer;
    /* flex: 1; */
}

/* ── 커스텀 체크박스 아이콘 ── */
.join-check-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: url('../../../img/common/checkbox_off.svg') center / contain no-repeat;
    cursor: pointer;
    vertical-align: middle;
}

input[type="checkbox"]:checked + .join-check-icon {
    background-image: url('../../../img/common/checkbox_on.svg');
}

/* ── 신청하기 버튼 ── */
.join-submit-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.join-submit-btn {
    width: min(420px, 100%);
    height: 56px;
    background: var(--main, #0d132d);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}

.join-submit-btn:hover {
    opacity: 0.85;
}

/* ── 모바일 반응형 ── */
@media (max-width: 768px) {
    .page-sub .join-hero {
        background-image: url("/test/img/sub/intro-hero-bg-m.webp");
    }
    .page-sub .join-content {
        padding: 48px 16px 64px;
    }

    .join-form {
        gap: 40px;
    }

    .join-section__heading {
        font-size: 18px;
    }

    .join-table {
        padding: 12px 0;
    }

    .join-row {
        flex-direction: column;
        gap: 6px;
    }

    .join-row__data {
        width: 100%;
    }

    .join-row__label {
        flex: none;
        width: auto;
        padding: 0;
        font-size: 14px;
    }

    /* input, select, toggle 전부 100% 너비 */
    .join-input,
    .join-select,
    .join-select-wrap,
    .join-input-icon-wrap,
    .join-toggle,
    .join-payment-grid,
    .join-amount-grid,
    .join-name-wrap {
        width: 100%;
        box-sizing: border-box;
    }

    .join-toggle__btn {
        font-size: 14px;
    }

    .join-amount-btn {
        font-size: 13px;
    }

    .join-amount-custom {
        font-size: 13px;
    }

    .join-amount-row {
        gap: 6px;
    }

    .join-payment-row .join-payment-btn:first-child { margin-right: 4px; }
    .join-payment-row .join-payment-btn:last-child  { margin-left: 4px; }
    .join-payment-row:not(.join-payment-row--half) .join-payment-btn:nth-child(2) {
        margin-left: 4px;
        margin-right: 4px;
    }

    .join-payment-btn {
        font-size: 13px;
    }

    .join-payment-btn img {
        height: 14px;
        max-width: 80px;
    }

    .join-name-wrap {
        flex-wrap: wrap;
        height: auto;
        gap: 6px;
    }

    .join-name-wrap .join-input {
        width: 100%;
        flex: none;
    }

    .join-check-label {
        font-size: 13px;
    }

    .join-input {
        font-size: 14px;
        height: 44px;
    }

    .join-notice__item {
        font-size: 13px;
    }

    .join-consent__item {
        flex: 0 0 100%;
        min-width: auto;
    }

    .join-submit-btn {
        width: 100%;
        font-size: 16px;
        height: 52px;
    }
}

/* ════════════════════════════════════════
   모달
════════════════════════════════════════ */
.jmodal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.jmodal-overlay.is-open {
    display: flex;
}

.jmodal {
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

/* 헤더 */
.jmodal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.jmodal__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--main, #0d132d);
    margin: 0;
    letter-spacing: -0.02em;
}

.jmodal__close {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    border-radius: 2px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.jmodal__close:hover {
    color: var(--main, #0d132d);
    background: rgba(0, 0, 0, 0.06);
}

/* 본문 */
.jmodal__body {
    overflow-y: auto;
    padding: 24px;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

/* 안내 박스 (minor) */
.jmodal__notice-box {
    background: #f0f3f9;
    border-left: 4px solid var(--main, #0d132d);
    border-radius: 2px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.jmodal__notice-box p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--main, #0d132d);
    line-height: 1.6;
}

/* 텍스트 */
.jmodal__text {
    font-size: 14px;
    font-weight: 300;
    color: #444;
    line-height: 1.85;
}

.jmodal__text p {
    margin: 0 0 10px;
}

.jmodal__text h5 {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 20px 0 6px;
    letter-spacing: -0.01em;
}

.jmodal__text h5:first-child {
    margin-top: 0;
}

.jmodal__text ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.jmodal__text ul li {
    margin-bottom: 4px;
}

.jmodal__text strong {
    font-weight: 600;
    color: #222;
}

.jmodal__date {
    margin-top: 24px !important;
    font-size: 13px;
    color: #888;
}

/* 푸터 */
.jmodal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.jmodal__btn {
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    letter-spacing: -0.01em;
}

.jmodal__btn--primary {
    background: var(--main, #0d132d);
    color: #fff;
    border-color: var(--main, #0d132d);
}

.jmodal__btn--primary:hover {
    opacity: 0.85;
}

.jmodal__btn--outline {
    background: #fff;
    color: #555;
    border-color: #ccc;
}

.jmodal__btn--outline:hover {
    background: #f5f5f5;
}

@media (max-width: 480px) {
    .jmodal {
        max-height: 88vh;
    }

    .jmodal__head {
        padding: 16px 18px 14px;
    }

    .jmodal__title {
        font-size: 16px;
    }

    .jmodal__body {
        padding: 18px;
    }

    .jmodal__foot {
        padding: 14px 18px 16px;
    }

    .jmodal__btn {
        flex: 1;
        padding: 0 12px;
    }
}
