/* ====================================================================
 * 교회 정보 수정 신청 페이지 전용 - 정돈된 플랫 디자인 v3.3.0
 * Scoped under .jmp-church-edit-page (구버전 .jmp-church-edit-request-page 와 격리)
 *
 * 디자인 토큰·레이아웃은 v3.1.0 신청 폼(.jmp-church-application-page)과 통일:
 *   - 헤더 안내 박스 + 진행바 부제·하단 그린 바
 *   - 단계 페이지 헤더 (H2 + 안내)
 *   - 그린 불릿(●) 서브섹션
 *   - 46px 입력·8px radius·그린 primary 버튼
 *   - 760px max-width 컨테이너
 *
 * 수정신청 페이지 전용 추가 요소:
 *   - .jcap-selected-church-box (선택한 교회 카드)
 *   - .jcap-back-btn (다시 선택 버튼)
 *   - .jcap-warning-icon (전화인증 미완료 안내 화면 아이콘)
 *
 * @since 3.3.0
 * ==================================================================== */

.jmp-church-edit-page {
    --jcap-primary: #2d5a27;
    --jcap-primary-l: #3a7d32;
    --jcap-primary-d: #1a3d16;
    --jcap-primary-bg: #eff6ee;
    --jcap-primary-border: #c5e3c1;
    --jcap-text: #111827;
    --jcap-text-mid: #374151;
    --jcap-text-light: #6b7280;
    --jcap-text-dim: #9ca3af;
    --jcap-bg-gray: #f9fafb;
    --jcap-border: #e5e7eb;
    --jcap-border-strong: #d1d5db;
    --jcap-danger: #dc2626;
    --jcap-danger-bg: #fef2f2;
    --jcap-warning: #d97706;
    --jcap-warning-bg: #fef9e7;
    --jcap-warning-text: #92400e;

    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 32px 80px;
    background: #fff;
    color: var(--jcap-text);
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.jmp-church-edit-page *,
.jmp-church-edit-page *::before,
.jmp-church-edit-page *::after { box-sizing: border-box; }

/* ============ Header ============ */
.jmp-church-edit-page .jcap-header { margin: 0 0 32px; }
.jmp-church-edit-page .jcap-header h1 {
    margin: 0 0 14px;
    font-size: 30px; font-weight: 800;
    color: var(--jcap-text);
    letter-spacing: -0.6px; line-height: 1.25;
}
.jmp-church-edit-page .jcap-header .jcap-intro {
    margin: 0 0 18px;
    font-size: 14px; color: var(--jcap-text-mid); line-height: 1.7;
}
.jmp-church-edit-page .jcap-header .jcap-notice-box {
    padding: 14px 18px;
    background: var(--jcap-primary-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--jcap-primary-d);
    line-height: 1.65;
}
.jmp-church-edit-page .jcap-header .jcap-notice-box strong {
    font-weight: 700; color: var(--jcap-primary);
}

/* ============ Progress (2 steps) ============ */
.jmp-church-edit-page .jcap-progress {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    list-style: none;
    margin: 36px 0 32px;
    padding: 0;
    border-bottom: 1px solid var(--jcap-border);
}
.jmp-church-edit-page .jcap-step {
    display: flex; align-items: center;
    gap: 14px;
    padding: 6px 0 18px;
    position: relative;
}
.jmp-church-edit-page .jcap-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: #e5e7eb; color: var(--jcap-text-dim);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
    transition: all 0.2s ease;
}
.jmp-church-edit-page .jcap-step.active .jcap-step-num,
.jmp-church-edit-page .jcap-step.completed .jcap-step-num {
    background: var(--jcap-primary); color: #fff;
}
.jmp-church-edit-page .jcap-step-text {
    display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.jmp-church-edit-page .jcap-step-title {
    font-size: 14px; font-weight: 700;
    color: var(--jcap-text-light);
    line-height: 1.3; transition: color 0.2s ease;
}
.jmp-church-edit-page .jcap-step-sub {
    font-size: 12px; color: var(--jcap-text-dim); line-height: 1.3;
}
.jmp-church-edit-page .jcap-step.active .jcap-step-title { color: var(--jcap-primary); }
.jmp-church-edit-page .jcap-step.completed .jcap-step-title { color: var(--jcap-text-mid); }
.jmp-church-edit-page .jcap-step.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 3px; background: var(--jcap-primary);
}

