/* Contact Form Styles */

/* フォント設定をサイト全体と統一 */
body, input, textarea, button {
    font-family: 'Zen Kaku Gothic New', 'Zen Maru Gothic', sans-serif;
}

.contact-form-container {
    width: 100%;
    max-width: 800px;
    margin: 120px auto 60px auto; /* 下マージン調整 */
    padding: 50px; /* パディング調整 */
    background: #ffffff; /* 背景を白に */
    border-radius: 16px; /* 角丸調整 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06); /* 影を調整 */
    border: 1px solid #eee; /* 細い境界線を追加 */
}

.contact-form-title {
    text-align: center;
    color: #1a1a1a;
    font-size: 2rem; /* フォントサイズ調整 */
    margin-bottom: 30px; /* マージン調整 */
    position: relative;
    padding-bottom: 15px;
    font-weight: 700; /* 太字に */
    letter-spacing: 0.08em; /* 文字間隔調整 */
    font-family: 'Marcellus', serif; /* タイトル用フォント */
}

.contact-form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px; /* 長さ調整 */
    height: 3px; /* 太さ調整 */
    background: #059669; /* サイトのプライマリカラーに */
    border-radius: 1.5px;
}

.contact-description {
    text-align: center;
    margin-bottom: 40px;
    color: #555; /* 色調整 */
    line-height: 1.9; /* 行間調整 */
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 25px; /* マージン調整 */
    opacity: 1; /* アニメーションを削除または調整 */
    transform: none;
    /* animation: fadeInUp 0.5s forwards; */
    /* animation-delay: calc(var(--index, 0) * 0.1s); */
}

.form-label-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px; /* マージン調整 */
    gap: 8px; /* ギャップ調整 */
}

.form-label {
    display: inline-flex;
    align-items: center;
    color: #333; /* 色調整 */
    font-weight: 500;
    font-size: 0.9rem; /* フォントサイズ調整 */
    gap: 8px;
}

/* バッジのスタイル調整 */
.required-badge,
.optional-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
}

.required-badge {
    background: #e74c3c;
    color: #ffffff;
}

.optional-badge {
    background: #ecf0f1;
    color: #7f8c8d;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px; /* パディング調整 */
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem; /* フォントサイズ調整 */
    transition: all 0.3s ease;
    background-color: #fdfdfd; /* 背景色調整 */
    color: #333;
    box-shadow: none; /* 影を削除 */
    line-height: 1.6;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #059669; /* サイトのプライマリカラーに */
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); /* フォーカス時の影調整 */
    background-color: #fff;
    transform: none; /* アニメーション削除 */
}

.form-input.error,
.form-textarea.error {
    border-color: #c94545;
    background-color: #fff8f8;
}

.form-textarea {
    min-height: 150px; /* 高さ調整 */
    resize: vertical;
}

.error-message {
    color: #c94545;
    font-size: 0.8rem; /* フォントサイズ調整 */
    margin-top: 6px; /* マージン調整 */
    display: none;
    padding-left: 22px; /* パディング調整 */
    position: relative;
}

.error-message::before {
    content: '!';
    position: absolute;
    left: 0;
    top: 2px; /* 位置調整 */
    transform: none;
    width: 16px;
    height: 16px;
    background: #c94545;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px; /* フォントサイズ調整 */
    font-weight: bold;
}

.form-note {
    font-size: 0.8rem; /* フォントサイズ調整 */
    color: #666;
    margin-top: 6px; /* マージン調整 */
}

.submit-button {
    display: block;
    margin: 30px auto 0; /* マージン調整 */
    background: #059669; /* サイトのプライマリカラーに */
    color: white;
    border: none;
    padding: 14px 40px; /* パディング調整 */
    font-size: 1rem; /* フォントサイズ調整 */
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2); /* 影調整 */
    font-family: inherit; /* フォント継承 */
    letter-spacing: 0.05em;
    text-align: center;
}

.submit-button:hover {
    background: #065f46; /* ホバー時の色調整 (Dark Green) */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.3); /* ホバー時の影調整 */
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.15);
}

.submit-button.loading {
    background: #ccc; /* ローディング中の背景色 */
    pointer-events: none;
    opacity: 0.8;
    cursor: wait;
}

/* ローディングオーバーレイ調整 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* 背景を明るく */
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.loading-content {
    background: white;
    padding: 35px 40px; /* パディング調整 */
    border-radius: 12px; /* 角丸調整 */
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* アニメーション調整 */
}

.loading-spinner {
    width: 40px; /* サイズ調整 */
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #059669; /* サイトのプライマリカラーに */
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: #333; /* 色調整 */
    font-size: 1rem; /* フォントサイズ調整 */
    font-weight: 500;
    margin: 0;
    line-height: 1.6;
}

/* 確認モーダル調整 */
.confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6); /* 背景の濃さ調整 */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 20px; /* 周囲にパディング追加 */
}

