/* ===================================
   基本設定（デスクトップファースト）
   =================================== */
   @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

   /* ===================================
      スムーズなページ遷移のための基本設定
      =================================== */
    /* html {
        scroll-behavior: smooth;
        height: 100%;
        overflow-y: scroll;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        width: 100%; /* ← max-width から width に変更 */
    } */
    html {
        scroll-behavior: smooth;
        height: 100%;
        overflow-y: scroll;
        overflow-x: hidden; /* ← 追加 */
        margin: 0;
        padding: 0;
        max-width: 100vw; /* ← 追加 */
    }
   
body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-width: 320px; /* ← 1024px → 320px に変更 */
    max-width: 100vw; /* ← 追加: 画面幅を超えないように */
    overflow-x: hidden; /* ← 追加: 横スクロールを完全に防止 */
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-tap-highlight-color: transparent; /* ← 追加: タップ時のハイライト除去 */
    -webkit-touch-callout: none; /* ← 追加: 長押しメニュー無効化 */
    /* zoom: 1.2; ← 削除: これが拡大の原因 */
}

    /* body {
        font-family: 'Noto Sans JP', sans-serif;
        margin: 0;
        padding: 0;
        /* padding-top: 80px; */
        min-height: 100vh; /* 100% → 100vh に変更 */
        background-color: #f5f5f5;
        /* background-image: url("../img/background.jpg"); */
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        min-width: 1024px; /* デスクトップ向けの最小幅を設定 */
        opacity: 1;/* コンテンツのちらつき防止 */
        transition: opacity 0.3s ease-in-out;
        display: flex;              /* ← 追加 */
        flex-direction: column;     /* ← 追加 */
        touch-action: manipulation; /* ← 追加: ダブルタップによる拡大を防止 */
        -ms-touch-action: manipulation; /* ← 追加: IE/Edge対応 */
        zoom: 1.2; /* ← 追加: 120%に拡大 */
    } */
   
   body.fade-out {
       opacity: 0; /* 遷移直前に透明にする */
   }

   /* ページ読み込み中のスタイル */
   body.loading {
       opacity: 0;
   }

   /* ========== メインコンテンツ（フッター固定用） ========== */
   /* .main-section {
       flex: 1;  /* ← 追加 */
   } */
   
   body.fade-out {
       opacity: 0; /* 遷移直前に透明にする */
   }

   /* ページ読み込み中のスタイル */
   body.loading {
       opacity: 0;
   } */
   
   /* 画像の事前サイズ指定 */
   img {
       aspect-ratio: attr(width) / attr(height); /* 画像の縦横比を事前に確保 */
   }
   
   /* アニメーションの無効化（必要な場合） */
   @media (prefers-reduced-motion: reduce) {
       html {
           scroll-behavior: auto;
       }
       
       * {
           animation-duration: 0.01ms !important;
           animation-iteration-count: 1 !important;
           transition-duration: 0.01ms !important;
           scroll-behavior: auto !important;
       }
   }

   /* ===================================
   ヘッダー領域
   =================================== */
    .header {
        /* position: fixed; */
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 0;
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-container {
        display: flex;
        justify-content: center;
        /* justify-content: space-between; */
        align-items: center;
        padding: 5px 40px;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* サイトタイトル */
    .site-title {
        font-size: 2.4rem;
        font-weight: 800;
        margin: 0;
        color: white;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
        letter-spacing: -0.02em;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-right: auto; /* ← これで左寄せ */
    }

    .site-title:hover {
        transform: translateY(-2px) scale(1.01);
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }

    /* スタイリッシュなナビゲーション */
    .header-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 35px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 30px;
        padding: 12px 25px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .header-nav li {
        margin: 0;
    }

    .header-nav a {
        text-decoration: none;
        color: white;
        font-weight: 600;
        font-size: 1rem;
        padding: 10px 20px;
        border-radius: 25px;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        opacity: 0.9;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 0.9rem;
        position: relative;
        overflow: hidden;
    }

    .header-nav a::before {
        pointer-events: none;
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.6s ease;
    }

    .header-nav a:hover::before {
        left: 100%;
    }

    .header-nav a:hover {
        background: rgba(255, 255, 255, 0.2);
        opacity: 1;
        transform: translateY(-3px) scale(1.01);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }

    /* レスポンシブ対応 */
    @media screen and (max-width: 768px) {
        .header-container {
            padding: 15px 20px;
            flex-direction: column;
            gap: 20px;
        }
        
        .site-title {
            font-size: 2rem;
        }
        
        .header-nav ul {
            gap: 20px;
            flex-wrap: wrap;
            justify-content: center;
            padding: 10px 20px;
        }
        
        .header-nav a {
            font-size: 0.85rem;
            padding: 8px 16px;
        }
    }

    @media screen and (max-width: 480px) {
        .header-container {
            padding: 15px;
        }
        
        .site-title {
            font-size: 1.8rem;
        }
        
        .header-nav ul {
            gap: 15px;
            padding: 8px 15px;
        }
        
        .header-nav a {
            font-size: 0.8rem;
            padding: 6px 12px;
        }
    }

/* ===================================
      main-section領域
      =================================== */
    .main-section {
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 40px 30px;
        text-align: center;
        margin: 30px auto;
        max-width: 800px;
        width: 70%;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
        border: 1px solid rgba(102, 126, 234, 0.2);
        box-sizing: border-box; 
    }
   
   .main-section h1 {
       font-size: 1.8em;
       color: #010000;
       margin-top: 30px;
       margin-bottom: 20px;
   }
   
   .main-section p {
       font-size: 1.2em;
       color: #333;
       margin: 10px 0;
       /* flex-direction: column; */
   }
   
   /* ===================================
      form-container要素
      =================================== */
   .form-container {
       max-width: 400px;
       margin: 0 auto;
       padding: 0px;
       display: flex;
       flex-direction: column;
       align-items: center; /* 子要素（ボタン）を左右方向でセンタリング */
   }
   
    /* ===================================
      form-group要素
   =================================== */
   .form-group {
       display: flex;
       flex-direction: column;
       /* align-items: flex-start; center から flex-start に変更 */
       align-items: center;
       /* justify-content: center;  左右方向のセンタリング */
       margin-top: 10px;
       margin-bottom: 10px;
       width: 100%; /* 親要素の幅いっぱいに */
   }

    .form-group label {
       display: block;
       margin-bottom: 0px;
       font-weight: bold;
       min-width: max-content; /* ラベルの幅を内容に合わせる */
   }

    /*ログインフォーム内のinputとpassword-wrapperをボタン幅に揃える */
    .form-container .form-group input[type="email"],
    .form-container .form-group .password-wrapper {
        width: 100%;            /* ← align-self:stretchから変更: 確実に全幅を指定 */
        box-sizing: border-box;
    }

    /*wrapper内のpassword inputも明示的に全幅に */
    .form-container .form-group .password-wrapper input[type="password"] {
        width: 100%;
        box-sizing: border-box;
        padding-right: 80px;    /* ← 表示ボタン分の余白を維持 */
    }

   /* パスワード入力欄のラッパー */
   .password-wrapper {
        position: relative;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    /* パスワード入力欄（表示ボタン分の右paddingを追加） */
    .password-wrapper input[type="password"] {
        padding-right: 80px; /* ← 表示ボタンの幅分だけ上書き */
    }

    .password-wrapper input[type="text"]#password_visible {
        width: 100%;
        box-sizing: border-box;
        padding: 10px;
        padding-right: 80px;
        border: 1px solid #ccc;
        border-radius: 5px;
        font-size: 1em;
    }

    /* 表示/非表示トグルボタン */
    .toggle-password-btn {
        position: absolute;
        right: 5px;
        top: 57%;
        transform: translateY(-50%);
        height: 32px;
        width: 60px;            /* ← 追加: 「非表示」の文字幅に合わせた固定幅 */
        padding: 5px 0;         /* ← 変更: 固定幅内でテキストを中央寄せ */
        text-align: center;     /* ← 追加: テキストを中央揃え */
        box-sizing: border-box; /* ← 追加: paddingを幅に含めて計算を統一 */
    }
    /* .toggle-password-btn {
        position: absolute;
        right: 5px;
        top: 57%;
        transform: translateY(-50%);
        height: 32px;
        padding: 5px 10px;
    } */

   /* ========== 管理者モード用バナー ========== */
    .admin-banner {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 10px 20px;
        color: white;
        font-weight: bold;
        text-align: center;
        z-index: 9999;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .admin-normal {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .admin-impersonating {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    }

    .admin-exit-btn {
        padding: 5px 15px;
        background: white;
        color: #f5576c;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    .admin-exit-btn:hover {
        background: #f5f5f5;
        transform: scale(1.05);
    }

    /* 管理者バナーがある場合はコンテンツを下にずらす */
    body.admin-mode {
        padding-top: 50px;
    }
   
    /* ========== 管理者モーダル ========== */
    .admin-modal {
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .admin-modal-content {
        background-color: white;
        padding: 30px;
        border-radius: 12px;
        width: 90%;
        max-width: 500px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        position: relative;
    }

    .admin-modal-close {
        position: absolute;
        right: 20px;
        top: 15px;
        font-size: 28px;
        font-weight: bold;
        color: #999;
        cursor: pointer;
        transition: color 0.3s;
    }

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

    .admin-modal-content h2 {
        color: #667eea;
        margin-bottom: 15px;
    }

    .admin-modal-content p {
        margin-bottom: 20px;
        color: #666;
    }

    .admin-modal-content .form-group {
        margin-bottom: 20px;
    }

    .admin-modal-content .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
    }

    .admin-modal-content .form-group input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }

    .admin-modal-content .button-group {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
    }

    .admin-modal-content .button-group button {
        flex: 1;
    }

    .admin-modal-content .cta-button.secondary {
        background: #6c757d;
    }

    .admin-modal-content .cta-button.secondary:hover {
        background: #5a6268;
    }

    .admin-current-status {
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        border-left: 4px solid #667eea;
    }

    .admin-current-status p {
        margin: 5px 0;
        font-size: 14px;
        color: #333;
    }

    .admin-current-status strong {
        color: #667eea;
    }

    /* ========== 管理者用ボタン ========== */
    .admin-button-container {
        margin: 20px 0;
        text-align: center;
    }

    .admin-switch-button {
        padding: 12px 30px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        transition: all 0.3s ease;
    }

    .admin-switch-button:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }

    .admin-switch-button:active {
        transform: translateY(0);
    }
    
   /* 入力フィールド共通スタイル */
   .form-group input[type="email"],
   .form-group input[type="password"],
   .form-group select,
   .form-group textarea {
       width: 100%;
       padding: 10px;
       border: 1px solid #ccc;
       border-radius: 5px;
       box-sizing: border-box;
       font-size: 1em;
   }
   
/* この前後でtextareaが重複定義されている（要修正） */

   .form-group textarea {
       min-height: 100px;
       resize: vertical;
       font-family: 'Noto Sans JP', sans-serif;
        width: 100%;
   }
   
   /* 出願人情報の登録 */
   .form-container input[type="text"],
   .form-container input[type="tel"],
    .form-container input[type="email"],
    .form-container input[type="password"],
   /* .form-container input, */
   .form-container textarea {
     width: 100%;
     padding: 10px;
     margin-top: 5px;
     font-size: 16px;
     line-height: 1.4;
     box-sizing: border-box;
   }
   
   /* ボタンスタイル */
   .cta-button {
       background-color: #485bb3;
       color: white;
       padding: 10px 25px; /* パディングを縮小 */
       text-decoration: none;
       border-radius: 5px;
       font-size: 1em; /* フォントサイズを少し小さく */
       display: inline-block;
       margin: 20px 10px; /* 左右にマージンを追加 */
       transition: all 0.3s ease;
       border: none;
       cursor: pointer;
       min-width: 133px; /* 元のmin-widthの2/3程度 */
       /* 追加スタイル - ブラウザ固有のスタイルをリセット */
       -webkit-appearance: none;
       -moz-appearance: none;
       appearance: none;
       /* ボックスモデルを統一 */
       box-sizing: border-box;
       /* テキスト配置を統一 */
       text-align: center;
       /* フォントを統一 */
       font-family: inherit;
       /* アウトラインを削除 */
       outline: none;
   }
   
   /* input と button のスタイルを明示的に揃える */
   button.cta-button,
   input[type="submit"].cta-button,
   input[type="click"].cta-button,
   input[type="button"].cta-button {
       /* 上のスタイルを継承しつつ、特定の要素に対する微調整を追加 */
       line-height: 1.5;
       /* IE と Edge 用の追加スタイル */
       overflow: visible;
       /* Firefox 用のボタンテキスト位置調整 */
       text-indent: 0;
       /* デフォルトの内部余白を削除 */
       padding: 10px 25px;
   }
   
   .cta-button:hover {
        background-color: #5a67d8;
        transform: translateY(-2px) scale(1.01); /* scale(1.01)を追加 */
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    /* クリック時の沈み込み効果 */
    .cta-button:active {
        background-color: #4c51bf; /* クリック時の濃い水色 */
        transform: translateY(0) scale(0.99); /* 沈み込み効果 */
        box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 影を小さく */
    }

   /* 出願人情報の郵便番号の入力欄および検索ボタン */
    .postcode-group {
        display: flex;
        flex-direction: column; /* ラベルは上に配置 */
        align-items: flex-start;
    }

    /* ラベルと入力欄の間隔 */
    .postcode-group label {
        margin-bottom: 5px;
    }

    /* 入力とボタンを横並びにするためのラッパー */
    .postcode-input-wrapper {
        display: flex;
        flex-direction: row;
        width: 100%;
    }

    /* 入力フィールドのスタイル */
    .postcode-input-wrapper input {
        width: 70%;
        margin-right: 10px;
    }

    /* 検索ボタンのスタイル */
    .postcode-input-wrapper button {
        width: 25%;
        margin: 0;
        vertical-align: top;
    }
       
   /* 出願人情報等の登録欄の出願人種別のラジオボタン */
   .radio-group {
       display: flex;
       gap: 20px;
       align-items: center;
       flex-wrap: nowrap;
   }
   
   /* ラジオボタンとラベルのコンテナ */
   .radio-group input[type="radio"] {
       margin: 0;
       width: auto;
       cursor: pointer;
   }
   
   .radio-group label {
       margin: 0;
       width: auto;
       text-align: left;
       cursor: pointer;
       padding-left: 5px;
       font-weight: normal;
   }
   
   /* ラジオボタンのカスタマイズ（オプション） */
   .radio-group input[type="radio"] {
       appearance: none;
       -webkit-appearance: none;
       width: 18px;
       height: 18px;
       flex-shrink: 0; /* ← 追加：縮小を禁止 */
       border: 2px solid #666;
       border-radius: 50%;
       outline: none;
       position: relative;
   }
   
   .radio-group input[type="radio"]:checked {
       border-color: #ff8800;
   }
   
   .radio-group input[type="radio"]:checked::before {
       content: '';
       position: absolute;
       width: 10px;
       height: 10px;
       background-color: #ff8800;
       border-radius: 50%;
       top: 50%;
       left: 50%;
       transform: translate(-50%, -50%);
   }
   
   /* ホバー時のスタイル */
   .radio-group input[type="radio"]:hover,
   .radio-group label:hover {
       opacity: 0.8;
   }
   
   /* --- 入力欄が無効化 (disabled) されたときのスタイル --- */

   /* テキスト入力欄、電話番号入力欄、一般的な input 要素、textarea 要素に適用 */
.form-container input[disabled],
.form-container textarea[disabled] {
    /* 濃いグレーの背景色を設定（例: #D3D3D3 LightGrayよりも濃く、#A9A9A9 DarkGrayよりも少し明るい） */
    /* 調整例：#C0C0C0 (Silver) や #A9A9A9 (DarkGray) などお好みで */
    background-color: #777777;
    
    /* 無効化されたフィールドの文字色を調整 */
    color: #333333;
    
    /* 枠線も調整したい場合は追加 */
    border: 1px solid #777777;
    
    /* 既存のスタイルを上書きするため、必要に応じて !important を使用してください */
    /* background-color: #A9A9A9 !important; */
}

/* ラジオボタンが無効化された際のラベルの文字色調整 */
/* ラジオボタン自体は背景色で目立たせることが難しいため、関連するラベルの色を薄くします */
.radio-group input[type="radio"][disabled] + label {
    color: #777777;
}

/* 郵便番号検索ボタンが無効化された際のスタイル（もし必要なら） */
.postcode-input-wrapper button[disabled] {
    /* ボタンの背景色も濃いグレーに設定 */
    background-color: #666666;
    /* カーソルをデフォルトに戻す */
    cursor: default;
}

/* 以下、依頼内容の入力の書式 */
/* ドラッグ＆ドロップエリア */
.drop-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s;
}

/* ドラッグ中の強調表示 */
.drop-area.dragover {
    border-color: #007bff;
    background-color: #eef5ff;
}

/* ファイル入力コンテナのスタイリング */
.d-flex.align-items-center {
    display: flex;
    align-items: center;
    margin-bottom: 10px; /* ファイル入力とプレビューの間に余白を追加 */
}
/* 画像プレビューコンテナのスタイリング */
.thumbnail-container {
    width: 150px;
    height: 150px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* .thumbnail-container {
    width: 150px;
    height: 150px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
} */

/* プレビュー画像のスタイリング（位置指定はしない） */
.thumbnail-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* imagePreview 自体も中央寄せコンテナにする（重要） */
#imagePreview {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 「未選択」テキストのスタイリング */
.no-image {
    font-size: 12px;
    color: #6c757d;
}

/* ホバー用（拡大だけ担当） */
#imagePreview img {
    transition: transform 0.2s ease;
}

/* ホバー時拡大 */
#imagePreview img:hover {
    transform: scale(3.0);
}

/* メニューボタン群のコンテナ */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px; /* ボタン同士の間隔 */
    align-items: center; /* ボタンを中央配置 */
    background-color: #f0f0f0; /* 薄い灰色 */
    padding: 20px; /* 余白を追加して見栄えを調整 */
    border-radius: 8px; /* 角を少し丸める */
}

