/* ==========================================================================
   Contact Form 7 - バリデーターフォームの基本スタイル (完成版)
   ========================================================================== */
form.wpcf7-form.validator-form.init {
    background: #FFF;
}

/* H2見出し */
form.wpcf7-form h2#cfv7-title {
    color: #333;
    font-size: 20px;
    padding: 20px 30px;
    display: block;
    position: relative;
    margin-bottom: 20px;
}

form.wpcf7-form h2#cfv7-title:before,
form.wpcf7-form h2#cfv7-title:after {
    content: '';
    width: 10px;
    height: calc(100% - 6px);
    position: absolute;
    top: 0;
}

form.wpcf7-form h2#cfv7-title:before {
    border-left: 2px solid #333;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    left: 0;
}

form.wpcf7-form h2#cfv7-title:after {
    border-right: 2px solid #333;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    right: 0;
}

form.wpcf7-form h2#cfv7-title:nth-of-type(2) {
    margin-bottom: 20px;
    margin-top: 40px;
}

/* ==========================================================================
   ★★★ レイアウトの変更箇所 (CSS Grid) ★★★
   ========================================================================== */
.cf7-form-container {
    width: 100%;
    margin: 0 auto;
    font-family: 'Yu Gothic', 'Hiragino Kaku Gothic ProN', sans-serif;
    border-bottom: 1px solid #b8bcc0;
}

.cf7-form-row {
    display: grid;
    grid-template-columns: 30% 1fr;
    align-items: center;
    border-top: 1px solid #b8bcc0;
}

.cf7-form-label,
.cf7-form-input {
    padding: 1em;
    box-sizing: border-box;
}

.cf7-form-label {
    font-weight: bold;
    color: #333;
    background-color: #f5f7fa;
    height: 100%;
    display: flex;
    align-items: center;
}

.cf7-form-input {
    background-color: #FFF;
}

.cf7-form-input.full-width {
    grid-column: 1 / -1;
}

/* ==========================================================================
   フォーム要素 (インプット, テキストエリア, セレクト)
   ========================================================================== */
.cf7-form-container input[type="text"],
.cf7-form-container input[type="email"],
.cf7-form-container input[type="tel"],
.cf7-form-container textarea,
.cf7-form-container select {
    width: 100%;
    padding: 0.5em;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.cf7-form-container ::placeholder {
    color: #999;
}

form.wpcf7-form.validator-form select {
    -webkit-appearance: auto;
    appearance: auto;
    width: calc(100% - 50px);
}

/* バリデーションアイコンのラッパー */
form.wpcf7-form.validator-form .wpcf7-form-control-wrap {
    position: relative;
    display: block;
}

form.wpcf7-form.validator-form .wpcf7-form-control-wrap input:not([type="radio"]):not([type="checkbox"]),
form.wpcf7-form.validator-form .wpcf7-form-control-wrap textarea,
form.wpcf7-form.validator-form .wpcf7-form-control-wrap select {
    padding-right: 35px !important;
}

/* セレクトボックス調整 */
.cf7-form-container select {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ★★★ カラムスタイル ★★★ */
.cf7-col-fields {
    display: flex;
    gap: 1em;
    align-items: flex-start;
}

.col-field-item {
    flex: 1;
}

.col-field-item input[type="text"] {
    width: 100%;
}

.col-field-item label {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 0.3em;
    display: block;
}

/* ==========================================================================
   必須 / 任意ラベル
   ========================================================================== */
.CF7_req,
.CF7_unreq {
    margin-right: 0.5em;
    padding: 3px 8px;
    font-size: 0.8em;
    color: #fff;
    border-radius: 3px;
}

.CF7_req {
    background-color: #dc3232;
}

.CF7_unreq {
    background-color: #999;
}

/* ==========================================================================
   フォーカス時のスタイル
   ========================================================================== */
.cf7-form-container input[type="text"]:focus,
.cf7-form-container input[type="email"]:focus,
.cf7-form-container input[type="tel"]:focus,
.cf7-form-container textarea:focus,
.cf7-form-container select:focus {
    outline: none;
    border-color: #66afe9;
    box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* ==========================================================================
   バリデーションとステータスのスタイル
   ========================================================================== */
form.wpcf7-form.validator-form .validation-status-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 1.1em;
    line-height: 1;
    animation: fadeInScale 0.5s ease forwards;
}

.validation-status-icon .lottie-success,
.validation-status-icon .lottie-error {
    width: 30px;
    height: 30px;
    display: inline-block;
}

form.wpcf7-form.validator-form .wpcf7-validates-as-required.cf7-valid-field {
    border: 1px solid #28a745 !important;
}

form.wpcf7-form.validator-form .cf7-invalid-field {
    border: 1px solid #dc3232 !important;
}

form.wpcf7-form.validator-form label.error {
    display: block;
    margin: 5px 0 0;
    padding: 2px 10px;
    font-size: 90%;
    color: #EB5757;
    border-radius: 5px;
    animation: errorFadeIn 0.5s ease forwards;
}

form.wpcf7-form.validator-form label.error::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f071";
    margin-right: 5px;
    color: #EB5757;
}

/* ==========================================================================
   送信ボタン、モーダル、ローディングなど
   ========================================================================== */
form.wpcf7-form.validator-form .CF7_btn {
    margin-top: 2em;
    text-align: center;
}

.wpcf7 form.wpcf7-form.validator-form input.wpcf7-submit {
    padding: 0.7em 2em;
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background-color: #dc3232;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.wpcf7 form.wpcf7-form.validator-form input.wpcf7-submit:hover {
    background-color: #dc3232;
}

.wpcf7 form.wpcf7-form.validator-form input.wpcf7-submit:disabled {
    color: #666;
    background-color: #ccc;
    opacity: 0.6;
    cursor: not-allowed;
}

/* モーダル関連 */
#modal-container {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

#modal-box {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.3s ease-out;
}

