@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;
}

:root {
    --primary-green: #5a9e2f;
    --primary-green-light: #7cb850;
    --primary-green-dark: #3d7a1a;
    --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;
    }
    .page {
        margin: 0;
        box-shadow: none;
        width: 100%;
        min-height: 100vh;
    }
    .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: #f0f5e8 !important;
    }
    .submit-section,
    .signature-modal {
        display: none !important;
    }
}

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

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

.header-logo {
    height: 70px;
    width: auto;
}

/* 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: 8px;
}

.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: 18px 35px;
    padding-bottom: 70px;
}

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

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

.section-number {
    background: var(--primary-green);
    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);
}

/* Form Table */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.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, #f8faf5 0%, #f0f5e8 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: #fffef0;
    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-green);
}

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

/* 주민등록번호 입력 그룹 */
.ssn-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
}

.ssn-input {
    width: 80px;
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
}

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

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

/* 툴팁 */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #999;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
}

.tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-gray);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dark-gray);
}

.tooltip-wrapper:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* 이메일 입력 그룹 */
.email-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    height: 22px;
}

.email-local {
    flex: 1;
    min-width: 60px;
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.email-local:focus {
    border-color: var(--primary-green);
}

.email-at {
    color: var(--dark-gray);
}

.email-domain-select {
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    outline: none;
}

.email-domain-select:focus {
    border-color: var(--primary-green);
}

.email-domain-input {
    width: 100px;
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    display: none;
}

.email-domain-input:focus {
    border-color: var(--primary-green);
}

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

.email-domain-input.show {
    display: block;
}

/* 이메일 직접입력 모드 */
.email-input-group.direct-mode {
    flex-wrap: nowrap;
}

.email-input-group.direct-mode .email-local {
    flex: 1;
    min-width: 0;
}

.email-input-group.direct-mode .email-domain-select {
    display: none;
}

.email-input-group.direct-mode .email-domain-input.show {
    display: block;
    flex: 1;
    min-width: 0;
    width: auto;
}

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

.address-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.address-input {
    flex: 1;
    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-search-btn {
    padding: 4px 10px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.address-search-btn:hover {
    background: var(--primary-green-dark);
}

.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-green);
}

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

.inline-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.inline-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 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,
.radio-item input {
    accent-color: var(--primary-green);
    width: 18px;
    height: 18px;
}

/* 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-green);
    background: var(--primary-green);
}

.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;
}

/* 생년월일 입력 그룹 */
.birth-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
}

.birth-input {
    padding: 2px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
}

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

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

.birth-year {
    width: 50px;
}

.birth-month,
.birth-day {
    width: 35px;
}

.birth-separator {
    color: var(--dark-gray);
}

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

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

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

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

/* Amount Selection */
.amount-section {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.amount-category {
    margin-bottom: 8px;
}

.amount-category:last-child {
    margin-bottom: 0;
}

.amount-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amount-label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-green);
    border-radius: 50%;
}

.amount-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-left: 12px;
}

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

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

.amount-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    width: 80px;
    font-size: 14px;
}

/* 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, #f8faf5 0%, #f0f5e8 100%);
    font-weight: 500;
    width: 100px;
    white-space: nowrap;
    text-align: center;
}

.bank-table td {
    background: white;
}

.bank-table input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    outline: none;
    padding: 0;
}

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

.bank-table input:focus {
    background: #fffef0;
    border-radius: 3px;
}

/* Date Selection */
.date-selection {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.date-label {
    font-weight: 500;
    font-size: 13px;
}

.date-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

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

.agreement-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--dark-gray);
}

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

.terms-section {
    margin-bottom: 3px;
}

.terms-section strong {
    color: var(--dark-gray);
}

.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-green);
    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: 15px;
    padding-top: 12px;
    border-top: 2px solid var(--primary-green);
}

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

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

.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;
    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: #f0f5e8;
    border-color: var(--primary-green);
}

.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: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.footer-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-green);
}

.footer-info {
    font-size: 9px;
    color: var(--medium-gray);
    text-align: right;
}

/* Gender Selection Styling */
.gender-group {
    display: flex;
    gap: 15px;
}

.gender-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Member Type */
.member-type-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.row-span-2 {
    vertical-align: top;
}

.input-suffix {
    color: var(--medium-gray);
    font-size: 10px;
}