/* 各メニューボタンの書式 */
.cta-menubutton {
    width: 100%;
    max-width: 350px; /* メニュー用ボタンの幅 */
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    background-color: #5a67d8; /* 水色 */
    /* background-color: #28a745; 緑色 */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin: 15px 0; /* ボタンの上下に余白を追加 */
}

.cta-menubutton:hover {
    background-color: rgba(7, 0, 0, 0.8);
    transform: translateY(-2px) scale(1.01); /* cta-buttonに近い変形に */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); /* 影を追加 */
}

.cta-menubutton:active {
    background-color: rgba(7, 0, 0, 0.8);
    transform: translateY(0) scale(0.99);
}

/* 注文内容入力のプレビュー画像以外 */
.container {
    margin: 16px auto;
    width: 500px;
    max-width: 100%;      /* ← 追加 */
    box-sizing: border-box; /* ← 追加 */
}

.tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.tabs li a {
    display: inline-block;
    width: 80px;
    text-align: center;
    padding: 8px;
    color: #333;
    text-decoration: none;
}

.tabs li a.active {
    background: #333;
    color: #fff;
}

.content {
    display: none;
}

.content.active {
    background: #333;
    color: #fff;
    min-height: 150px;
    padding: 12px;
    display: block;
}

/* 補足説明用の参考ファイルのプレビュー用スタイル */
.reference-file-container {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    position: relative;
    box-sizing: border-box;
    word-break: break-all;
}

