/**
 * Contact Section Styles
 */

/* Contact Form 7 Integration - Higher specificity */
.contact-section .wpcf7-form {
    max-width: 700px;
    margin: 0 auto;
}

.contact-section .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 24px;
}

.contact-section .wpcf7-form label {
    display: block !important;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: #f5f3ec !important;
    margin-bottom: 8px !important;
}

/* Remove unnecessary line breaks in labels */
.contact-section .wpcf7-form label br {
    display: none;
}

/* Ensure input fields are on separate lines */
.contact-section .wpcf7-form .wpcf7-form-control {
    display: block !important;
    width: 100%;
    height: 48px;
    background-color: #ffffff;
    border: 1px solid #f5f3ec;
    border-radius: 0;
    padding: 0 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #000000;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-top: 0;
}

.contact-section .wpcf7-form .wpcf7-form-control:focus {
    outline: none;
    border-color: #e38e0f;
    box-shadow: 0 0 0 2px rgba(227, 142, 15, 0.1);
}

.contact-section .wpcf7-form .wpcf7-textarea {
    display: block !important;
    height: 180px;
    padding: 12px;
    resize: vertical;
    position: relative;
    width: 100%;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #000000;
    background-color: #ffffff;
    border: 1px solid #f5f3ec;
    border-radius: 0;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-top: 0;
}

.contact-section .wpcf7-form .wpcf7-textarea::placeholder {
    color: #99a181;
}

/* Custom resize handle for textarea */
.wpcf7-textarea::-webkit-resizer {
    background-image: linear-gradient(-45deg, #f5f3ec 25%, transparent 25%, transparent 75%, #f5f3ec 75%),
                      linear-gradient(-45deg, #f5f3ec 25%, transparent 25%, transparent 75%, #f5f3ec 75%);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
}

.wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 24px;
}

.wpcf7-form label {
    display: block;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #f5f3ec;
    margin-bottom: 8px !important;
}

/* Ensure proper spacing between label and input */
.contact-section .wpcf7 .wpcf7-form-control-wrap label {
    display: block;
    margin-bottom: 8px !important;
}

.contact-section .wpcf7 .wpcf7-form-control-wrap .wpcf7-form-control {
    margin-top: 0;
}

.wpcf7-checkbox {
    display: flex;
    align-items: flex-start;
}

.wpcf7-checkbox .wpcf7-form-control-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.wpcf7-list-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 0;
}

.wpcf7-list-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wpcf7-list-item-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0.7px;
    color: #f5f3ec;
}

.wpcf7-list-item-label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #f5f3ec;
    border: 1px solid #f5f3ec;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
    margin-right: 8px;
}

.wpcf7-list-item input[type="checkbox"]:checked + .wpcf7-list-item-label::before {
    background-color: #e38e0f;
    border-color: #e38e0f;
}

.wpcf7-list-item input[type="checkbox"]:checked + .wpcf7-list-item-label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #f5f3ec;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Acceptance field styling */
.wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
}

.wpcf7-acceptance .wpcf7-form-control-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.wpcf7-acceptance input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wpcf7-acceptance label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0.7px;
    color: #f5f3ec;
    margin-bottom: 0;
}

.wpcf7-acceptance label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #f5f3ec;
    border: 1px solid #f5f3ec;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
    margin-right: 8px;
}

.wpcf7-acceptance input[type="checkbox"]:checked + label::before {
    background-color: #e38e0f;
    border-color: #e38e0f;
}

.wpcf7-acceptance input[type="checkbox"]:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #f5f3ec;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Submit Button - Original Design */
.contact-section .wpcf7-form .wpcf7-submit {
    width: 98px;
    height: 60px;
    background-color: #e38e0f;
    border: none;
    cursor: pointer;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 36px;
    letter-spacing: 1.2px;
    color: #f5f3ec;
    transition: background-color 0.3s ease, transform 0.1s ease;
    position: relative;
    overflow: hidden;
    display: block;
    margin: 32px auto 0;
}

.contact-section .wpcf7-form .wpcf7-submit:hover {
    background-color: #f09a17;
}

.contact-section .wpcf7-form .wpcf7-submit:active {
    background-color: #cc7e0c;
    transform: translateY(1px);
}

.contact-section .wpcf7-form .wpcf7-submit:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Contact Form 7 Validation */
.contact-section .wpcf7-form .wpcf7-not-valid-tip {
    display: block;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    color: #ffffff !important;
    margin-top: 4px;
}

.wpcf7-not-valid {
    border-color: #ff6b6b !important;
}

.contact-section .wpcf7-response-output,
.wpcf7-response-output {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    border-radius: 4px;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    border: 1px solid;
    color: #ffffff !important;
}

.contact-section .wpcf7-mail-sent-ok,
.wpcf7-mail-sent-ok {
    background-color: rgba(76, 175, 80, 0.1) !important;
    color: #ffffff !important;
    border-color: #e38e0f !important;
}

.contact-section .wpcf7-mail-sent-ng,
.contact-section .wpcf7-validation-errors,
.contact-section .wpcf7-spam-blocked,
.contact-section .wpcf7-aborted,
.wpcf7-mail-sent-ng,
.wpcf7-validation-errors,
.wpcf7-spam-blocked,
.wpcf7-aborted {
    background-color: rgba(255, 107, 107, 0.1) !important;
    color: #ffffff !important;
    border-color: #e38e0f !important;
}

