@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 꿈사랑 = 틸/청록 계열 (뉴리프의 황록색 #5a9e2f 과 구분) */
:root {
    --primary: #0f857a;
    --primary-light: #3aa79c;
    --primary-dark: #0a6b62;
    --primary-tint: #e9f4f2;
    --primary-tint-light: #f6fbfa;
    --logo-green: #4caf50;
    --dark-gray: #303030;
    --medium-gray: #a7a9ab;
    --light-gray: #f5f5f5;
    --white: #ffffff;
}

@page {
    size: A4;
    margin: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #e8e8e8;
    color: var(--dark-gray);
    line-height: 1.5;
    font-size: 13px;
}

/* Page Container */
.page {
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

/* Print Styles */
@media print {
    body {
        background: white;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    /* 소수점 반올림으로 2페이지가 되는 것을 막기 위해 100vh보다 2px 작게 잡습니다 */
    .page {
        margin: 0;
        box-shadow: none;
        width: 100%;
        min-height: calc(100vh - 2px);
        overflow: hidden;
    }
    .form-table,
    .form-table th,
    .form-table td,
    .bank-table,
    .bank-table th,
    .bank-table td {
        border: 1px solid #ddd !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .form-table th,
    .bank-table th {
        background: #e9f4f2 !important;
    }
    .submit-section,
    .signature-modal {
        display: none !important;
    }
}

/* Header */
.header {
    background: var(--white);
    padding: 18px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* 로고 십자는 원본 조합 로고색(녹색)을 유지 */
.logo-mark rect {
    fill: var(--logo-green);
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-gray);
    letter-spacing: -1px;
    line-height: 1;
}

.logo-sub {
    display: flex;
    flex-direction: column;
    font-size: 9px;
    font-weight: 500;
    color: #555;
    line-height: 1.3;
    white-space: nowrap;
}

/* Title Section */
.title-section {
    text-align: center;
    flex: 1;
    padding: 0;
    border: none;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-gray);
    letter-spacing: 3px;
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.doc-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
}

.doc-info-label {
    color: #999;
    font-weight: 500;
    min-width: 50px;
}

.doc-info-value {
    border: 1px solid #ddd;
    padding: 2px 8px;
    border-radius: 3px;
    min-width: 80px;
    background: #fafafa;
}

/* Content */
.content {
    padding: 14px 35px;
    padding-bottom: 48px;
}

/* Section */
.section {
    margin-bottom: 12px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.section-number {
    background: var(--primary);
    color: var(--white);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-gray);
}

/* 섹션 우측 끝 안내문구 (표 바깥)
   제목과 표 사이 간격은 그대로 두고, 안내문구만 표 쪽으로 내려붙입니다.
   position: relative 이므로 다른 요소의 위치에는 영향이 없습니다. */
.section-note {
    margin-left: auto;
    position: relative;
    top: 5px;
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

/* Form Table */
.form-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* colgroup 비율(15/35/15/35)을 그대로 유지 */
}

.form-table th,
.form-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
    min-height: 38px;
    height: auto;
}

.form-table th {
    background: linear-gradient(180deg, var(--primary-tint-light) 0%, var(--primary-tint) 100%);
    font-weight: 500;
    color: var(--dark-gray);
    white-space: nowrap;
    text-align: center;
}

.form-table td {
    background: var(--white);
}

.form-table input[type="text"],
.form-table input[type="email"] {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    padding: 0;
}

.form-table input:focus {
    background: #f1fbfa;
    border-radius: 3px;
}

/* 연락처 입력 그룹 */
.phone-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    flex-wrap: nowrap;
    min-width: 0;
}

.phone-input {
    width: 55px;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 60px;
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
}

.phone-input:focus {
    border-color: var(--primary);
}

.phone-separator {
    color: var(--dark-gray);
    flex-shrink: 0;
}

/* 주민등록번호 입력 그룹 - 앞/뒤 모두 테두리 없는 입력창 (뉴리프와 동일)
   type="password"인 뒷자리는 .form-table input[type="text"] 규칙에 걸리지 않으므로
   두 칸 모두를 잡는 규칙을 뒤에 두어 동일하게 처리합니다. */
.ssn-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    width: 100%;
    min-width: 0;
}

