/**
 * チアパーソナル教室独自実装お問い合わせフォーム スタイル
 *
 * - 既存の .inquiry / .haveto / .any / .form-h3 / #accep-wrap / .submit-btn 等の
 *   既存スタイル（common.css）を再利用しつつ、独自実装で必要な追加分のみ記述
 */

.bc-form .form-h3 {
    font-size: 1rem;
    margin: 0;
}

/* セクション切替 */
.bc-form .bc-section[hidden] { display: none; }

/* ラジオグループ（目的選択） */
.bc-form .bc-radio-group {
    display: flex;
    gap: 1.5em;
    margin: 0.5em 0 1em;
    flex-wrap: wrap;
}
.bc-form .bc-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    cursor: pointer;
}

/* 同意チェック */
.bc-form .bc-acceptance {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    margin-top: 0.5em;
    cursor: pointer;
}

/* honeypot：完全非表示 */
.bc-form .bc-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Turnstileウィジェット配置 */
.bc-form .bc-turnstile-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5em 0;
}

/* 送信ボタンラッパー */
.bc-form .bc-submit-wrap {
    text-align: center;
    margin-top: 1.5em;
}

.bc-form .bc-submit[disabled],
.bc-form .submit-btn[disabled] {
    background: #ccc !important;
    color: #fff !important;
    cursor: not-allowed;
    opacity: 1;
    pointer-events: auto;
}
.bc-form .bc-submit[disabled]:hover,
.bc-form .submit-btn[disabled]:hover {
    background: #ccc !important;
}

/* エラー表示 */
.bc-form .bc-error {
    color: #c0392b;
    font-size: 0.85em;
    margin: 0.3em 0 0;
    min-height: 1em;
}
.bc-form .bc-error:empty {
    margin: 0;
    min-height: 0;
}

/* 結果メッセージ */
.bc-form .bc-result {
    margin-top: 1em;
    padding: 0.8em 1em;
    border-radius: 6px;
    font-size: 0.95em;
}
.bc-form .bc-result-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}
.bc-form .bc-result-pending {
    background: #fff9e0;
    color: #6c5e00;
    border: 1px solid #ffeaa7;
}

/* 完了表示 */
.bc-complete {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    border-radius: 8px;
    padding: 2em 1.5em;
    text-align: center;
    margin: 1em 0;
}
.bc-complete-title {
    color: #16a34a;
    margin: 0 0 0.6em;
    font-size: 1.4em;
}
.bc-complete-body {
    margin: 0 0 0.8em;
    font-size: 1.05em;
}
.bc-complete-note {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* 店舗セレクト（optgroupスタイル） */
.bc-form .bc-store-select optgroup {
    font-weight: bold;
    color: #333;
}
.bc-form .bc-store-select option {
    font-weight: normal;
    padding-left: 1em;
}

/* ===========================================
 * 問い合わせ種別選択ラジオ（元 page-contact.php のCSS流用）
 * =========================================== */
.contact-type-selector {
    margin: 2em auto 2em;
}
.contact-type-label {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 1em;
    text-align: center;
}
.contact-type-radios {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}
.contact-radio-item {
    display: flex;
    align-items: center;
    padding: 1em 1.2em;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.contact-radio-item:hover {
    border-color: #e60012;
    background-color: #fff5f5;
}
.contact-radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 1em;
    accent-color: #e60012;
    cursor: pointer;
}
.contact-radio-item span {
    font-size: 1em;
    line-height: 1.4;
}
.contact-radio-item:has(input:checked) {
    border-color: #e60012;
    background-color: #fff5f5;
}

/* 横並びのラジオ（経験 あり/なし など） */
.bc-form .bc-inline-radios {
    flex-direction: row;
    gap: 0.8em;
    flex-wrap: wrap;
}
.bc-form .bc-inline-radios .contact-radio-item {
    flex: 0 0 auto;
    padding: 0.6em 1.4em;
}
.bc-form .bc-inline-radios .contact-radio-item input[type="radio"] {
    margin-right: 0.5em;
}

/* ===========================================
 * フォーム本体（独自実装）スタイル
 * 既存 .inquiry テーブルの装飾を独自実装フォーム向けに上書き
 * =========================================== */

/* フォーム全体の幅制限 */
.bc-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .bc-form {
        padding: 10px;
    }
}

/* 既存テーブルのボーダー類を完全リセット */
.bc-form .inquiry,
.bc-form .inquiry tr,
.bc-form .inquiry th,
.bc-form .inquiry td {
    border: 0 !important;
    box-shadow: none !important;
}
.bc-form .inquiry {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    margin: 1em 0;
}
/* tr を flex 化しているため、table/tbody のテーブルレイアウトを完全に無効化する。
 * （table を display:table のまま残すと、Samsung等で匿名テーブルボックスが生成され
 *   行の下に余分な縦余白が出ることがあるため block 化する） */
.bc-form .inquiry,
.bc-form .inquiry tbody {
    display: block;
}

/* 行をカード型に */
.bc-form .inquiry tr {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 0.5em;
    overflow: hidden;
}
.bc-form .inquiry th {
    flex: 0 0 35%;
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 1em 1.2em;
    background: #f7f7f7;
    font-weight: bold;
    text-align: left;
    color: #333;
}
.bc-form .inquiry td {
    flex: 1 1 65%;
    padding: 1em 1.2em;
    background: #fff;
    vertical-align: middle;
}