.reference-file-icon-container {
    text-align: center;
}

.reference-file-icon {
    font-size: 32px;
}

/* 画像ファイルのプレビュー用 */
.reference-file-icon-container img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

.reference-file-name {
    margin-top: 5px;
    font-size: 12px;
    word-break: break-all;
}

.reference-file-remove-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    background-color: #dc3545;
    color: white;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.reference-file-remove-button:hover {
    background-color: #c82333;
}

/* ===================================
   かっこいいフッター - 安定版
   =================================== */
/* フッター */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: auto;  /* ← これを追加 */
}

/* フッターの装飾的背景要素 */
.footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: footerGlow 8s ease-in-out infinite;
    pointer-events: none;
}
/* /* ===================================
   かっこいいフッター - 安定版
   =================================== */
/* フッター */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

/* フッターの装飾的背景要素 */
.footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: footerGlow 8s ease-in-out infinite;
    pointer-events: none;
} */

@keyframes footerGlow {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

/* フッターコンテンツコンテナ */
.footer-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
}

/* コピーライト */
.footer-copyright,
.footer p {
    font-size: 16px;  /* 13px → 16px に変更 */
    color: rgba(255, 255, 255, 0.8);  /* 0.7 → 0.8 で少し明るく */
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 右端のナビゲーション */
.footer-nav {
    margin: 0;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;  /* 12px → 20px に変更 */
    align-items: center;
    background: rgba(255, 255, 255, 0.1);  /* ヘッダーと同じ背景 */
    backdrop-filter: blur(10px);
    border-radius: 20px;  /* ヘッダーと同じ角丸 */
    padding: 8px 16px;  /* ヘッダーと同じパディング */
    border: 1px solid rgba(255, 255, 255, 0.2);  /* ヘッダーと同じボーダー */
}

.footer-nav li {
    margin: 0;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.9);  /* ヘッダーと同じ色 */
    text-decoration: none;
    padding: 6px 12px;  /* ヘッダーより少し小さめ */
    border-radius: 15px;  /* ヘッダーより少し小さめ */
    background: transparent;  /* 初期は透明 */
    backdrop-filter: blur(3px);
    border: none;  /* ボーダーを削除 */
    font-weight: 500;  /* ヘッダーより少し軽め */
    font-size: 12px;  /* ヘッダーより少し小さめ */
    letter-spacing: 0.3px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);  /* ヘッダーと同じイージング */
    opacity: 0.9;
    text-transform: uppercase;  /* ヘッダーと同じ大文字 */
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* ヘッダーと同じホバー効果の背景 */
.footer-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    pointer-events: none;  /* ホバー効果に干渉しないように */
}