/* ============ Step containers ============ */
.jmp-church-edit-page .jmp-edit-step { display: none; }
.jmp-church-edit-page .jmp-edit-step.active { display: block; }

/* ============ Step page header ============ */
.jmp-church-edit-page .jcap-step-header { margin: 0 0 32px; }
.jmp-church-edit-page .jcap-step-header h2 {
    margin: 0 0 8px;
    font-size: 22px; font-weight: 800;
    color: var(--jcap-text); letter-spacing: -0.4px;
}
.jmp-church-edit-page .jcap-step-header p {
    margin: 0; font-size: 14px; color: var(--jcap-text-light); line-height: 1.65;
}

/* ============ Subsection ============ */
.jmp-church-edit-page .jcap-subsection {
    margin-top: 32px; padding-top: 32px;
    border-top: 1px solid var(--jcap-border);
}
.jmp-church-edit-page .jcap-subsection:first-of-type {
    margin-top: 0; padding-top: 0; border-top: none;
}
.jmp-church-edit-page .jcap-subsection-title {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 8px;
    font-size: 16px; font-weight: 700;
    color: var(--jcap-text); letter-spacing: -0.2px;
}
.jmp-church-edit-page .jcap-subsection-title::before {
    content: ''; display: inline-block;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--jcap-primary); flex-shrink: 0;
}
.jmp-church-edit-page .jcap-subsection-desc {
    margin: 0 0 20px;
    font-size: 13px; color: var(--jcap-text-light); line-height: 1.7;
}
.jmp-church-edit-page .jcap-subsection-desc strong {
    font-weight: 700; color: var(--jcap-text-mid);
}

/* ============ Form rows / groups / labels ============ */
.jmp-church-edit-page .jmp-form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.jmp-church-edit-page .jmp-form-row:last-child,
.jmp-church-edit-page .jmp-form-group:last-child { margin-bottom: 0; }
.jmp-church-edit-page .jmp-form-row + .jmp-form-group,
.jmp-church-edit-page .jmp-form-group + .jmp-form-group,
.jmp-church-edit-page .jmp-form-group + .jmp-form-row { margin-top: 16px; }
.jmp-church-edit-page .jmp-form-row .jmp-form-group { margin: 0; }
.jmp-church-edit-page .jmp-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--jcap-text-mid); margin: 0 0 8px; line-height: 1.4;
}
.jmp-church-edit-page .jmp-label--sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.jmp-church-edit-page .jmp-help-text {
    display: block; font-size: 12px;
    color: var(--jcap-text-dim); margin-top: 6px; line-height: 1.55;
}

/* ============ Inputs ============ */
.jmp-church-edit-page .jmp-input {
    width: 100%; height: 46px; padding: 0 14px;
    font-size: 14px; font-family: inherit; color: var(--jcap-text);
    background: #fff;
    border: 1px solid var(--jcap-border-strong);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    appearance: none; -webkit-appearance: none;
}
.jmp-church-edit-page textarea.jmp-input {
    height: auto; min-height: 100px; padding: 12px 14px;
    resize: vertical; line-height: 1.6;
}
.jmp-church-edit-page .jmp-input::placeholder { color: var(--jcap-text-dim); }
.jmp-church-edit-page .jmp-input:hover:not([readonly]):not(:disabled) { border-color: var(--jcap-text-dim); }
.jmp-church-edit-page .jmp-input:focus {
    outline: none; border-color: var(--jcap-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.12);
}
.jmp-church-edit-page .jmp-input[readonly],
.jmp-church-edit-page .jmp-input[disabled] {
    background: var(--jcap-bg-gray); color: var(--jcap-text-light); cursor: not-allowed;
}
.jmp-church-edit-page .jmp-input[readonly]:hover,
.jmp-church-edit-page .jmp-input[disabled]:hover { border-color: var(--jcap-border-strong); }

/* ============ Search grid (Step 1 검색 + Step 2 주소 통일) ============ */
.jmp-church-edit-page .jcap-search-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