/* 必須・任意バッジ（既存common.cssで定義されていない場合のフォールバック） */
.bc-form .haveto,
.bc-form .any {
    display: inline-block;
    font-size: 0.75em;
    padding: 0.2em 0.7em;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    line-height: 1.4;
    flex-shrink: 0;
}
.bc-form .haveto { background: #e60012; }
.bc-form .any    { background: #888; }

/* input・textarea・select の統一スタイル */
.bc-form input[type="text"],
.bc-form input[type="email"],
.bc-form input[type="tel"],
.bc-form input[type="date"],
.bc-form input[type="number"],
.bc-form textarea,
.bc-form select {
    width: 100%;
    padding: 0.7em 0.9em;
    font-size: 1em;
    font-family: inherit;
    color: #333;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.15s, background-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.bc-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9em center;
    padding-right: 2.4em;
}
/* 日付選択セレクトは右端をカレンダーアイコンにする（▼の代わり） */
.bc-form .bc-date-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3e%3c/svg%3e");
    background-position: right 0.6em center;
    background-size: 18px;
    padding-right: 2.4em;
}

/* ※ 希望日時は <input type="date"> を廃止し <select> で選ばせる方式に変更したため、
 *   日付input専用のスタイルは不要（Android/Samsung等での余白不具合を根本回避）。 */
.bc-form input:focus,
.bc-form textarea:focus,
.bc-form select:focus {
    outline: none;
    border-color: #e60012;
    background-color: #fff;
}
.bc-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* ご希望日時の行レイアウト */
.bc-form .layout-row {
    display: flex;
    align-items: center;
    gap: 0.7em;
    flex-wrap: wrap;
}
.bc-form .layout-row.bottom-margin { margin-bottom: 0.7em; }
.bc-form .form-width-m { flex: 0 0 180px; max-width: 180px; }
.bc-form .form-width-s { flex: 0 0 110px; max-width: 110px; }
.bc-form .layout-row > span.b,
.bc-form .layout-row > span:first-child:not(.haveto):not(.any) {
    flex: 0 0 4.5em;
    font-weight: bold;
}
.bc-form .inform-txt {
    margin: 0 0 0.7em;
    color: #666;
    font-size: 0.9em;
}

/* 同意エリア（カード型・薄ピンク背景・赤い縦バー） */
.bc-form #accep-wrap {
    margin: 1.5em auto;
    padding: 1.5em 1.2em;
    background: #ffe9e9;
    border-left: 4px solid #e60012;
    border-radius: 6px;
    text-align: center;
}
.bc-form #accep-wrap > a {
    display: inline-block;
    font-weight: bold;
    color: #e60012;
    text-decoration: underline;
    margin-bottom: 0.5em;
    font-size: 1.05em;
}
.bc-form #accep-wrap p {
    margin: 0.4em 0;
    color: #333;
}

/* 同意するチェックボックス（ボタン風） */
.bc-form .bc-acceptance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    margin: 0.8em auto 0;
    padding: 0.8em 2.2em;
    background: #fff;
    border: 2px solid #e60012;
    border-radius: 999px;
    font-weight: bold;
    color: #e60012;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
/* チェックボックスは appearance: none で完全カスタム化
 * （Android Chrome 等で accent-color の挙動が不安定でチェックマークが見えないケースを回避） */
.bc-form .bc-acceptance input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid #e60012;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.bc-form .bc-acceptance input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 11px;
    border: solid #e60012;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.bc-form .bc-acceptance:hover {
    background: #fff5f5;
}
.bc-form .bc-acceptance:has(input:checked) {
    background: #e60012;
    color: #fff;
}

/* 同意エラー時の強調表示 */
.bc-form #accep-wrap .bc-error {
    font-weight: bold;
    color: #e60012;
}
.bc-form #accep-wrap .bc-error:not(:empty) {
    display: inline-block;
    margin-top: 0.8em;
    padding: 0.5em 1em;
    background: #fff;
    border: 1.5px solid #e60012;
    border-radius: 4px;
    font-size: 0.95em;
    animation: bc-shake 0.4s;
}
@keyframes bc-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 送信ボタン */
.bc-form .submit-btn {
    display: inline-block;
    width: 100%;
    padding: 1em 2em;
    font-size: 1.05em;
    font-weight: bold;
    color: #fff;
    background-color: rgb(0, 124, 186);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(33, 33, 33, 0.3);
    transition: all 0.3s ease;
}
.bc-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 33, 33, 0.4);
}

/* レスポンシブ: SP では th 上 / td 下
 * モバイルでは tr/th/td を flex ではなく block で縦積みにする（本番フォームと同じ方式）。
 * tr を flex のまま flex-direction:column にすると、Samsung等で td の下に余分な縦余白が
 * 生じる不具合があったため、純粋な block フローに変更して回避する。 */
@media (max-width: 768px) {
    .bc-form .inquiry tr { display: block; }
    .bc-form .inquiry th,
    .bc-form .inquiry td { display: block; width: 100%; }
    .bc-form .form-width-m { flex: 1 1 auto; max-width: 100%; }
    .bc-form .form-width-s { flex: 0 0 90px; max-width: 90px; }
}