.form-table input.ssn-input {
    flex: 0 0 auto;
    width: 58px;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
}

.form-table input.ssn-input::placeholder {
    color: #bbb;
    font-size: 12px;
}

.ssn-separator {
    color: var(--dark-gray);
    flex-shrink: 0;
}

/* 주소 입력 그룹 */
.address-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.address-input {
    flex: 1;
    min-width: 200px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    padding: 0;
    cursor: pointer;
}

.address-input:read-only {
    background: transparent;
}

.address-input::placeholder {
    color: #bbb;
    font-size: 12px;
}

.address-detail-input {
    flex: 1;
    min-width: 150px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.address-detail-input:focus {
    border-color: var(--primary);
}

.address-detail-input::placeholder {
    color: #bbb;
    font-size: 12px;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

/* 라벨 안에 날짜 입력창 등이 함께 들어가므로 실제 컨트롤만 지정합니다 */
.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Custom Radio/Checkbox for PDF */
.custom-radio,
.custom-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #999;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    flex-shrink: 0;
}

.custom-checkbox {
    border-radius: 3px;
}

.custom-radio.checked,
.custom-checkbox.checked {
    border-color: var(--primary);
    background: var(--primary);
}

.custom-radio.checked::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.custom-checkbox.checked::after {
    content: '\2713';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* CMS Section */
.cms-info-box {
    background: linear-gradient(135deg, var(--primary-tint-light) 0%, var(--primary-tint) 100%);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.cms-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
    font-size: 13px;
}

.cms-title-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
}

.cms-description {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

/* Bank Info */
.bank-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.bank-table th,
.bank-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 13px;
    vertical-align: middle;
    min-height: 38px;
    height: auto;
}

.bank-table th {
    background: linear-gradient(180deg, var(--primary-tint-light) 0%, var(--primary-tint) 100%);
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
}

.bank-table td {
    background: white;
}

.bank-table input[type="text"] {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    padding: 0;
}

.bank-table input::placeholder {
    color: #bbb;
    font-size: 12px;
}

.bank-table input[type="text"]:focus {
    background: #f1fbfa;
    border-radius: 3px;
}

/* 후원금액 */
.amount-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.amount-option {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.amount-option input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.amount-input {
    border: 1px solid #ddd !important;
    border-radius: 4px;
    padding: 3px 8px !important;
    width: 80px !important;
    font-size: 13px;
    text-align: right;
}

.amount-input:focus {
    border-color: var(--primary) !important;
}

/* PDF 출력용 - 직접입력 금액을 비워도 밑줄 빈칸이 남도록 (입력창을 대체) */
.amount-value {
    display: inline-block;
    width: 76px;
    min-height: 16px;
    padding: 0 4px;
    border-bottom: 1px solid #999;
    text-align: center;
    font-size: 13px;
    vertical-align: middle;
}

/* 이체 희망일 */
.date-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.transfer-note {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #888;
}

/* 표 아래 안내 문구 */
.table-note {
    margin: -2px 0 10px;
    font-size: 11px;
    color: #666;
}

/* Agreement Section */
.agreement-box {
    background: #fbfbfb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.agreement-content {
    font-size: 9.5px;
    color: #555;
    line-height: 1.5;
}

.terms-group {
    margin-bottom: 6px;
}

.terms-group:last-child {
    margin-bottom: 0;
}

.terms-heading {
    font-weight: 700;
    color: var(--dark-gray);
    font-size: 10.5px;
    margin-bottom: 2px;
}

.terms-list {
    list-style: none;
    padding-left: 8px;
}

.terms-list > li {
    position: relative;
    padding-left: 9px;
    margin-bottom: 1px;
}

.terms-list > li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #777;
}

.terms-sublist {
    list-style: none;
    padding-left: 6px;
    margin-top: 1px;
}

.terms-sublist > li {
    padding-left: 14px;
    text-indent: -14px;
}

.agreement-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.agreement-check input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.agreement-check label {
    font-weight: 500;
    font-size: 12px;
}

.agreement-notice {
    margin-left: auto;
    font-size: 11px;
    color: #888;
    text-align: right;
    display: flex;
    align-items: center;
}

/* Signature Section */
.signature-section {
    margin-top: 6px;
    padding-top: 4px;
}

.date-line {
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 12px;
    color: var(--dark-gray);
}

.date-input {
    border: none;
    border-bottom: 1px solid var(--dark-gray);
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
}

.date-input.date-year {
    width: 50px;
}

.signature-area {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.signature-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.signature-label {
    font-weight: 500;
    white-space: nowrap;
}

.signature-input {
    border: none;
    border-bottom: 1px solid var(--dark-gray);
    width: 120px;
    text-align: center;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    padding: 5px 0;
}

.signature-box {
    width: 120px;
    height: 50px;
    border: 1px solid var(--dark-gray);
    border-radius: 4px;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.signature-box:hover {
    background: var(--primary-tint);
    border-color: var(--primary);
}

.signature-box.has-signature {
    background: white;
}

.signature-box img {
    max-width: calc(100% - 4px);
    max-height: calc(100% - 4px);
    margin: 2px;
}

.signature-placeholder {
    color: #999;
    font-size: 11px;
    text-align: center;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-gray);
    color: var(--white);
    padding: 10px 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 1px;
}

/* Signature Modal */
.signature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.signature-modal.active {
    display: flex;
}

.signature-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.signature-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.signature-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-gray);
}