.footer-nav a:hover::before {
    left: 100%;
}

.footer-nav a:hover {
    background: rgba(255, 255, 255, 0.2);  /* ヘッダーと同じ背景 */
    opacity: 1;
    transform: translateY(-2px) scale(1.01); /* headerより控えめ */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);  /* ヘッダーより控えめな影 */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);  /* ヘッダーより控えめな光彩 */
}

.footer-nav li {
    margin: 0;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);  /* 0.6 → 0.7 で少し明るく */
    text-decoration: none;
    padding: 8px 12px;  /* 4px 8px → 8px 12px に変更 */
    border-radius: 15px;  /* 12px → 15px に変更 */
    background: rgba(255, 255, 255, 0.10);  /* 0.08 → 0.10 で少し濃く */
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.15);  /* 0.1 → 0.15 で少し濃く */
    font-weight: 400;  /* 300 → 400 に変更 */
    font-size: 14px;  /* 10px → 14px に変更 */
    letter-spacing: 0.3px;  /* 0.2px → 0.3px に変更 */
    transition: all 0.2s ease;
    white-space: nowrap;
}

.footer-nav a:hover {
    background: rgba(255, 255, 255, 0.20);  /* 0.15 → 0.20 に変更 */
    border-color: rgba(255, 255, 255, 0.3);  /* 0.2 → 0.3 に変更 */
    color: rgba(255, 255, 255, 0.95);  /* 0.9 → 0.95 に変更 */
    transform: translateY(-1px);
} */