#modal-message p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 0;
}

.modal-close:hover {
    color: #333;
}

.modal-close svg {
    color: #333;
}

.modal-close:hover svg {
    color: #f00;
}

#cf7-lottie-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

#cf7-lottie-animation {
    width: 150px;
    height: 150px;
}

/* アニメーション */
@keyframes errorFadeIn {
    0% { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: translateY(-50%) scale(0.8); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

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

/* ==========================================================================
   ユーティリティ / デフォルト要素の上書き
   ========================================================================== */
form.wpcf7-form.validator-form .wpcf7-not-valid-tip {
    display: none !important;
}

form.wpcf7-form.validator-form .wpcf7-response-output {
    display: none !important;
}

#autozip {
    display: none !important;
}

form.wpcf7-form.validator-form #checkbox-inq\[\]-error {
    display: block;
}

/* ==========================================================================
   レスポンシブデザイン (768px以下)
   ========================================================================== */
@media screen and (max-width: 768px) {
    form.wpcf7-form.init {
        padding: 0;
    }
    .cf7-form-row {
        grid-template-columns: 1fr;
    }

    .cf7-form-label {
        height: auto;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .cf7-name-fields {
        flex-direction: column;
        gap: 0.8em;
    }

	.cf7-col-fields.spbrake {
	  display: block;
	}
}

/* ==========================================================================
   確認画面用スタイル
   ========================================================================== */
.is-hidden {
    display: none !important;
}

#cfv7-confirm-title {
    color: #333;
    font-size: 20px;
    padding: 20px 30px;
    display: block;
    position: relative;
    margin-bottom: 20px;
}

#cfv7-confirm-title:before,
#cfv7-confirm-title:after {
    content: '';
    width: 10px;
    height: calc(100% - 6px);
    position: absolute;
    top: 0;
}

#cfv7-confirm-title:before {
    border-left: 2px solid #333;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    left: 0;
}

#cfv7-confirm-title:after {
    border-right: 2px solid #333;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    right: 0;
}

#cf7-confirm-body .cf7-form-input {
    background-color: #FFF;
    word-wrap: break-word;
}

#cf7-confirm-btn,
#cf7-back-btn {
    padding: 0.7em 2em;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 1em;
    vertical-align: middle;
}

#cf7-confirm-btn:hover,
#cf7-back-btn:hover {
    background-color: #e0e0e0;
}

#cf7-confirm-btn:disabled {
    color: #999;
    background-color: #f0f0f0;
    cursor: not-allowed;
}

#cf7-submit-btn {
    vertical-align: middle;
}

/* conditional fieldsのアニメーション */
.uacf7_conditional {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s ease-in-out;
}

.uacf7_conditional[data-condition="true"] {
    max-height: 1000px;
    opacity: 1;
}

.uacf7_conditional.uacf7-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   プライバシーポリシー表示エリアのスタイル
   ========================================================================== */

.privacy-policy-container {
    margin-bottom: 1em; /* 同意チェックボックスとの間隔を確保 */
}

