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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* 미니멀 헤더 - 배경 이미지 섹션 */
.minimal-header {
    height: 20vh;
    background: linear-gradient(
        rgba(19, 45, 37, 0.9),
        rgba(19, 45, 37, 0.7)
    ), url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* z-index가 작동하도록 relative로 설정 */
    z-index: 1000; /* 카드보다 위에 배치 */
}

.header-content {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 0 20px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: center;
}

.header-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* 메인 컨테이너 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 10px 20px 10px; /* 헤더가 sticky하지 않으므로 상단 패딩 줄임 */
    background: #f8f9fa;
}

/* 플로팅 카드 시스템 */
.floating-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #132D25, #0f251f);
    color: white;
    padding: 25px;
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6a140c, #132D25);
}

.card-header h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header p {
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* 헤더 전체 동의 체크박스 */
.header-checkbox-group {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.header-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.header-checkbox-label:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.header-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #6a140c;
    cursor: pointer;
    border-radius: 3px;
}

.header-checkbox-text {
    user-select: none;
}

.card-content {
    padding: 40px 15px 30px 15px;
}

/* 플로팅 카드용 체크박스 그룹 */
.card-content .checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 3px solid #132D25;
}

.card-content .checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: #132D25;
    transform: scale(1.1);
}

.card-content .checkbox-group label {
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
    flex: 1;
    font-size: 0.9rem;
    color: #2c3e50;
}

