/* ==========================================================
   keiba-navi-kuchikomi : 投稿フォーム
   当初装飾 (post 30016 _custom_css 130行) を .kn-* セレクタへ移植
   - 原本 .review-form-container → .kn-form
   - 原本 .form-group.form-section-* → .kn-form-section.kn-section-*
   - 原本 .likert-options → .kn-radio-options / .kn-likert-options / .kn-toggle-options
   - 原本「rating セクション」は現行仕様では is-hit トグル (当たった/外れた) で
     構造維持のまま配色だけ原本のラッシ系（淡桃 + 選択時オレンジ）に寄せる
   - 必須バッジは原本 ::after の代わりに既存の .kn-badge-required span を流用
   ========================================================== */

/* ──────────────────────────────────────────────
   全体ラッパ (max-width はバックアップ前と同じ: 760px @ .kn-form)
   ────────────────────────────────────────────── */
.kn-form-wrapper {
    max-width: 100%;
    margin: 24px 0;
    box-sizing: border-box;
}

/* フォーム本体 = 原本 .review-form-container の装飾、幅は 760px */
.kn-form {
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 20px;
    border: 1px solid #dce3eb;
    max-width: 760px;
    margin: auto;
    font-family: "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 15px 45px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* ──────────────────────────────────────────────
   各セクション = 原本 .form-group
   ────────────────────────────────────────────── */
.kn-form-section {
    margin-bottom: 18px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-sizing: border-box;
    background: transparent;
}
.kn-form-section:last-of-type {
    margin-bottom: 0;
}
.kn-form-section.is-error {
    outline: 2px solid #e74c3c;
    outline-offset: -1px;
}

/* セクションごとの配色 (原本 .form-section-* 完全移植) */
.kn-section-username    { background-color: #f8f9fa; border-color: #e2e8f0; }
.kn-section-is-hit      { background-color: #fff5f5; border-color: #fed7d7; }  /* 元 .form-section-rating */
.kn-section-experience  { background-color: #f0fff4; border-color: #c6f6d5; }
.kn-section-likert,
.kn-section-price_satis,
.kn-section-profit_satis,
.kn-section-repeat_satis { background-color: #fffde7; border-color: #fff9c4; }
.kn-section-prediction-type,
.kn-section-refund      { background-color: #fffaf0; border-color: #feebc8; }
.kn-section-image       { background-color: #f0f7ff; border-color: #bee3f8; }
.kn-section-comment     { background-color: #f8f9fa; border-color: #e2e8f0; }

/* ──────────────────────────────────────────────
   ラベル (原本 .main-label)
   ────────────────────────────────────────────── */
.kn-form-label {
    display: flex;
    align-items: center;
    font-weight: 800;
    margin-bottom: 15px;
    color: #2d3436;
    font-size: 1rem;
}

/* 必須バッジ (原本 ::after の代替) */
.kn-badge-required {
    content: "必須";
    font-size: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
    font-weight: bold;
    line-height: 1.4;
}

/* ──────────────────────────────────────────────
   入力要素
   ────────────────────────────────────────────── */
.kn-form input[type="text"],
.kn-form input[type="file"],
.kn-form select,
.kn-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    color: #2d3436;
    font-family: inherit;
}
.kn-form input[type="text"]:focus,
.kn-form input[type="file"]:focus,
.kn-form select:focus,
.kn-form textarea:focus {
    outline: 2px solid #ff9800;
    outline-offset: 1px;
    border-color: #ff9800;
}
.kn-form textarea { resize: vertical; }

/* ──────────────────────────────────────────────
   リッカート / ラジオ / トグル (原本 .likert-options 共通)
   ────────────────────────────────────────────── */
.kn-radio-options,
.kn-likert-options,
.kn-toggle-options {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
}
.kn-radio-option,
.kn-likert-option,
.kn-toggle-option {
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.kn-radio-option input,
.kn-likert-option input,
.kn-toggle-option input {
    display: none;
}
.kn-radio-option span,
.kn-likert-option span,
.kn-toggle-option span {
    display: block;
    padding: 12px 2px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #7f8c8d;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* 選択時のカラー (原本準拠) */

/* 競馬歴: 緑 */
.kn-section-experience .kn-radio-option input[type="radio"]:checked + span {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

/* リッカート系 (価格設定/稼げた/リピートしたい): 橙 */
.kn-section-likert .kn-likert-option input[type="radio"]:checked + span,
.kn-section-price_satis .kn-likert-option input[type="radio"]:checked + span,
.kn-section-profit_satis .kn-likert-option input[type="radio"]:checked + span,
.kn-section-repeat_satis .kn-likert-option input[type="radio"]:checked + span {
    background: #f39c12;
    border-color: #f39c12;
    color: #fff;
}

/* 予想種類: 無料=青、有料=赤 */
.kn-section-prediction-type .kn-toggle-option input[value="free"]:checked + span {
    background: #3498db !important;
    border-color: #3498db !important;
    color: #fff !important;
}
.kn-section-prediction-type .kn-toggle-option input[value="paid"]:checked + span {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: #fff !important;
}

/* 評価 (is-hit トグル) — 原本 rating セクションのオレンジ系を踏襲 */
.kn-section-is-hit .kn-toggle-option span {
    color: #ff9800;
    border-color: #ffd8a8;
}
.kn-section-is-hit .kn-toggle-option input[type="radio"]:checked + span {
    background: #ff9800;
    border-color: #e67e22;
    color: #fff;
}

/* ──────────────────────────────────────────────
   画像プレビュー (現行プラグイン仕様の機能、装飾だけ整える)
   ────────────────────────────────────────────── */
.kn-image-preview img {
    max-width: 240px;
    margin-top: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

/* ──────────────────────────────────────────────
   送信ボタン (原本 .submit-btn 完全移植)
   ────────────────────────────────────────────── */
.kn-form-actions {
    margin-top: 15px;
    text-align: center;
}
.kn-submit-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #ffffff;
    padding: 20px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    font-weight: 900;
    font-size: 1.2rem;
    margin-top: 15px;
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.3);
    border-bottom: 4px solid #d35400;
    min-width: 0;
    font-family: inherit;
    position: relative;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.kn-submit-btn:hover:not(:disabled):not(.is-loading) {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.kn-submit-btn:active:not(:disabled):not(.is-loading) {
    transform: translateY(2px);
    border-bottom-width: 0;
}
.kn-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 送信中スピナー — 現行プラグイン仕様、配色は維持 */
.kn-submit-btn.is-loading {
    cursor: progress;
    pointer-events: none;
    opacity: 0.85;
}
.kn-submit-btn.is-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #FFF;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    animation: kn-spin 0.6s linear infinite;
}
@keyframes kn-spin {
    to { transform: rotate(360deg); }
}

/* ──────────────────────────────────────────────
   送信結果メッセージ
   ────────────────────────────────────────────── */
.kn-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: bold;
}
.kn-form-message.is-success {
    background: #f0fff4;
    color: #27ae60;
    border: 1px solid #c6f6d5;
}
.kn-form-message.is-error {
    background: #fff5f5;
    color: #e74c3c;
    border: 1px solid #fed7d7;
}

/* 原本の余白潰し */
.kn-form br { display: none; }
.kn-form p { margin: 0; padding: 0; }

/* ──────────────────────────────────────────────
   レスポンシブ (原本準拠)
   ────────────────────────────────────────────── */
@media screen and (max-width: 480px) {
    .kn-radio-option span,
    .kn-likert-option span,
    .kn-toggle-option span {
        font-size: 10px;
        letter-spacing: -0.5px;
    }
}
