/* J. フォーム/FAQ
   extracted from refine.css (was L1091-1233)
   — render_head の cssLate[] 経由で refine.css の「後」に読み込まれる。
   元ファイル内で後方にあるルールに勝つ前提で書かれているため、
   css[] (refine.css の前) に置くとカスケードが逆転する。 */

/* =====================================================================
   J. フォーム / FAQ（contact）— 二重リングフォーカスと点灯するFAQ
   ===================================================================== */
/* フォーム全体をカード言語の1枚パネルに（パネル=浮く面 / 入力欄=彫られた溝 /
   送信ボタン=グラデの凸、の3階層の触感を作る）。 */
.contact-layout .contact-form {
    position: relative;
    overflow: hidden;
    padding: 28px 26px 26px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: var(--grad-glass-top), var(--surface);
    box-shadow: var(--glass-hilite), var(--shadow-sm);
}

.contact-layout .contact-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-rule);
    opacity: 0.28;
}

/* 入力欄はパネルに「彫り込む」（skill-bar と同じ凹の語彙） */
.contact-form input,
.contact-form textarea {
    background: var(--bg-2);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.contact-form input:focus,
.contact-form textarea:focus {
    background: var(--bg-2);
    border-color: var(--accent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35),
                0 0 0 3px rgba(var(--accent-rgb), 0.16), 0 0 18px rgba(var(--accent-rgb), 0.10);
}

/* フォーカス中フィールドのラベルが灯る */
.form-field label {
    transition: color var(--dur) ease;
}

.form-field:focus-within label {
    color: var(--accent-strong);
}

/* 送信ゾーン: 罫線で区切り、ボタンをひと回り大きく・注記と両端揃えに */
.form-actions {
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
}

.contact-form .btn-primary {
    padding: 14px 34px;
    font-size: 1.05rem;
}

@media (max-width: 600px) {
    .contact-layout .contact-form {
        padding: 20px 16px;
    }

    .contact-form .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .form-privacy {
        justify-content: center;
    }
}

/* 結果バナー: 左4px縦バー + slide-in（PRG 後の表示で1回だけ） */
.form-alert {
    position: relative;
    overflow: hidden;
    padding-left: 20px;
    animation: alert-in 0.3s var(--ease-out) both;
}

.form-alert::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.form-alert-success::before {
    background: var(--success);
}

.form-alert-error::before {
    background: var(--error);
}

@keyframes alert-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

/* 文字数カウンター上限時の生きたフィードバック */
.char-count {
    display: inline-block;
    transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) ease;
}

.char-count.is-limit {
    transform: scale(1.06);
}

/* FAQ: 開くと「点灯」する */
.faq-item {
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out);
}

.faq-item[open] {
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.12), var(--glow);
}

.faq-chevron {
    transition: transform 0.25s var(--ease-out), color var(--dur) ease;
}

/* エラー中の入力欄はフォーカスしても赤枠を維持（青いフォーカス色に上書きされて
   エラーだと分からなくなるのを防ぐ） */
.contact-form :is(input, textarea)[aria-invalid="true"]:focus {
    border-color: var(--error);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(var(--error-rgb), 0.16);
}