.confirmation-content {
    background: #fff;
    padding: 40px; /* パディング調整 */
    border-radius: 12px; /* 角丸調整 */
    max-width: 600px; /* 幅調整 */
    width: 100%; /* 幅を 100% に */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease-out;
}

.confirmation-title {
    font-size: 1.5rem; /* フォントサイズ調整 */
    color: #1a1a1a;
    margin-bottom: 25px; /* マージン調整 */
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: 'Marcellus', serif; /* タイトル用フォント */
}

.confirmation-table {
    width: 100%;
    margin-bottom: 30px;
    border-collapse: collapse; /* 線を結合 */
    border: 1px solid #eee;
    table-layout: fixed;
}

.confirmation-table th,
.confirmation-table td {
    padding: 15px;
    border: 1px solid #eee; /* セルごとに線を追加 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top; /* 上揃え */
    font-size: 0.95rem; /* フォントサイズ調整 */
}

.confirmation-table th {
    width: 30%;
    color: #333; /* 色調整 */
    background-color: #f9f9f9; /* 背景色追加 */
    text-align: left;
    font-weight: 500;
}

.confirmation-table td {
    width: 70%;
    color: #555; /* 色調整 */
    line-height: 1.7;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* 折り返し */
}

.btn-back,
.btn-submit {
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 150px; /* 最小幅調整 */
    font-family: inherit; /* フォント継承 */
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    font-size: 0.95rem; /* フォントサイズ調整 */
}

.btn-back {
    background: #f3f3f3;
    color: #333;
    border-color: #ddd;
}

.btn-back:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.btn-submit {
    background: #059669; /* サイトのプライマリカラーに */
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}

.btn-submit:hover {
    background: #065f46; /* ホバー時の色調整 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* 送信完了メッセージ */
.success-message {
    display: none;
    text-align: center;
    padding: 50px 40px; /* パディング調整 */
    background: #fff;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #eee;
    animation: successFadeIn 0.5s ease-out; /* アニメーション追加 */
}

.success-message .contact-form-title { /* タイトル流用 */
    font-size: 1.6rem; /* サイズ調整 */
    margin-bottom: 25px;
}

.success-message .success-content { /* コンテンツラッパー追加 */
    /* 必要に応じてスタイル追加 */
}

.success-message .success-text {
    color: #333;
    line-height: 2; /* 行間調整 */
    margin-bottom: 30px;
    font-size: 1rem;
}

.submitted-content {
    background: #f9f9f9;
    padding: 25px 30px; /* パディング調整 */
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid #eee;
}

.submitted-content h3 {
    font-size: 1.1rem; /* フォントサイズ調整 */
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 600; /* 少し太く */
    text-align: left;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.submitted-content .confirmation-table {
    margin-bottom: 0;
    border: none;
}
.submitted-content .confirmation-table th,
.submitted-content .confirmation-table td {
    border: none;
    border-bottom: 1px dashed #eee; /* 点線に変更 */
    padding: 12px 0; /* パディング調整 */
    font-size: 0.9rem; /* フォントサイズ調整 */
}
.submitted-content .confirmation-table tr:last-child th,
.submitted-content .confirmation-table tr:last-child td {
    border-bottom: none;
}
.submitted-content .confirmation-table th {
    background-color: transparent;
    width: 25%; /* 幅調整 */
}
.submitted-content .confirmation-table td {
    width: 75%; /* 幅調整 */
}

.button-group {
    margin-top: 40px; /* マージン調整 */
    text-align: center;
}

.btn-home {
    display: inline-block;
    background: #059669; /* サイトのプライマリカラーに */
    color: white;
    text-decoration: none;
    padding: 14px 40px; /* パディング調整 */
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: inherit; /* フォント継承 */
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
    font-size: 1rem; /* フォントサイズ調整 */
}

.btn-home:hover {
    background: #065f46; /* ホバー時の色調整 */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.3);
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .contact-form-container {
        width: 90%; /* 幅を90%に変更 */
        box-sizing: border-box; /* paddingを幅に含める */
        padding: 30px 20px; /* パディング調整 */
        margin: 80px auto 40px; /* マージン調整 (左右autoに変更) */
        border-radius: 12px;
    }

    .contact-form-title {
        font-size: 1.6rem; /* フォントサイズ調整 */
    }

    .contact-description {
        font-size: 0.9rem; /* フォントサイズ調整 */
        margin-bottom: 30px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 14px; /* パディング調整 */
        font-size: 0.95rem; /* フォントサイズ調整 */
    }

    .submit-button {
        width: 100%;
        padding: 14px 20px; /* パディング調整 */
        font-size: 1rem; /* フォントサイズ調整 */
    }

    .confirmation-modal {
        padding: 15px;
    }

    .confirmation-content {
        padding: 25px 20px; /* パディング調整 */
        border-radius: 10px;
    }

    .confirmation-title {
        font-size: 1.3rem; /* フォントサイズ調整 */
    }

    /* 確認テーブルをスタック表示 */
    .confirmation-table th,
    .confirmation-table td {
        display: block;
        width: 100%;
        text-align: left;
        border: none;
        padding: 8px 0; /* パディング調整 */
    }

    .confirmation-table th {
        padding-bottom: 2px;
        font-weight: 600; /* 少し太く */
        background-color: transparent;
        color: #1a1a1a;
    }

    .confirmation-table td {
        padding-bottom: 15px;
        border-bottom: 1px dashed #eee; /* 区切り線 */
    }
    .confirmation-table tr:last-child td {
        border-bottom: none;
        padding-bottom: 0;
    }

    .confirmation-buttons {
        flex-direction: column;
        gap: 10px; /* ギャップ調整 */
    }

    .btn-back,
    .btn-submit {
        width: 100%;
        padding: 13px 20px; /* パディング調整 */
        font-size: 0.95rem; /* フォントサイズ調整 */
        min-width: auto;
    }

    .success-message {
        padding: 30px 20px; /* パディング調整 */
        margin-bottom: 20px;
    }

    .success-message .contact-form-title {
        font-size: 1.4rem; /* フォントサイズ調整 */
    }

    .success-message .success-text {
        font-size: 0.9rem; /* フォントサイズ調整 */
        line-height: 1.9;
    }

    .submitted-content {
        padding: 20px;
    }

    .submitted-content h3 {
        font-size: 1rem;
    }

    /* 送信内容テーブルのレスポンシブ調整 */
    .submitted-content .confirmation-table th,
    .submitted-content .confirmation-table td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 6px 0;
        font-size: 0.85rem;
    }
    .submitted-content .confirmation-table th {
        font-weight: 500;
        color: #333;
    }
    .submitted-content .confirmation-table td {
         padding-bottom: 10px;
    }


    .loading-content {
        padding: 30px;
        width: 80%;
        max-width: 280px;
    }

    .loading-text {
        font-size: 0.9rem; /* フォントサイズ調整 */
    }

    .btn-home {
        padding: 13px 30px; /* パディング調整 */
        font-size: 1rem; /* フォントサイズ調整 */
        width: 100%;
    }
}

/* Custom Input Styles */
input[type="tel"],
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="tel"]::-webkit-outer-spin-button,
input[type="tel"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* FAX情報スタイル */
.fax-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px 20px; /* パディング調整 */
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 0.9rem; /* フォントサイズ調整 */
    color: #555; /* 色調整 */
    line-height: 1.7;
}