/* 装飾的な区切り線（使用しない場合は削除） */
.footer-divider {
    display: none;
}


/* ===================================
    担当者紹介のスタイル
    =================================== */
.staff-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%; /* 丸い枠 */
    object-fit: cover; /* 画像を枠にフィット */
    padding: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none; /* マウスクリックや操作を一切無効にする */
}

.staff-photo:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .footer {
        padding: 18px 20px 10px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;  /* 10px → 15px に変更 */
        text-align: center;
    }
    
    .footer-copyright,
    .footer p {
        font-size: 14px;  /* レスポンシブ時も読みやすく */
    }
    
    .footer-nav ul {
        justify-content: center;
        gap: 10px;  /* 6px → 10px に変更 */
    }
    
    .footer-nav a {
        font-size: 12px;  /* 9px → 12px に変更 */
        padding: 6px 10px;  /* 3px 6px → 6px 10px に変更 */
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 15px 15px 7px;
    }
    
    .footer-copyright,
    .footer p {
        font-size: 13px;  /* 小さい画面でも読みやすく */
    }
    
    .footer-nav a {
        font-size: 11px;  /* 8px → 11px に変更 */
        padding: 5px 8px;  /* 2px 5px → 5px 8px に変更 */
    }
}

/* 発注（注文）画面（顧客向け画面） */
.order-summary {
    background: #f8f9fc !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.order-summary h3 {
    color: #333 !important;
    margin-bottom: 15px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}