.signature-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.signature-canvas-container {
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    touch-action: none;
}

#signatureCanvas {
    width: 100%;
    height: 200px;
    display: block;
    background: white;
    touch-action: none;
}

.signature-modal-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear {
    background: #f0f0f0;
    color: #666;
}

.btn-clear:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: var(--primary);
    color: white;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

/* Submit Section */
.submit-section {
    background: var(--white);
    padding: 20px 35px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: center;
    gap: 15px;
    position: sticky;
    bottom: 0;
}

.btn-submit {
    padding: 15px 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 133, 122, 0.35);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-gray);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: #e74c3c;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: var(--dark-gray);
}

/* Complete Page */
.complete-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f6fbfa 0%, #ddefec 100%);
    z-index: 4000;
    align-items: center;
    justify-content: center;
}

.complete-page.active {
    display: flex;
}

.complete-content {
    text-align: center;
    padding: 40px;
}

.complete-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 40px;
    color: white;
}

.complete-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 40px;
}

.complete-btn {
    padding: 15px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.complete-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 133, 122, 0.35);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        background: var(--white);
    }

    .page {
        width: 100%;
        min-height: auto;
        margin: 0;
        box-shadow: none;
    }

    /* 모바일 헤더 */
    .header {
        padding: 12px 15px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
    }

    .logo-mark {
        width: 28px;
        height: 28px;
    }

    .logo-name {
        font-size: 16px;
    }

    .logo-sub {
        display: none;
    }

    .title-section {
        flex: 1;
        text-align: center;
        margin-left: 0;
    }

    .page-title {
        font-size: 15px;
        letter-spacing: 1px;
    }

    .doc-info {
        display: none;
    }

    /* 컨텐츠 */
    .content {
        padding: 15px;
        padding-bottom: 80px;
    }

    .section {
        margin-bottom: 20px;
    }

    /* 테이블 - 모바일 2열 구조 */
    .form-table,
    .form-table tbody,
    .bank-table,
    .bank-table tbody {
        display: block;
        width: 100%;
        border: 1px solid #ddd;
    }

    .form-table tr,
    .bank-table tr {
        display: flex;
        flex-wrap: wrap;
        border-bottom: none;
    }

    .form-table th,
    .form-table td,
    .bank-table th,
    .bank-table td {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        border: none;
        border-bottom: 1px solid #ddd;
        padding: 12px;
        font-size: 13px;
        min-height: 48px;
    }

    .form-table th,
    .bank-table th {
        width: 32% !important;
        min-width: auto;
        background: linear-gradient(180deg, var(--primary-tint-light) 0%, var(--primary-tint) 100%);
        border-right: 1px solid #ddd;
        justify-content: center;
    }

    .form-table td,
    .bank-table td {
        width: 68% !important;
    }

    .form-table td[colspan="3"],
    .bank-table td[colspan="5"] {
        width: 68% !important;
        align-items: flex-start;
        flex-wrap: wrap;
        flex-direction: column;
        justify-content: center;
    }

    .form-table input[type="text"],
    .bank-table input[type="text"] {
        font-size: 16px; /* iOS 줌 방지 */
        width: 100%;
    }

    .amount-input {
        font-size: 16px;
        width: 90px !important;
    }

    .table-note {
        font-size: 10px;
    }

    /* 연락처 */
    .phone-input-group {
        height: 24px;
        gap: 3px;
    }

    .phone-input {
        width: 48px;
        padding: 2px 4px;
        font-size: 13px;
        height: 24px;
    }

    .phone-separator {
        font-size: 12px;
    }

    /* 주민등록번호 */
    .ssn-input-group {
        height: 24px;
        gap: 3px;
    }

    .form-table input.ssn-input {
        font-size: 16px; /* iOS 줌 방지 */
        width: 72px;
    }

    .ssn-separator {
        font-size: 12px;
    }

    .section-note {
        font-size: 9px;
        white-space: normal;
        text-align: right;
    }

    /* 주소 */
    .address-wrapper {
        flex-direction: column;
    }

    .address-input {
        width: 100%;
        min-width: auto;
    }

    .address-detail-input {
        width: 100%;
        min-width: auto;
        padding: 8px;
        font-size: 16px;
    }

    /* 체크박스/라디오 */
    .checkbox-group,
    .radio-group,
    .date-options {
        gap: 10px;
    }

    .checkbox-item,
    .radio-item,
    .amount-option {
        font-size: 12px;
    }

    .amount-options {
        gap: 10px;
    }

    /* 동의사항 */
    .agreement-box {
        padding: 10px;
    }

    .agreement-content {
        font-size: 9.5px;
    }

    .agreement-check label {
        font-size: 11px;
    }

    .agreement-notice {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
        text-align: left;
    }

    /* 서명 */
    .date-line {
        font-size: 12px;
        margin: 20px 0;
    }

    .signature-area {
        justify-content: center;
        gap: 20px;
    }

    .signature-row {
        font-size: 12px;
    }

    .signature-input {
        width: 100px;
        font-size: 12px;
    }

    .signature-box {
        width: 100px;
        height: 45px;
    }

    /* 제출 버튼 */
    .submit-section {
        padding: 15px;
    }

    .btn-submit {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }

    /* 푸터 */
    .footer {
        position: relative;
        padding: 12px 15px;
        text-align: center;
    }
}