/* AJAX Loading */
.wpcf7 .ajax-loader {
    display: none;
}

.contact-section .wpcf7-form .wpcf7-submit.loading {
    position: relative;
    color: transparent;
}

.contact-section .wpcf7-form .wpcf7-submit.loading::after {
    content: '送信中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #f5f3ec;
}

.contact-section {
    background-color: #313f33;
    padding: 100px 0;
    position: relative;
}

.contact-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section Header */
.contact-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.contact-section .section-tagline {
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.8px;
    color: #f5f3ec;
    margin-bottom: 16px;
}

.contact-section .section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 48px;
    line-height: 57.6px;
    letter-spacing: 2.4px;
    color: #f5f3ec;
    margin: 0 0 24px 0;
}

.contact-section .section-subtitle {
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 27px;
    letter-spacing: 0.9px;
    color: #f5f3ec;
    margin: 0;
}

/* Form Wrapper */
.contact-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

/* Form Groups */
.contact-form .form-group {
    margin-bottom: 24px;
}

.contact-form .form-label {
    display: block;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #f5f3ec;
    margin-bottom: 8px;
}

/* Form Controls */
.contact-form .form-control {
    width: 100%;
    height: 48px;
    background-color: #ffffff;
    border: 1px solid #f5f3ec;
    border-radius: 0;
    padding: 0 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #000000;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.contact-form .form-control:focus {
    outline: none;
    border-color: #e38e0f;
    box-shadow: 0 0 0 2px rgba(227, 142, 15, 0.1);
}

.contact-form .form-control::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

/* Textarea */
.contact-form .form-textarea {
    height: 180px;
    padding: 12px;
    resize: vertical;
    position: relative;
}

.contact-form .form-textarea::placeholder {
    color: #99a181;
}

/* Custom resize handle */
.contact-form .form-textarea::-webkit-resizer {
    background-image: linear-gradient(-45deg, #f5f3ec 25%, transparent 25%, transparent 75%, #f5f3ec 75%),
                      linear-gradient(-45deg, #f5f3ec 25%, transparent 25%, transparent 75%, #f5f3ec 75%);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
}

/* Checkbox Group */
.contact-form .form-checkbox-group {
    display: flex;
    align-items: flex-start;
}

.contact-form .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.contact-form .form-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.contact-form .checkbox-custom {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #f5f3ec;
    border: 1px solid #f5f3ec;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.contact-form .form-checkbox:checked ~ .checkbox-custom {
    background-color: #e38e0f;
    border-color: #e38e0f;
}

.contact-form .form-checkbox:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #f5f3ec;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.contact-form .form-checkbox:focus ~ .checkbox-custom {
    box-shadow: 0 0 0 2px rgba(227, 142, 15, 0.3);
}

.contact-form .checkbox-text {
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0.7px;
    color: #f5f3ec;
    margin-left: 8px;
}

/* Submit Button */
.contact-form .form-submit {
    text-align: center;
    margin-top: 32px;
}

.contact-form .submit-button {
    width: 98px;
    height: 60px;
    background-color: #e38e0f;
    border: none;
    cursor: pointer;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 36px;
    letter-spacing: 1.2px;
    color: #f5f3ec;
    transition: background-color 0.3s ease, transform 0.1s ease;
    position: relative;
    overflow: hidden;
}

.contact-form .submit-button:hover {
    background-color: #f09a17;
}

.contact-form .submit-button:active {
    background-color: #cc7e0c;
    transform: translateY(1px);
}

.contact-form .submit-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Error Messages */
.contact-form .error-message {
    display: none;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    color: #ff6b6b;
    margin-top: 4px;
}

.contact-form .form-group.has-error .error-message {
    display: block;
}

.contact-form .form-group.has-error .form-control {
    border-color: #ff6b6b;
}

/* Form Messages */
.contact-form .form-message {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    border-radius: 4px;
    font-family: 'Yu Gothic', 'YuGothic', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    display: none;
}

.contact-form .form-message.success {
    display: block;
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.contact-form .form-message.error {
    display: block;
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

/* Loading State */
.contact-form.is-loading .submit-button .button-text {
    opacity: 0;
}

.contact-form.is-loading .submit-button::after {
    content: '送信中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* Responsive Styles */
@media (max-width: 1023px) {
    .contact-section {
        padding: 80px 0;
    }
    
    .contact-form-wrapper,
    .wpcf7,
    .wpcf7-form {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .contact-section {
        padding: 60px 0;
    }
    
    .contact-section .container {
        padding: 0 16px;
    }
    
    .contact-section .section-header {
        margin-bottom: 40px;
    }
    
    .contact-section .section-title {
        font-size: 36px;
        line-height: 43.2px;
        letter-spacing: 1.8px;
    }

    .contact-section .section-tagline {
        margin-bottom: 8px;
    }
    
    .contact-section .section-subtitle {
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0.8px;
    }
    
    .contact-form-wrapper,
    .wpcf7,
    .wpcf7-form {
        max-width: 100%;
    }
    
    .contact-form .submit-button,
    .wpcf7-submit {
        width: 100%;
    }
    
    .contact-form .form-textarea,
    .wpcf7-textarea {
        height: 150px;
    }
}