.order-item {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1.5fr !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 10px !important;
    border-bottom: 1px solid #eee !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.order-item .item-name {
    text-align: left !important;
    padding-left: 10px !important;
}

.order-item .item-quantity,
.order-item .item-unit-price,
.order-item.tax-row span:last-child,
.order-item .item-subtotal {
    text-align: right !important;
    padding-right: 10px !important;
    font-variant-numeric: tabular-nums !important;
}
.order-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 18px;
    color: #667eea;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #667eea;
}

/* 合計金額行のスタイル強調 */
.order-item.total {
    font-weight: bold !important;
    font-size: 20px !important;
    color: #db5f0c !important;
    border-top: 2px solid #667eea !important;
    margin-top: 15px !important;
    padding-top: 15px !important;
}
.order-item.total span:first-child {
    text-align: left !important;
    padding-left: 10px !important;
}

.order-item.total span:last-child {
    text-align: right !important;
    padding-right: 10px !important;
}

/* 注文項目入力エリア */
.order-item-input {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.order-item-input input {
    padding: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
}
.order-item-input input:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1) !important;
}
.order-item-input .subtotal {
    text-align: right !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 14px !important;
}

/* ヘッダー行（項目名 数量 単価 小計） */
.order-items-header {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr 1.5fr !important;
    gap: 10px !important;
    padding: 10px !important;
    background-color: #f5f5f5 !important;
    border-bottom: 2px solid #667eea !important;
    font-weight: bold !important;
    text-align: center !important;
}