/* 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-green);
    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-green);
    color: white;
}

.btn-confirm:hover {
    background: var(--primary-green-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-green);
    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-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 158, 47, 0.4);
}

.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-green);
}

.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-green);
    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, #f8faf5 0%, #e8f5e0 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-green);
    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-green);
    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-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 158, 47, 0.4);
}

/* ===== 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-section {
        display: flex;
        flex-shrink: 0;
    }

    .header-logo {
        height: 45px;
    }

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

    .page-title {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .doc-info {
        display: none;
    }

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

    .section {
        margin-bottom: 20px;
    }

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

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

    .form-table th,
    .form-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 {
        width: 30%;
        min-width: auto;
        background: linear-gradient(180deg, #f8faf5 0%, #f0f5e8 100%);
        border-right: 1px solid #ddd;
        justify-content: center;
    }

    .form-table td {
        width: 70%;
    }

    /* colspan="3" 처리 - 전체 너비 */
    .form-table tr:has(td[colspan="3"]) th,
    .form-table td[colspan="3"] {
        min-height: 68px;
    }

    .form-table td[colspan="3"] {
        width: 70%;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    /* colspan 셀 내부 콘텐츠 너비 제한 */
    .form-table td[colspan="3"] .checkbox-group,
    .form-table td[colspan="3"] .radio-group {
        width: 100%;
        flex-wrap: wrap;
    }

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

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

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

    .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;
    }

    .bank-table th {
        width: 30% !important;
        min-width: auto;
        background: linear-gradient(180deg, #f8faf5 0%, #f0f5e8 100%);
        border-right: 1px solid #ddd;
        justify-content: center;
    }

    .bank-table td {
        width: 70% !important;
    }

    .bank-table tr:has(td[colspan="3"]) th,
    .bank-table td[colspan="3"] {
        min-height: 68px;
    }

    .bank-table td[colspan="3"] {
        width: 70% !important;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bank-table input {
        width: 100%;
        border: none;
        background: transparent;
        font-size: 16px;
        padding: 0;
        outline: none;
    }

    /* 연락처 */
    .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;
    }

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

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

    /* 툴팁 - 모바일 */
    .tooltip-icon {
        width: 12px;
        height: 12px;
        font-size: 9px;
    }

    .tooltip-text {
        font-size: 10px;
        padding: 5px 8px;
    }

    /* 이메일 */
    .email-input-group {
        height: 24px;
        gap: 3px;
    }

    .email-local {
        min-width: 50px;
        padding: 2px 4px;
        font-size: 13px;
        height: 24px;
    }

    .email-domain-select {
        padding: 2px 4px;
        font-size: 13px;
        height: 24px;
        max-width: 90px;
    }

    .email-domain-input {
        width: 70px;
        padding: 2px 4px;
        font-size: 13px;
        height: 24px;
    }

    .email-at {
        font-size: 12px;
    }

    /* 이메일 직접입력 모드 */
    .email-input-group.direct-mode {
        flex-wrap: nowrap;
        height: auto;
    }

    .email-input-group.direct-mode .email-local {
        flex: 1;
        min-width: 0;
    }

    .email-input-group.direct-mode .email-domain-select {
        display: none;
    }

    .email-input-group.direct-mode .email-domain-input.show {
        display: block;
        flex: 1;
        min-width: 0;
        width: auto;
    }

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

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

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

    /* 생년월일 */
    .birth-input-group {
        height: 24px;
        gap: 3px;
    }

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

    .birth-year {
        width: 45px;
    }

    .birth-month,
    .birth-day {
        width: 30px;
    }

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

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

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

    /* 후원금 */
    .amount-options {
        gap: 12px;
    }

    .amount-option {
        font-size: 12px;
    }

    .amount-input {
        width: 70px;
        font-size: 16px;
    }

    /* 출금일 */
    .date-selection {
        gap: 10px;
        width: 100%;
    }

    .date-options {
        gap: 15px;
        width: 100%;
        flex-wrap: wrap;
    }

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

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

    .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;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .footer-info {
        text-align: center;
    }
}

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

    .header-logo {
        height: 40px;
    }

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

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

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

    .phone-input {
        width: 45px;
    }

    /* 생년월일 - 작은 화면 */
    .birth-input {
        font-size: 11px;
        padding: 2px 3px;
    }

    .birth-year {
        width: 40px;
    }

    .birth-month,
    .birth-day {
        width: 26px;
    }

    .form-table th {
        width: 35%;
    }

    .form-table td {
        width: 65%;
    }

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

    .bank-table td {
        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-green);
    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);
    }
}