.fax-info i.fas.fa-fax {
    margin-right: 10px; /* マージン調整 */
    font-size: 1.2em;
    vertical-align: middle;
    color: #777; /* 色調整 */
}

.fax-number {
    font-weight: 500;
    margin-left: 6px; /* マージン調整 */
    font-size: 1.1em;
    letter-spacing: 1px;
    color: #333; /* 色調整 */
    font-family: monospace; /* 等幅フォントで見やすく */
}

@media screen and (max-width: 768px) {
    .fax-info {
        text-align: left;
        padding: 15px;
        margin: 0 -20px 25px -20px; /* 左右マージン調整 */
        border-radius: 0;
        border-left: none;
        border-right: none;
        font-size: 0.85rem; /* フォントサイズ調整 */
        background-color: #f7f7f7;
    }
    .fax-number {
        font-size: 1em;
    }
}

/* 既存の重複スタイル削除 */
/* input[type="tel"]::-webkit-inner-spin-button は既に存在 */

body.page-contact .contact-form-container {
    max-width: 800px;
    margin: 2rem auto;
    font-family: "Zen Kaku Gothic New", sans-serif;
    background-color: #f9f9f9;
    padding: 2.5rem;
}

body.page-contact .contact-form-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: "Zen Kaku Gothic New", sans-serif; /* タイトル用フォント */
    color: #2c3e50; /* Dark blue-gray */
    font-size: 2.8rem;
}

body.page-contact .form-group input[type="checkbox"] + label::before {
    content: '';
    font-family: inherit; /* フォント継承 */
    display: inline-block;
    width: 18px;
}

body.page-contact .contact-form-container .form-actions button {
    display: block;
    width: 100%;
    font-family: "Zen Kaku Gothic New", sans-serif; /* タイトル用フォント */
    background-color: #3498db; /* Bright blue */
    color: white;
}

body.page-contact .form-group textarea {
    min-height: 150px;
    font-family: inherit; /* フォント継承 */
    resize: vertical; /* Allow vertical resizing, disable horizontal */
}

body.page-contact .form-group select {
    /* Inherit font and other properties from text input for consistency */
    font-family: inherit; /* フォント継承 */
    background-color: #fff;
    border: 1px solid #ced4da;
}

body.page-contact .consent-text a:hover {
    text-decoration: underline;
}

/* GDPR consent checkbox and text style */
body.page-contact .gdpr-consent {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f0f4f8; /* Light blue-gray background */
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: "Zen Kaku Gothic New", sans-serif; /* 等幅フォントで見やすく */
}

body.page-contact .gdpr-consent input[type="checkbox"] {
    /* ... existing code ... */
} 