.order-items-header .header-item-name {
    text-align: left !important;
    padding-left: 10px !important;
}

.order-items-header .header-item-quantity,
.order-items-header .header-item-unit-price,
.order-items-header .header-item-subtotal {
    text-align: right !important;
    padding-right: 10px !important;
}

/* セクション全体 */
.order-section {
    margin-bottom: 20px !important;
}

.order-section h3 {
    font-size: 1.2em !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
    text-align: center !important;
    color: #333 !important;
    border-bottom: 2px solid #667eea !important;
    padding-bottom: 10px !important;
}
/* 小計行 */
.order-item.subtotal-row {
    background-color: #f0f8ff !important;
    font-weight: bold !important;
    border-top: 2px solid #667eea !important;
    border-bottom: 2px solid #667eea !important;
}

.order-item.subtotal-row .subtotal-label {
    text-align: left !important;
    padding-left: 10px !important;
    color: #667eea !important;
    white-space: nowrap; /* ← 追加：改行を禁止 */
}

/* 消費税行 */
.order-item.tax-row {
    background-color: #fff9e6 !important;
    font-weight: bold !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .order-item-input {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .order-item-input .subtotal {
        text-align: left !important;
        padding-left: 8px !important;
    }
    /* ← 以下を追加 */
    .order-item,
    .order-items-header {
        grid-template-columns: 1fr auto !important;
        gap: 8px !important;
    }

    .order-item .item-quantity,
    .order-item .item-unit-price {
        display: none !important; /* 数量・単価列を非表示にして小計のみ表示 */
    }

    .order-items-header .header-item-quantity,
    .order-items-header .header-item-unit-price {
        display: none !important;
    }
}

/* 料金表フォーム */
/* ===================================
   料金体系ページ用：2列レイアウト上書き
   =================================== */
.main-section .container .order-item {
    grid-template-columns: 1fr auto !important;
    gap: 20px !important;
}

.main-section .container .order-item span:last-child {
    text-align: right !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
    padding-right: 10px !important;
}

.main-section .container .order-item span:first-child {
    text-align: left !important;
    padding-left: 10px !important;
}

/* 決済フォーム */
.payment-form {
    margin-top: 30px;
}
.payment-form h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* 読み取り専用のemailとapplicant_nameの入力欄スタイル */
input#email[readonly],
input#applicant_name[readonly] {
    background-color: #f0f0f0;
    color: #555;
    cursor: not-allowed;
}