/* 더 작은 화면 (375px 이하) */
@media (max-width: 375px) {
    .header {
        padding: 10px 12px;
    }

    .logo-name {
        font-size: 14px;
    }

    .page-title {
        font-size: 13px;
        letter-spacing: 0;
    }

    .content {
        padding: 12px;
        padding-bottom: 80px;
    }

    .form-table th,
    .form-table td,
    .bank-table th,
    .bank-table td {
        padding: 8px;
        font-size: 11px;
    }

    .phone-input {
        width: 45px;
    }

    .form-table th,
    .bank-table th {
        width: 35% !important;
    }

    .form-table td,
    .bank-table td {
        width: 65% !important;
    }

    .form-table td[colspan="3"],
    .bank-table td[colspan="5"] {
        width: 65% !important;
    }
}

/* ===== 주소 검색 레이어 (텔레그램 인앱 브라우저 대응) ===== */
.postcode-layer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

.postcode-layer.active {
    display: flex;
}

.postcode-layer-content {
    width: 95%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.postcode-layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.postcode-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#postcodeEmbed {
    width: 100%;
    height: 450px;
}

@media (max-width: 768px) {
    .postcode-layer-content {
        width: 100%;
        max-width: none;
        height: 100%;
        border-radius: 0;
    }

    #postcodeEmbed {
        height: calc(100% - 48px);
    }
}

/* ===== 조합 가입신청서 전용 ===== */

/* 원본 서식의 개정일 표기 */
.form-revision {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    color: #999;
    letter-spacing: 0;
}

.doc-info-blank {
    color: #bbb;
}

.birth-input {
    letter-spacing: 1px;
}

.form-table input::placeholder {
    color: #bbb;
}

.optional-tag {
    display: inline-block;
    margin-left: 2px;
    padding: 0 4px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid #ccd;
    color: #888;
    font-size: 9px;
    font-weight: 400;
    vertical-align: 1px;
}

/* 출자금 계좌 */
.share-account-box .cms-title {
    flex-wrap: wrap;
    font-size: 15px;
    margin-bottom: 2px;
}

