/* --- パーツ全体のコンテナ --- */
#common_contact_form.cta-section-part {
    max-width: 767px !important;
    margin: 0 auto;
}

#common_contact_form.cta-section-part * {
    box-sizing: border-box;
}

#common_contact_form .cta-section-inner {
    background-color: #fef6e4;
    padding: 50px 20px 30px !important;
    border-radius: 20px;
    color: #111;
    position: relative;
    margin: 40px auto 0;
    line-height: 1.5;
    margin-top: 6cqw !important;
}

/* --- 上部赤リボン --- */
#common_contact_form .cta-top-ribbon {
    position: absolute;
    top: -5cqw;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--theme_color);
    color: #fff;
    font-weight: bold;
    padding: 10px 35px;
    border-radius: 40px;
    font-size: 5.2cqw;
    white-space: nowrap;
    z-index: 2;
}

#common_contact_form .cta-top-ribbon::before {
    content: "";
    border: 6px solid transparent;
    border-top: 16px solid var(--theme_color);
    margin-left: -10px;
    top: 98%;
    left: 50%;
    position: absolute;
}

#common_contact_form .cta-main-title {
    text-align: center;
    font-size: 5.0cqw;
    font-weight: bold;
    margin: 10px 0 25px 0;
    letter-spacing: 0.05em;
}

#common_contact_form .cta-main-title span {
    color: var(--theme_color);
}

/* --- 進捗ステップバー --- */
#common_contact_form .step-bar-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
    padding: 0;
}

#common_contact_form .step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

#common_contact_form .step-circle {
    width: 9cqw;
    height: 9cqw;
    background-color: #fff;
    border: 2px solid #a3a3a3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #a3a3a3;
    font-size: 4cqw;
    margin-bottom: 8px;
    transition: all 0.3s;
}

#common_contact_form .step-label {
    font-size: 3.2cqw;
    color: #a3a3a3;
    font-weight: bold;
    white-space: nowrap;
}

#common_contact_form .step-line {
    position: absolute;
    top: 4cqw;
    left: 35%;
    right: 35%;
    height: 2px;
    background-color: #a3a3a3;
    z-index: 0;
    transition: background-color 0.3s;
}

#common_contact_form .step-item.active .step-circle {
    border-color: var(--theme_color);
    color: var(--theme_color);
}

#common_contact_form .step-item.active .step-label {
    color: #111;
}

#common_contact_form .step-item.completed .step-circle {
    background-color: var(--theme_color);
    border-color: var(--theme_color);
    color: #fff;
}

#common_contact_form .step-item.completed .step-circle::before {
    content: '';
    display: block;
    width: 3.6cqw;
    height: 2.6cqw;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(-45deg);
}

#common_contact_form .step-item.completed span {
    display: none;
}

#common_contact_form .step-line.active {
    background-color: var(--theme_color);
}

/* --- 白いボックス共通 --- */
#common_contact_form .cta-box {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 25px 20px;
    margin-bottom: 20px;
}

#common_contact_form .cta-box:last-child {
    margin-bottom: 0;
}

/* --- フォームエリア --- */
#common_contact_form .form-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
}

#common_contact_form .form-label {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 4.2cqw;
    margin-bottom: 10px;
}

#common_contact_form .badge {
    color: #ffffff;
    font-size: 2.8cqw;
    padding: 3px 10px;
    border-radius: 16px;
    margin-right: 10px;
    font-weight: normal;
}

#common_contact_form .badge.required {
    background-color: var(--theme_color);
}

#common_contact_form .badge.optional {
    background-color: #888888;
}

#common_contact_form .label-note {
    font-size: 3cqw;
    font-weight: normal;
}

#common_contact_form .form-input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    font-size: 3cqw;
    font-family: inherit;
}

#common_contact_form .form-input::placeholder {
    color: #aaaaaa;
}

#common_contact_form textarea.form-input {
    max-height: 30cqw;
    resize: vertical;
    min-height: 100px;
}

/* --- 送信＆遷移ボタン --- */
#common_contact_form .submit-btn-wrap {
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
    margin: auto;
}

#common_contact_form .submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #f87334 0%, #e64a06 100%);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 5.2cqw;
    font-weight: bold;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 0 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
}

#common_contact_form .submit-btn:hover {
    opacity: 0.95;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

#common_contact_form .submit-btn-wrap::after {
    content: '';
    position: absolute;
    right: 25px;
    top: 50%;
    width: 3.2cqw;
    height: 3.2cqw;
    min-width: 10px;
    min-height: 10px;
    border-top: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    transition: opacity 0.2s;
}