/* ===== SquareのカードUIを入れる枠（中は空のDIV）===== */
.card-container {
    display: block;              /* 単一フィールドでOK */
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9fafb;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}
.card-container:focus-within {
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

/* SquareのスタイルAPIに合わせて軽くカスタム（payment.jsのstyleオプションとも整合） */
.sq-input {
    width: 100%;
    min-height: 42px;
}

/* セキュリティノート */
.security-note {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    font-size: 14px;
    color: #2d5016;
}
.security-note strong {
    color: #1a3009;
}

/* 決済ボタン */
.pay-button {
    width: 100%;
background: linear-gradient(135deg, #ff8800 0%, #ff6600 100%); /* オレンジグラデーション */
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}
.pay-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 136, 0, 0.4); /* 影もオレンジ系に */
}
.pay-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ローディング */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
}

/* エラー・成功メッセージ */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
    font-size: 14px;
}
.success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #060;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
    font-size: 14px;
}

/* ===================================
    タブレット向けスタイル (768px - 1023px)
    =================================== */
@media screen and (max-width: 1023px) {
    body {
        min-width: 768px;
    }

    .header h1 {
        font-size: 2em;
    }

    .form-container {
        max-width: 400px;
    }

    .form-group label {
        width: 30%;
    }

    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px;
    }
    
    .radio-group {
        gap: 15px;
    }
    
    .radio-group input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    .radio-group input[type="radio"]:checked::before {
        width: 8px;
        height: 8px;
    }
}

/* ===================================
    以下、モバイル向けスタイル (767px以下)
    =================================== */
@media screen and (max-width: 767px) {
    body {
        min-width: 320px;
        /* padding-top: 70px; */
    }

    .header {
        padding: 15px 0;
    }

    .header h1 {
        font-size: 1.6em;
    }

    .form-container {
        padding: 10px;
    }

    .form-group {
        flex-direction: column;
        align-items: center;
        /* align-items: flex-start; */
    }

    .form-group label {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
    }

    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group select,
    .form-group textarea {
        width: 100%;
    }

    .cta-button {
        /* width: fit-content; */
        width: 80%;
        padding: 12px 20px;
        font-size: 1.1em;
    }
    
    /* ラジオボタングループを1行に収める */
    .radio-group {
        flex-wrap: nowrap;  /* ← wrap から変更 */
        gap: 10px;          /* ← 20px から縮小 */
        font-size: 0.9em;   /* ← 追加：少し小さく */
    }
    
    .radio-group label {
        padding-left: 8px;
    }

    /* タブの折り返し */
    .tabs {
        flex-wrap: wrap;
    }

    /* コンテナ幅を親要素に収める */
    .container {
        width: 100%;
        box-sizing: border-box;
    }
}

/* 決済画面（お客様側操作） */
@media (max-width: 640px) {
    .container {
        margin: 20px;
        border-radius: 8px;
    }
    .header {
        /* position: fixed; */
        padding: 20px;
    }
    .header h1 {
        font-size: 20px;
    }
    .header p {
        font-size: 14px;
    }
    .content {
        padding: 20px;
    }
    .order-summary {
        padding: 15px;
    }
    .pay-button {
        font-size: 16px;
        padding: 14px 20px;
    }
}

/* ===================================
    印刷用スタイル
    =================================== */
@media print {
    body {
        background-image: none;
        background-color: white;
        min-width: auto;
    }

    .header, .footer {
        background-color: white;
        color: black;
        padding: 15px 0;
    }

    .cta-button {
        display: none;
    }

    .form-group {
        page-break-inside: avoid;
    }
}

/* ===================================
    スマホ向け最適化（追加）
    =================================== */
@media screen and (max-width: 767px) {
    /* ピンチズーム完全無効化 */
    * {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* テキスト選択は許可 */
    p, span, div, h1, h2, h3, h4, h5, h6, li, td, th {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* bodyの最小幅をリセット */
    body {
        min-width: 320px;
        zoom: 1; /* ← デスクトップのzoom: 1.2を無効化 */
    }
    
    /* main-sectionがはみ出さないように */
    .main-section {
        margin: 20px auto; /* ← 15px を auto に変更（左右中央寄せ） */
        padding: 30px 20px;
        width: calc(100% - 40px); /* ← max-width を width に変更、余白を40pxに調整 */
        box-sizing: border-box; /* ← 追加 */
    }
    
    /* ヘッダーも画面幅に収める */
    .header-container {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .form-group label {
        min-width: unset;
        width: 100%;
        white-space: normal;
    }
}