.form-header {
    background: linear-gradient(135deg, #132D25, #0f251f);
    color: white;
    padding: 35px 40px;
    text-align: center;
}

.form-header h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.form-header p {
    opacity: 0.95;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-content {
    padding: 40px 25px;
}


/* 기존 header 스타일은 제거하고 대체 */
header {
    display: none;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    color: #132D25;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #132D25;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 22px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
    line-height: 1.5;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #132D25;
    background: white;
    box-shadow: 0 0 0 3px rgba(19, 45, 37, 0.1);
    transform: translateY(-1px);
}

/* readonly 필드 스타일 - 시각적으로 구분되도록 */
input[readonly] {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #666;
    cursor: not-allowed;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
}

.radio-group label {
    font-weight: 500;
}

.checkbox-group {
    margin-top: 20px;
}

.checkbox-group label {
    font-weight: bold;
}

.description {
    color: #666;
    margin-bottom: 15px;
    background-color: #f0f4f8;
    padding: 15px;
    border-radius: 4px;
}

.description p {
    font-size: 0.9em;
    line-height: 1.6;
}

.description b,
.description strong {
    font-weight: bold;
}

.description b[style*="color: red"] {
    color: red !important;
    font-weight: bold;
}

.terms-box {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.terms-box h3 {
    margin-top: 15px;
    margin-bottom: 5px;
}

.terms-box ol {
    padding-left: 25px;
}

.terms-box ol ol {
    padding-left: 20px;
}

.info-block-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.info-block {
    padding: 10px 15px;
}

.info-block:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.info-block h4 {
    font-weight: 600;
    color: #132D25;
    margin-bottom: 5px;
}

.info-block p,
.info-block ol {
    margin: 0;
    padding-left: 0;
}

.info-block ol {
    padding-left: 20px;
}

.signature-pad-container {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 12px;
    background-color: #fff;
    margin-bottom: 20px;
    overflow: hidden;
    min-height: 200px;

    /* 텍스트 선택 방지 (표준 속성) */
    user-select: none;
    touch-action: none;

    /* 웹킷 기반 브라우저 최적화 */
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

canvas {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    display: block;

    /* 터치 최적화 (표준 속성) */
    touch-action: none;
    user-select: none;

    /* 웹킷 기반 브라우저 최적화 */
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;

    /* 추가 최적화 */
    -webkit-user-drag: none;
    user-drag: none;
}

.submit-container {
    text-align: center;
    margin-top: 40px;
}

/* ========================================= */
/* ✨ Magic MCP Generated Button Styles ✨ */
/* ========================================= */

/* Base Button Style */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Primary Button (for main actions) */
.btn-primary {
    color: #fff;
    background-color: #132D25;
    border-color: #132D25;
}

.btn-primary:hover {
    background-color: #0b1a15; /* Darker shade */
    border-color: #0b1a15;
}

/* Secondary Button (for destructive actions) */
.btn-secondary {
    color: #fff;
    background-color: #82180F;
    border-color: #82180F;
}

.btn-secondary:hover {
    background-color: #6a140c; /* Darker shade */
    border-color: #6a140c;
}

/* Small Button */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    letter-spacing: 0;
}

/* Full-width button */
.btn-block {
    display: block;
    width: 100%;
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

/* Example image container */
.example-image-container {
    text-align: center;
    margin: 20px 0;
}

.example-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Divider */
.divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 30px 0;
}

/* Preview image */
.preview-image {
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.hidden {
    display: none;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

table tr:hover {
    background-color: #f9f9f9;
}

table tr:last-child td {
    border-bottom: none;
}

/* Responsive table and layout */
/* 데스크톱 최적화 */
@media (min-width: 1024px) {
    .header-title {
        font-size: 2.2rem; /* PC에서 헤더 타이틀 폰트 크기 확대 */
        font-weight: 700;
    }

    .header-subtitle {
        font-size: 1.2rem; /* PC에서 헤더 서브타이틀 폰트 크기 확대 */
        margin-top: 12px;
    }
}

/* 모바일 최적화 강화 */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 16px;
    }

    .container {
        padding: 40px 8px 8px 8px; /* 모바일에서도 상단 패딩 추가 */
        max-width: 100%;
    }

    .floating-card {
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .card-header {
        padding: 20px 18px 16px 18px;
    }

    .header-checkbox-group {
        margin-top: 12px;
        padding-top: 12px;
    }

    .header-checkbox-label {
        font-size: 0.9rem;
        gap: 8px;
    }

    .header-checkbox {
        width: 16px;
        height: 16px;
    }

    .card-content {
        padding: 25px 18px 20px 18px;
    }

    /* 모바일에서 체크박스 그룹 패딩 줄이기 */
    .card-content .checkbox-group {
        padding: 8px 12px;
        margin-bottom: 15px;
        gap: 10px;
    }

    .card-content .checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        transform: scale(1);
    }

    .header-title {
        font-size: 1rem;
    }

    .btn-block {
        padding: 18px;
        font-size: 1rem;
        font-weight: 600;
        min-height: 56px;
        border-radius: 12px;
    }

    .checkbox-group label,
    .radio-group label {
        font-size: 0.9rem;
        line-height: 1.5;
        padding: 10px 0;
        min-height: 40px;
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    /* 서명 패드 모바일 */
    .signature-pad-container {
        min-height: 180px;

        /* 모바일 터치 최적화 강화 */
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;

        border-radius: 12px;
        border: 2px solid #ddd;
    }

    .signature-pad-container canvas {
        height: 180px;

        /* 모바일 캔버스 터치 최적화 */
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-drag: none;
        user-drag: none;
    }

    /* 터치 친화적 버튼 */
    .btn-secondary {
        min-height: 44px;
        padding: 12px 16px;
        border-radius: 8px;
    }

    /* 파일 업로드 최적화 */
    input[type="file"] {
        padding: 18px;
        font-size: 1rem;
        border: 2px dashed #dee2e6;
        border-radius: 12px;
        background: #f8f9fa;
        cursor: pointer;
        min-height: 56px;
    }

    /* 입력 필드 개선 */
    input[type="text"], input[type="email"], input[type="tel"],
    input[type="password"], input[type="date"], select {
        padding: 20px 18px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 56px;
    }

    .form-group label {
        font-size: 1rem;
        margin-bottom: 10px;
        font-weight: 600;
    }

    /* 셍션 스타일 */
    .section-title {
        font-size: 1rem;
        margin-bottom: 16px;
        line-height: 1.4;
    }

    .description {
        margin-bottom: 20px;
    }

    .description p {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    /* 약관 박스 */
    .terms-box {
        font-size: 0.9rem;
        line-height: 1.6;
        padding: 18px;
        border-radius: 12px;
    }

    /* 정보 블록 */
    .info-block {
        margin-bottom: 15px;
        padding: 12px 18px;
        border-radius: 12px;
    }

    .info-block h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    /* 예시 이미지 */
    .example-image-container {
        text-align: center;
        margin: 20px 0;
    }

    .example-image, .preview-image {
        border-radius: 12px;
        max-width: 100%;
        margin-top: 15px;
    }


    /* 이전 스타일 유지 */
    .form-section {
        padding: 0;
    }

    table {
        font-size: 0.9em;
    }

    table th,
    table td {
        padding: 8px 10px;
    }
}

/* Additional form enhancements */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    margin: 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

/* File input styling */
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background-color: #fafafa;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #132D25;
    background-color: #f0f4ff;
}

/* Loading Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* 백드롭 클릭 시 모달이 닫히지 않도록 포인터 이벤트 처리 */
    pointer-events: auto;
}

.modal-overlay.hidden {
    display: none;
}

/* 모달이 열려 있을 때 body 스크롤 방지 및 상호작용 차단 */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100vh !important;

    /* iOS Safari 특화 스크롤 및 터치 방지 */
    -webkit-overflow-scrolling: auto !important; /* touch 스크롤 비활성화 */
    touch-action: none !important;
    -ms-touch-action: none !important;

    /* iOS Safari 바운스 및 줌 방지 */
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;

    /* 추가 오버스크롤 방지 */
    overscroll-behavior: none !important;
    -webkit-overscroll-behavior: none !important;
}

/* 컨테이너도 동일한 방지 속성 적용 */
body.modal-open .container,
body.modal-open * {
    touch-action: none !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
}

.spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #0b1a15 0deg,
        #132D25 90deg,
        #82180F 180deg,
        #0b1a15 270deg,
        #0b1a15 360deg
    );
    position: relative;
    animation: spin 1.2s linear infinite;
}