.share-account-holder {
    font-size: 11px;
    font-weight: 500;
    color: #555;
}

.share-account-warn {
    color: #c0392b;
    font-weight: 500;
}

.share-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
}

.share-gap {
    margin-left: 14px;
}

.bank-table input.share-input,
.share-input {
    width: 44px;
    border: none;
    border-bottom: 1px solid var(--dark-gray);
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    padding: 2px 0;
    outline: none;
}

.bank-table input.share-input.share-amount {
    width: 96px;
}

.share-input.is-locked {
    color: #555;
    border-bottom-color: #bbb;
}

.share-value {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    border-bottom: 1px solid var(--dark-gray);
    font-weight: 500;
}

.share-hint {
    margin-left: auto;
    font-size: 11px;
    color: var(--primary-dark);
}

.reduced-check,
.reduced-check ~ .transfer-note {
    white-space: normal;
}

/* 감면 대상 증빙 안내 — 내야 할 서류가 있다는 뜻이라 회색 안내보다 눈에 띄게 */
.reduced-proof {
    color: var(--primary-dark);
    font-weight: 500;
}

.reduced-proof a,
.complete-proof a {
    color: inherit;
    text-decoration: none;
}

.share-notes {
    margin: -2px 0 0 16px;
    font-size: 10.5px;
    color: #666;
    line-height: 1.55;
}

/* 동의 3문항 */
.consent-intro {
    font-size: 11px;
    color: #555;
    line-height: 1.6;
}

.terms-link,
.terms-peek {
    border: 1px solid var(--primary);
    background: var(--white);
    color: var(--primary-dark);
    font-family: inherit;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
}

.terms-link {
    margin-left: 4px;
    padding: 1px 8px;
    font-size: 11px;
}

.terms-peek {
    margin-left: 4px;
    padding: 0 6px;
    font-size: 10px;
    vertical-align: 1px;
}

.consent-rows {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.consent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    font-size: 12px;
}

.consent-a {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

/* 서약문 */
.pledge {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    word-break: keep-all;
}

.addressee {
    margin-top: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* 동의서 전문 팝업 (원본 서식 뒷면) */
.terms-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.terms-modal.active {
    display: flex;
}

.terms-modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
}

.terms-modal-title {
    font-size: 15px;
    font-weight: 700;
}

.terms-modal-body {
    overflow-y: auto;
    padding: 14px 18px;
    -webkit-overflow-scrolling: touch;
}

.terms-modal-buttons {
    padding: 12px 18px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}

.terms-modal-buttons .btn {
    min-width: 120px;
}

.back-intro {
    font-size: 11px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.terms-doc {
    font-size: 12.5px;
    line-height: 1.7;
    color: #444;
    word-break: keep-all;
}

.terms-doc-title {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 13.5px;
    margin: 14px 0 4px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    scroll-margin-top: 4px;
}

.terms-columns > .terms-doc:first-child .terms-doc-title:first-child {
    border-top: none;
    padding-top: 0;
}

.terms-doc-title:first-child {
    margin-top: 0;
}

.terms-h {
    font-weight: 700;
    color: var(--dark-gray);
    margin-top: 5px;
}

.terms-doc p.i {
    padding-left: 10px;
}

.complete-desc {
    margin: -24px 0 32px;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.complete-desc.complete-proof {
    margin-top: -16px;
}

@media (max-width: 768px) {
    .form-revision {
        display: none;
    }

    .share-hint {
        margin-left: 0;
        width: 100%;
    }

    /* 출자금 표는 칸 안 내용을 세로로 쌓습니다 (감면 대상 안내가 잘리지 않게) */
    .bank-table td {
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: center;
        gap: 4px;
    }

    .share-gap {
        margin-left: 6px;
    }

    .bank-table input.share-input.share-amount {
        width: 80px;
    }

    .consent-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }

    .pledge {
        font-size: 12px;
        text-align: left;
    }

    .addressee {
        font-size: 14px;
    }

    .terms-modal {
        padding: 0;
        align-items: flex-end;
    }

    .terms-modal-content {
        max-width: none;
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
    }

    .terms-modal-buttons .btn {
        width: 100%;
    }
}

.nowrap {
    white-space: nowrap;
}