/* [v3.3.0] 등록신청과 동일한 3-column 검색 행 (지역 + 검색어 + 버튼) */
.jmp-church-edit-page .jcap-search-grid--with-region {
    grid-template-columns: 180px 1fr auto;
}
.jmp-church-edit-page .jcap-search-grid--with-region .jmp-form-group {
    margin: 0;
}
.jmp-church-edit-page .jcap-search-grid--with-region .jmp-select {
    height: 46px;
    padding: 0 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 7px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.jmp-church-edit-page .jcap-search-grid .jcap-search-btn {
    height: 46px; padding: 0 28px;
}
.jmp-church-edit-page .jcap-search-hint {
    text-align: center; margin: 14px 0 0;
    font-size: 12px; color: var(--jcap-text-dim);
}

/* ============ Search results — 등록신청과 동일 디자인 (jmp-church-search-*) ============ */
.jmp-church-edit-page .jcap-search-results { margin-top: 16px; }
.jmp-church-edit-page .jmp-church-search-list {
    list-style: none; margin: 0; padding: 0;
    border: 1px solid var(--jcap-border); border-radius: 8px;
    max-height: 360px; overflow-y: auto; background: #fff;
}
.jmp-church-edit-page .jmp-church-search-item {
    padding: 14px 16px; border-bottom: 1px solid var(--jcap-border);
    cursor: pointer; transition: background 0.12s;
}
.jmp-church-edit-page .jmp-church-search-item:last-child { border-bottom: none; }
.jmp-church-edit-page .jmp-church-search-item:hover { background: var(--jcap-primary-bg); }
.jmp-church-edit-page .jmp-church-search-item--disabled {
    cursor: not-allowed; opacity: 0.55; background: #fafafa;
}
.jmp-church-edit-page .jmp-church-search-item--disabled:hover { background: #fafafa; }
.jmp-church-edit-page .jmp-church-search-item strong {
    font-size: 14px; font-weight: 700; color: var(--jcap-text);
}
.jmp-church-edit-page .jmp-church-search-item .jmp-address {
    display: block; font-size: 12px; color: var(--jcap-text-light); margin-top: 4px;
}
.jmp-church-edit-page .jmp-church-search-item .jmp-unique-id {
    display: inline-block; font-size: 12px;
    color: var(--jcap-primary); font-weight: 600; margin-left: 6px;
}
.jmp-church-edit-page .jmp-church-search-badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle; line-height: 1.55;
}
.jmp-church-edit-page .jmp-badge-success {
    background: var(--jcap-primary-bg); color: var(--jcap-primary);
}
.jmp-church-edit-page .jmp-badge-warning {
    background: var(--jcap-warning-bg, #fef3c7); color: var(--jcap-warning-text, #92400e);
}
.jmp-church-edit-page .jcap-empty-result {
    margin: 16px 0 0; padding: 14px 16px;
    background: var(--jcap-bg-gray); border: 1px solid var(--jcap-border); border-radius: 8px;
    font-size: 13px; color: var(--jcap-text-mid); line-height: 1.55; text-align: center;
}

/* ============ Step 2: 선택한 교회 박스 ============ */
.jmp-church-edit-page .jcap-selected-church-box {
    padding: 16px 18px;
    background: var(--jcap-primary-bg);
    border: 1px solid var(--jcap-primary-border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.jmp-church-edit-page .jcap-selected-church-info { min-width: 0; flex: 1; }
.jmp-church-edit-page .jcap-selected-church-name {
    margin: 0;
    font-size: 16px; font-weight: 700; color: var(--jcap-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jmp-church-edit-page .jcap-back-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 14px;
    font-size: 12px; font-weight: 600; font-family: inherit; color: var(--jcap-text-mid);
    background: #fff; border: 1px solid var(--jcap-border-strong); border-radius: 8px;
    cursor: pointer; white-space: nowrap; transition: all 0.15s; line-height: 1;
}
.jmp-church-edit-page .jcap-back-btn:hover { border-color: var(--jcap-primary); color: var(--jcap-primary); }
.jmp-church-edit-page .jcap-back-btn > i { font-size: 14px; }

/* ============ 주소 검색 보조 (모달 트리거 버튼은 이미 .jmp-btn.jmp-btn-primary 사용) ============ */
.jmp-church-edit-page .jmp-address-search-wrap {
    display: flex; gap: 10px; align-items: stretch;
}
.jmp-church-edit-page .jmp-address-search-wrap .jmp-input { flex: 1; min-width: 0; }

/* ============ File upload ============ */
.jmp-church-edit-page .jmp-file-upload-wrapper { position: relative; }
.jmp-church-edit-page .jmp-file-input {
    position: absolute; left: -9999px; opacity: 0; width: 1px; height: 1px;
}
.jmp-church-edit-page .jmp-file-label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 28px 18px;
    border: 1.5px dashed var(--jcap-border-strong); border-radius: 8px;
    background: var(--jcap-bg-gray); cursor: pointer; transition: all 0.15s; color: var(--jcap-text-mid);
}
.jmp-church-edit-page .jmp-file-label:hover {
    border-color: var(--jcap-primary); background: var(--jcap-primary-bg);
}
.jmp-church-edit-page .jmp-file-label > i { font-size: 26px; color: var(--jcap-primary); }
.jmp-church-edit-page .jmp-file-label-text {
    font-size: 13px; color: var(--jcap-text-mid); font-weight: 500; text-align: center;
}
.jmp-church-edit-page .jmp-file-preview-list {
    margin-top: 12px; display: flex; flex-direction: column; gap: 6px;
}
.jmp-church-edit-page .jmp-file-preview-item {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: #fff; border: 1px solid var(--jcap-border); border-radius: 6px;
    font-size: 13px; color: var(--jcap-text-mid);
}
.jmp-church-edit-page .jmp-file-preview-item > i { color: var(--jcap-primary); font-size: 16px; }
.jmp-church-edit-page .jmp-file-preview-item--pdf > i { color: var(--jcap-danger); }
.jmp-church-edit-page .jmp-file-preview-item .jmp-file-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jmp-church-edit-page .jmp-file-preview-item .jmp-file-size {
    color: var(--jcap-text-dim); font-size: 12px;
}

/* ============ Actions ============ */
.jmp-church-edit-page .jcap-actions {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--jcap-border);
}
.jmp-church-edit-page .jcap-actions > :only-child { margin-left: auto; }

/* ============ Buttons ============ */
.jmp-church-edit-page .jmp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 46px; padding: 0 24px;
    font-size: 14px; font-family: inherit; font-weight: 700;
    border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; transition: all 0.15s; line-height: 1;
}
.jmp-church-edit-page .jmp-btn-primary {
    background: var(--jcap-primary); color: #fff; border-color: var(--jcap-primary);
}
.jmp-church-edit-page .jmp-btn-primary:hover {
    background: var(--jcap-primary-l); border-color: var(--jcap-primary-l);
}
.jmp-church-edit-page .jmp-btn-secondary {
    background: #fff; color: var(--jcap-text-mid); border-color: var(--jcap-border-strong);
}
.jmp-church-edit-page .jmp-btn-secondary:hover {
    border-color: var(--jcap-primary); color: var(--jcap-primary);
}

/* ============ 완료 / 오류 화면 ============ */
.jmp-church-edit-page .jmp-edit-success-message {
    padding: 60px 24px 40px; text-align: center;
}
.jmp-church-edit-page .jcap-complete-icon,
.jmp-church-edit-page .jcap-warning-icon {
    width: 68px; height: 68px; margin: 0 auto 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.jmp-church-edit-page .jcap-complete-icon { background: var(--jcap-primary-bg); }
.jmp-church-edit-page .jcap-warning-icon  { background: var(--jcap-warning-bg); }
.jmp-church-edit-page .jcap-complete-icon .material-symbols-rounded {
    font-size: 40px; color: var(--jcap-primary); line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 40;
}
.jmp-church-edit-page .jcap-warning-icon .material-symbols-rounded {
    font-size: 40px; color: var(--jcap-warning); line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 40;
}
.jmp-church-edit-page .jmp-edit-success-message h3 {
    font-size: 22px; font-weight: 800; color: var(--jcap-text);
    letter-spacing: -0.3px; margin: 0 0 12px;
}
.jmp-church-edit-page .jmp-edit-success-message p {
    font-size: 14px; color: var(--jcap-text-light); line-height: 1.65; margin: 0 0 24px;
}

/* [v3.3.0] 완료 화면 — 등록신청 톤 정보 박스 (신청번호 + 예상 처리 시간) */
.jmp-church-edit-page .jcap-complete-desc {
    font-size: 14px; color: var(--jcap-text-light); line-height: 1.7;
    margin: 0 0 24px;
}
.jmp-church-edit-page .jcap-complete-info {
    margin: 0 auto 28px;
    padding: 18px 22px;
    background: var(--jcap-bg-gray);
    border: 1px solid var(--jcap-border);
    border-radius: 10px;
    text-align: left;
    max-width: 360px;
}
.jmp-church-edit-page .jcap-complete-info p {
    margin: 6px 0;
    font-size: 13px;
    color: var(--jcap-text-mid);
    line-height: 1.6;
}
.jmp-church-edit-page .jcap-complete-info p strong {
    display: inline-block;
    min-width: 105px;
    color: var(--jcap-text);
    font-weight: 700;
}
.jmp-church-edit-page .jcap-complete-info p span {
    font-weight: 600;
    color: var(--jcap-primary);
    letter-spacing: 0.3px;
}

/* ============ 주소 모달 ============ */
.jmp-church-edit-page .jmp-address-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000; background: rgba(0, 0, 0, 0.5);
    align-items: center; justify-content: center;
}
.jmp-church-edit-page .jmp-address-modal.active { display: flex; }
.jmp-church-edit-page .jmp-address-modal-content {
    position: relative; width: 90%; max-width: 500px; background: #fff;
    border-radius: 10px; overflow: hidden; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}
.jmp-church-edit-page .jmp-address-modal-header {
    padding: 14px 18px; background: var(--jcap-primary); color: #fff;
    display: flex; justify-content: space-between; align-items: center;
}
.jmp-church-edit-page .jmp-address-modal-header h3 {
    margin: 0; font-size: 15px; font-weight: 700; color: #fff;
}
.jmp-church-edit-page .jmp-address-modal-close {
    background: none; border: none; color: #fff; font-size: 22px;
    cursor: pointer; padding: 0; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center; border-radius: 4px; line-height: 1;
}
.jmp-church-edit-page .jmp-address-modal-close:hover { background: rgba(255, 255, 255, 0.18); }
.jmp-church-edit-page .jmp-address-modal-body { padding: 0; height: 500px; position: relative; }
.jmp-church-edit-page #jmp-edit-address-postcode-container { width: 100%; height: 100%; }

/* ============ Mobile ============ */
@media (max-width: 720px) {
    .jmp-church-edit-page { padding: 32px 20px 60px; max-width: 100%; }
    .jmp-church-edit-page .jcap-header h1 { font-size: 24px; }
    .jmp-church-edit-page .jcap-step { padding: 4px 0 14px; gap: 10px; }
    .jmp-church-edit-page .jcap-step-num { width: 24px; height: 24px; font-size: 12px; }
    .jmp-church-edit-page .jcap-step-title { font-size: 13px; }
    .jmp-church-edit-page .jcap-step-sub { font-size: 11px; }
    .jmp-church-edit-page .jcap-step-header h2 { font-size: 20px; }
    .jmp-church-edit-page .jmp-form-row { grid-template-columns: 1fr; gap: 14px; }
    .jmp-church-edit-page .jcap-search-grid { grid-template-columns: 1fr; }
    .jmp-church-edit-page .jcap-search-grid--with-region { grid-template-columns: 1fr; }
    .jmp-church-edit-page .jcap-search-grid .jcap-search-btn { width: 100%; }
    .jmp-church-edit-page .jcap-actions { flex-direction: column-reverse; gap: 10px; }
    .jmp-church-edit-page .jmp-btn { width: 100%; }
    .jmp-church-edit-page .jcap-selected-church-box { flex-direction: column; align-items: stretch; }
    .jmp-church-edit-page .jcap-back-btn { width: 100%; justify-content: center; }
}