#common_contact_form .submit-btn-wrap.is-loading::after {
    opacity: 0;
}

#common_contact_form .wpcf7-spinner {
    display: none !important;
}

#common_contact_form .submit-btn {
    margin: 0;
}

#common_contact_form .submit-btn-wrap.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: form-spin 1s linear infinite;
    z-index: 10;
    pointer-events: none;
}

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

/* --- 戻るボタン --- */
#common_contact_form .back-btn-wrap {
    text-align: center;
    margin: 15px 0;
    width: 100%;
}

#common_contact_form .back-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #818181;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 4.2cqw;
    font-weight: bold;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    position: relative;
}

#common_contact_form .back-btn::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 50%;
    width: 3.2cqw;
    height: 3.2cqw;
    min-width: 10px;
    min-height: 10px;
    border-bottom: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    transition: opacity 0.2s;
}

#common_contact_form .back-btn:hover {
    opacity: 0.9;
}

/* --- CF7自動挿入タグ対策 --- */
#common_contact_form .wpcf7 p {
    margin: 0;
    padding: 0;
    display: contents;
}

#common_contact_form .wpcf7 br {
    display: none;
}

/* --- カスタムチェックボックス --- */
#common_contact_form .privacy-wrap {
    text-align: center;
    margin-bottom: 25px;
    font-size: 3.5cqw;
}

#common_contact_form .privacy-wrap .wpcf7-form-control-wrap,
#common_contact_form .privacy-wrap .wpcf7-acceptance {
    display: inline-block;
}

#common_contact_form .privacy-wrap .wpcf7-list-item {
    margin: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

#common_contact_form .privacy-wrap input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    pointer-events: none;
}

#common_contact_form .privacy-wrap .wpcf7-list-item-label {
    position: relative;
    padding-left: 28px;
    line-height: 20px;
    display: inline-block;
}

#common_contact_form .privacy-wrap .wpcf7-list-item-label::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 2px solid #ccc;
    background-color: #fff;
    border-radius: 6px;
    box-sizing: border-box;
    transition: all 0.2s;
    cursor: pointer;
}

#common_contact_form .privacy-wrap .wpcf7-list-item-label::after {
    content: '';
    position: absolute;
    left: 0;
    top: 45%;
    width: 10px;
    height: 18px;
    border-right: 4px solid #000000;
    border-bottom: 4px solid #000000;
    transform: translateY(-50%) rotate(45deg);
    opacity: 0;
    transition: all 0.2s;
    box-sizing: border-box;
}

#common_contact_form .privacy-wrap input[type="checkbox"]:checked + .wpcf7-list-item-label::after {
    opacity: 1;
}

#common_contact_form .privacy-link-text {
    color: #0077cc;
    text-decoration: underline;
    font-weight: bold;
    pointer-events: auto;
    cursor: pointer;
}

/* --- モーダル --- */
#common_contact_form .privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#common_contact_form .privacy-modal.is-active {
    display: flex;
}

#common_contact_form .privacy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

#common_contact_form .privacy-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#common_contact_form .privacy-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

#common_contact_form .privacy-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

#common_contact_form .privacy-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

#common_contact_form .privacy-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

#common_contact_form .privacy-modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

#common_contact_form .privacy-agree-btn {
    background-color: var(--theme_color);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s;
}

#common_contact_form .privacy-agree-btn:hover {
    opacity: 0.9;
}

@media (max-width: 767px) {
    #common_contact_form.cta-section-part {
        padding: 0 1rem;
    }
}

@media (min-width: 768px) {
    #common_contact_form {
        scroll-margin-top: 120px;
    }
}

/* --- ファイル添付ボタン --- */
#common_contact_form input[type="file"].form-input {
    cursor: pointer;
    font-size: 3.5cqw;
    color: #111111;
    display: block;
    width: 100%;
    margin-bottom: 4cqw;
}

#common_contact_form input[type="file"].form-input::file-selector-button {
    background-color: #535353;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 3.8cqw;
    font-family: inherit;
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.2s;
    -webkit-appearance: none;
}

#common_contact_form input[type="file"].form-input::-webkit-file-upload-button {
    background-color: #d9d9d9;
    color: #000000;
    border: 1px solid #000;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 3.2cqw;
    font-family: inherit;
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.2s;
    -webkit-appearance: none;
    font-weight: bold;
}

#common_contact_form input[type="file"].form-input::file-selector-button:hover,
#common_contact_form input[type="file"].form-input::-webkit-file-upload-button:hover {
    background-color: #e4e4e4;
}