.spinner::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: white;
    border-radius: 50%;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button input {
    flex-grow: 1;
}

.input-with-button button {
    flex-shrink: 0;
}

.status-msg {
    font-size: 0.9em;
    margin-top: 8px;
}

.status-msg.success {
    color: #28a745;
}

.status-msg.error {
    color: #82180F;
}

/* ================================================== */
/* 폼 유효성 검사 스타일 (브랜드 색상 활용) */
/* ================================================== */

/* 필드별 오류 메시지 */
.field-error {
    font-size: 0.8rem;
    color: #82180F;
    margin-top: 5px;
    padding: 2px 0;
    min-height: 20px;
    transition: opacity 0.3s ease;
}

.field-error.hidden {
    display: none;
}

/* 입력 필드 상태별 스타일 */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #82180F;
    box-shadow: 0 0 0 2px rgba(130, 24, 15, 0.1);
    transition: all 0.3s ease;
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #0b1a15;
    box-shadow: 0 0 0 2px rgba(11, 26, 21, 0.1);
    transition: all 0.3s ease;
}

/* 서명 패드 오류 스타일 */
.signature-pad-container.error {
    border-color: #82180F;
    box-shadow: 0 0 0 2px rgba(130, 24, 15, 0.1);
    transition: all 0.3s ease;
}

.signature-pad-container.success {
    border-color: #0b1a15;
    box-shadow: 0 0 0 2px rgba(11, 26, 21, 0.1);
    transition: all 0.3s ease;
}

/* 파일 업로드 오류 스타일 */
input[type="file"].error {
    border-color: #82180F !important;
    background-color: rgba(130, 24, 15, 0.05);
    transition: all 0.3s ease;
}

input[type="file"].success {
    border-color: #0b1a15 !important;
    background-color: rgba(11, 26, 21, 0.05);
    transition: all 0.3s ease;
}

/* 라디오/체크박스 그룹 오류 스타일 */
.radio-group.error,
.checkbox-group.error {
    background-color: rgba(130, 24, 15, 0.05);
    border-radius: 4px;
    padding: 10px;
    border: 1px solid rgba(130, 24, 15, 0.2);
    transition: all 0.3s ease;
}

.radio-group.success,
.checkbox-group.success {
    background-color: rgba(11, 26, 21, 0.05);
    border-radius: 4px;
    padding: 10px;
    border: 1px solid rgba(11, 26, 21, 0.2);
    transition: all 0.3s ease;
}

/* ============================================= */
/* 수정 기능 관련 스타일 (브랜딩 컬러 적용) */
/* ============================================= */

.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }

.btn-link {
    background: none;
    border: none;
    color: #132D25; /* 브랜딩 컬러 적용 */
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: #0b1a15; /* 더 어두운 그린 */
    text-decoration: none;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px; /* 다른 요소들과 일관성 */
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 25px rgba(19, 45, 37, 0.15); /* 브랜딩 컬러로 그림자 */
    border: 1px solid rgba(19, 45, 37, 0.1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.6em;
    cursor: pointer;
    line-height: 1;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(130, 24, 15, 0.1); /* 브랜딩 레드 컬러 */
    color: #82180F;
    transform: scale(1.1);
}

/* ============================================= */
/* 반응형 디자인 - A 스타일 최적화 */
/* ============================================= */

@media (max-width: 768px) {
    .minimal-header {
        height: 22vh;
    }

    .header-title {
        font-size: 1.43rem;
    }

    .container {
        margin: -30px 12px 0;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }

    .form-content {
        padding: 25px 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-header {
        padding: 30px 25px;
    }

    .form-header h2 {
        font-size: 1rem;
    }

    .form-header p {
        font-size: 0.85rem;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .minimal-header {
        height: 20vh;
    }

    .header-title {
        font-size: 1.32rem;
        line-height: 1.3;
    }

    .header-subtitle {
        font-size: 1rem;
        margin-top: 6px;
    }

    .container {
        margin: -25px 8px 0;
        border-radius: 8px;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    }

    .form-content {
        padding: 20px 10px;
    }

    .form-header {
        padding: 25px 20px;
        border-radius: 8px 8px 0 0;
    }

    .form-header p {
        font-size: 0.8rem;
        padding: 12px;
        line-height: 1.5;
        border-radius: 6px;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .input-with-button {
        flex-direction: column;
        gap: 8px;
    }

    .input-with-button button {
        width: 100%;
    }

    /* 모바일에서 입력 필드 패딩 적절히 조정 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="date"],
    select {
        padding: 12px;
        border-radius: 6px;
    }
}

/* 하단 여백 추가 */
body::after {
    content: '';
    display: block;
    height: 100px;
}

/* ============================================= */
/* 이미지 크롭 모달 스타일 */
/* ============================================= */

.crop-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    position: relative;
    box-shadow: 0 8px 25px rgba(19, 45, 37, 0.15);
    border: 1px solid rgba(19, 45, 37, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crop-modal-content .card-header {
    background: linear-gradient(135deg, #132D25, #0f251f);
    color: white;
    padding: 20px 25px;
    position: relative;
    flex-shrink: 0;
}

.crop-modal-content .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6a140c, #132D25);
}

.crop-modal-content .card-header h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.crop-modal-content .card-header p {
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.crop-modal-content .card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.crop-container {
    width: 100%;
    min-height: 350px;
    max-height: 75vh; /* 캔버스 크기 확대 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px auto;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease-out; /* 더 빠른 트랜지션 */
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateZ(0); /* GPU 가속 활성화 */
    will-change: transform, width, height; /* 성능 최적화 */
}

.crop-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* Cropper.js 스타일링 개선 */
.crop-container .cropper-container {
    background: transparent !important;
    transition: all 0.2s ease-out; /* 더 빠른 반응 */
    transform: translateZ(0); /* GPU 가속 */
}

.crop-container .cropper-canvas {
    background: transparent !important;
    transition: transform 0.2s ease-out; /* 더 빠른 반응 */
    transform: translateZ(0); /* GPU 가속 */
}

.crop-container .cropper-canvas img {
    transition: transform 0.2s ease-out; /* 더 빠른 반응 */
    transform: translateZ(0); /* GPU 가속 */
}

.crop-container .cropper-modal {
    background: transparent !important;
    opacity: 0 !important;
}

/* 크롭 박스 스타일 개선 */
.crop-container .cropper-crop-box {
    transition: all 0.15s ease-out; /* 더 빠른 반응 */
    transform: translateZ(0); /* GPU 가속 */
}

.crop-container .cropper-view-box {
    outline: 2px solid #132D25;
    outline-color: rgba(19, 45, 37, 0.8);
    transition: outline-color 0.15s ease-out; /* 더 빠른 반응 */
    transform: translateZ(0); /* GPU 가속 */
}

/* 크롭 핸들 커스터마이징 */
.crop-container .cropper-point {
    width: 8px;
    height: 8px;
    background-color: #132D25;
    border: 2px solid #fff;
    border-radius: 50%;
    opacity: 0.8;
}

/* 모서리 핸들만 크게 */
.crop-container .cropper-point-se,
.crop-container .cropper-point-sw,
.crop-container .cropper-point-ne,
.crop-container .cropper-point-nw {
    width: 12px;
    height: 12px;
    background-color: #6a140c;
    border: 3px solid #fff;
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 변의 중앙 핸들은 작게 유지 */
.crop-container .cropper-point-n,
.crop-container .cropper-point-s,
.crop-container .cropper-point-e,
.crop-container .cropper-point-w {
    width: 6px;
    height: 6px;
    background-color: #132D25;
    border: 2px solid #fff;
}

/* 회전 중 로딩 인디케이터 */
.crop-container.rotating {
    position: relative;
}

.crop-container.rotating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(19, 45, 37, 0.3);
    border-top: 3px solid #132D25;
    border-radius: 50%;
    animation: cropRotateLoading 1s linear infinite;
    z-index: 1000;
}

@keyframes cropRotateLoading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.crop-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.crop-controls .btn {
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rotate-icon {
    font-size: 1em;
    font-weight: bold;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .crop-modal-content {
        width: 95%;
        max-height: 88vh; /* 헤더 완전 가시성 보장 */
        border-radius: 12px;
        display: flex;
        flex-direction: column;
    }

    .crop-modal-content .card-header {
        padding: 18px 20px; /* 헤더 패딩 증가로 가독성 향상 */
        flex-shrink: 0; /* 헤더가 압축되지 않도록 보장 */
        min-height: 80px; /* 최소 헤더 높이 보장 */
    }

    .crop-modal-content .card-header h3 {
        font-size: 1.1rem; /* 폰트 크기 약간 증가 */
        margin-bottom: 6px;
    }

    .crop-modal-content .card-content {
        padding: 15px;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0; /* flex 레이아웃에서 올바른 크기 계산 */
    }

    .crop-container {
        min-height: 250px; /* 최소 높이 더 증가 */
        max-height: 60vh; /* 캔버스 크기 대폭 확대 */
        transition: all 0.3s ease-out; /* 더 빠른 트랜지션 */
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
        flex: 1;
        transform: translateZ(0); /* GPU 가속 */
    }

    .crop-controls {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: space-around;
        flex-shrink: 0; /* 버튼 영역이 압축되지 않도록 보장 */
        margin-top: 15px;
    }

    .crop-controls .btn {
        min-width: 110px;
        min-height: 48px; /* 터치 최적화 크기 */
        font-size: 0.95rem;
        padding: 12px 16px;
        border-radius: 10px;
        touch-action: manipulation; /* 터치 최적화 */
    }

    .crop-controls .btn:disabled {
        opacity: 0.6;
        pointer-events: none;
    }
}

@media (max-width: 480px) {
    .crop-modal-content {
        width: 100%;
        height: 88vh; /* 헤더 완전 가시성을 위해 더 줄임 */
        border-radius: 12px; /* 둥근 모서리 복원 */
        max-height: 88vh;
        display: flex;
        flex-direction: column;
    }

    .crop-modal-content .card-header {
        padding: 20px 18px; /* 헤더 패딩 증가 */
        flex-shrink: 0;
        min-height: 85px; /* 작은 화면에서도 충분한 헤더 공간 */
    }

    .crop-modal-content .card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 12px;
    }

    .crop-container {
        min-height: 220px; /* 최소 높이 증가 */
        max-height: 55vh; /* 캔버스 크기 확대 */
        transition: all 0.3s ease-out; /* 더 빠른 트랜지션 */
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        flex: 1;
        transform: translateZ(0); /* GPU 가속 */
    }

    .crop-controls {
        padding: 0 10px;
        gap: 10px;
        flex-shrink: 0;
        margin-top: 12px;
    }

    .crop-controls .btn {
        min-width: 95px;
        min-height: 50px; /* 터치 영역 최적화 */
        font-size: 0.9rem;
        padding: 12px 14px;
        position: relative; /* 스피너 위치 기준점 */
    }

    .crop-controls .btn.loading {
        pointer-events: none; /* 로딩 중 클릭 방지 */
        opacity: 0.7;
    }

    .crop-controls .btn.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin-top: -10px;
        margin-left: -10px;
        border: 2px solid transparent;
        border-top: 2px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
}

/* --- 서명 모달 및 트리거 영역 스타일 --- */

/* 모달을 여는 영역 스타일 */
.signature-placeholder {
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}

.signature-placeholder:hover {
    background-color: #e9ecef;
    border-color: #132D25;
}

.signature-placeholder:active {
    transform: scale(0.98);
}

#signature-placeholder-text {
    color: #6c757d;
    font-weight: 500;
    font-size: 1.1rem;
}

.signature-placeholder.completed {
    border-color: #132D25;
    background-color: #f0f9f0;
}

.signature-placeholder.completed #signature-placeholder-text {
    color: #132D25;
    font-weight: 600;
}

/* 서명 모달 오버레이 */
#signature-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;

    /* 모달 자체 터치 동작 차단 */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;

    /* 텍스트 선택 및 블럭 방지 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#signature-modal-content {
    background-color: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideUp 0.3s ease-out;

    /* 모달 컨텐츠 텍스트 선택 방지 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #132D25, #0f251f);
    color: white;
    padding: 25px 25px 20px 25px;
    text-align: center;
    border-bottom: none;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6a140c, #132D25);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
    opacity: 0.9;
}

.signature-sections {
    padding: 20px 25px;
}

.signature-section {
    margin-bottom: 30px;
}

.signature-section:last-child {
    margin-bottom: 20px;
}

.signature-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
    font-size: 1rem;
}

.canvas-container {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    margin-bottom: 10px;
    position: relative;
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(0,0,0,0.05) 50%, transparent 51%);
    pointer-events: none;
    z-index: 1;
}

#modal-name-pad,
#modal-signature-pad {
    width: 100%;
    height: 180px;
    display: block;
    position: relative;
    z-index: 2;

    /* 핵심: 터치 및 스크롤 동작 차단 */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;

    /* 브라우저별 최적화 */
    -ms-touch-action: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;

    /* 추가 터치 방지 속성 */
    -webkit-overflow-scrolling: auto; /* touch 비활성화 */
    overscroll-behavior: none; /* 오버스크롤 차단 */

    /* iOS Safari 돋보기 및 컨텍스트 메뉴 차단 */
    -webkit-user-callout: none; /* iOS 콜아웃 메뉴 차단 */
    -webkit-user-modify: read-only; /* iOS 편집 모드 차단 */
    -webkit-text-size-adjust: none; /* iOS 텍스트 크기 조정 차단 */
    -webkit-highlight: none; /* iOS 하이라이트 차단 */

    pointer-events: auto; /* 캔버스 자체는 터치 허용하되 시스템 기능만 차단 */
}

.signature-section .btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 36px;
}

.signature-section .btn-secondary {
    background-color: #6a140c;
    border-color: #6a140c;
    color: white;
}

.signature-section .btn-secondary:hover {
    background-color: #82180F;
    border-color: #82180F;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(106, 20, 12, 0.3);
}

.modal-buttons {
    padding: 20px 25px 25px 25px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #e9ecef;
}

.modal-buttons .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    min-height: 48px;
    transition: all 0.2s ease;
}

.modal-buttons .btn-primary {
    background: linear-gradient(135deg, #132D25, #0f251f);
    border-color: #132D25;
    color: white;
}

.modal-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #0f251f, #0b1a15);
    border-color: #0f251f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 45, 37, 0.3);
}

.modal-buttons .btn-outline-secondary {
    border-color: #6a140c;
    color: #6a140c;
    background: transparent;
}

.modal-buttons .btn-outline-secondary:hover {
    background-color: #6a140c;
    border-color: #6a140c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 20, 12, 0.3);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    #signature-modal-overlay {
        padding: 10px;
    }

    #signature-modal-content {
        max-height: 100vh; /* 버튼 영역을 위해 높이 늘림 */
        border-radius: 15px;
        overflow-y: auto; /* 내용이 많으면 스크롤 가능 */
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 18px 20px 15px 20px; /* 헤더 패딩 더 줄임 */
        background: linear-gradient(135deg, #132D25, #0f251f);
        color: white;
    }

    .modal-header::before {
        height: 3px; /* 모바일에서 약간 더 얇은 accent line */
    }

    .modal-title {
        font-size: 1.2rem;
        color: white;
    }

    .modal-subtitle {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .signature-sections {
        padding: 10px 20px; /* 패딩 더 줄임 */
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .signature-section {
        margin-bottom: 15px; /* 간격 더 줄임 */
    }

    #modal-name-pad,
    #modal-signature-pad {
        height: 125px; /* 높이 더 줄임 */
    }

    .modal-buttons {
        padding: 10px 20px 15px 20px; /* 패딩 최소화 */
        flex-direction: row; /* 모바일에서도 가로 배치 유지 */
        gap: 12px; /* 버튼 간격 조정 */
        flex-shrink: 0; /* 버튼 영역이 압축되지 않도록 보장 */
    }

    .modal-buttons .btn {
        flex: 1; /* 버튼들이 동일한 크기로 가로 배치 */
        margin-bottom: 0;
        padding: 14px 12px; /* 터치하기 쉽도록 패딩 증가 */
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .signature-placeholder {
        min-height: 120px;
        padding: 15px;
    }

    #signature-placeholder-text {
        font-size: 1rem;
    }

    #modal-name-pad,
    #modal-signature-pad {
        height: 130px;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}