.privacy-policy-content {
    height: 250px; /* ★ボックスの高さです。好きな数値に調整してください */
    overflow-y: scroll; /* 内容がボックスを超えたら、縦方向にスクロールバーを表示 */
    border: 1px solid #ccc;
    padding: 1em;
    background-color: #f9f9f9; /* 背景色を少し変えて見やすくする */
    font-size: 0.9em;
    line-height: 1.6;
}

/* スクロールバーの見た目をモダンにする（任意） */
.privacy-policy-content::-webkit-scrollbar {
    width: 10px;
}
.privacy-policy-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.privacy-policy-content::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 5px;
}
.privacy-policy-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.privacy-policy-content h2:first-of-type {
  text-align: center;
  margin: 5px auto 15px auto;
  color: #595959;
}
.privacy-policy-content h2:not(:first-of-type) {
  margin: 15px 0 5px 0;
  color: #595959;
  font-size: 16px;
}

/* ==========================================================================
   ファイルアップロード
   ========================================================================== */
.codedropz-upload-inner h3 {
  line-height: 1.33333;
  font-size: 120%;
  color: #595959;
}
@media screen and (max-width: 768px) {
	.dnd-upload-status .dnd-upload-image{
		display:none;
	}
}

/* ==========================================================================
   確認画面 ファイルアップロード調整
   ========================================================================== */
.confirm-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.confirm-preview-item {
    width: 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 画像プレビュー */
.confirm-preview-item.is-image img {
    display: block;
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

/* 画像以外のファイル表示 */
.confirm-preview-item.is-file .confirm-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background-color: #9eb0c9;
    border-radius: 3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* ファイル名 */
.confirm-preview-filename {
    font-size: 12px;
    word-break: break-all;
    line-height: 1.4;
    color: #555;
}
.confirm-preview-item.is-file a {
    text-decoration: none; /* 下線を非表示 */
    color: inherit; /* 親要素の色を継承 */
    display: block; /* アイテム全体をクリック可能にする */
}

/* リンクにホバーした時にファイル名に下線を表示 */
.confirm-preview-item.is-file a:hover .confirm-preview-filename {
    text-decoration: underline;
}


/* ==========================================================================
   スマホでのファイルアップロード表示崩れ対策
   ========================================================================== */

/* アップロードされたファイルアイテム全体をFlexboxに */
.dnd-upload-status {
    display: flex;
    align-items: center;
    gap: 10px; /* 画像アイコンと詳細エリアの間の隙間 */
    width: 100%;
    box-sizing: border-box;
    padding: 0.8em 1em;
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 8px;
}

/* 詳細エリア(.dnd-upload-details)をFlexboxにし、折り返しを許可 */
.dnd-upload-details {
    display: flex;
    flex-wrap: wrap; /* ★重要：子要素を折り返させる */
    align-items: center;
    flex: 1; /* 残りのスペースをすべて使う */
    min-width: 0; /* はみ出しを防ぐための設定 */
}

/* ファイル名(.name)は可変幅にする */
.dnd-upload-details .name {
    flex: 1; /* 空いているスペースを埋める */
    min-width: 0;
    padding-right: 10px; /* 削除ボタンとの間の隙間 */
    font-size: 14px;
    
    /* 長いファイル名を「...」で省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ファイルサイズ表示 */
.dnd-upload-details .name em {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}

/* 削除ボタン(.remove-file)は縮まないようにする */
.dnd-upload-details .remove-file {
    flex-shrink: 0;
}

/* ★★★ プログレスバーを改行させ、幅を100%に設定 ★★★ */
.dnd-upload-details .dnd-progress-bar {
    flex-basis: 100%; /* 幅を100%にして改行を強制 */
    width: 100%;
    margin-top: 8px; /* ファイル名との間のスペース */
    height: 8px; /* プログレスバーの高さ */
    background-color: #e9e9e9;
    border-radius: 4px;
    overflow: hidden;
}

/* プログレスバーの内側 */
.dnd-upload-details .dnd-progress-bar span {
    display: block;
    height: 100%;
    background-color: #28a745; /* 緑色 */
    text-indent: -9999px; /* 「100%」のテキストを非表示に */
}

/* hiddenフィールドを持つspanがレイアウトに影響しないように */
.dnd-upload-details > span:has(input[type="hidden"]) {
    display: none;
}
@media screen and (max-width: 767px) {
  .dnd-upload-status .dnd-upload-details .name {
    padding-right: 0;
    display: none;
  }
}