/* TDC Core - public styles */

/* ============================================================
   問診フォーム (.tdc-questionnaire / .tdc-questionnaire-form)
   - すべて .tdc-questionnaire* 配下にスコープし、Kadence のスタイルと干渉しないようにする。
   - box-sizing: border-box を明示し、テーマ側設定でレイアウトが崩れないようにする。
   ============================================================ */

.tdc-questionnaire {
    max-width: 760px;
    margin: 0 auto;
}

.tdc-questionnaire *,
.tdc-questionnaire *::before,
.tdc-questionnaire *::after {
    box-sizing: border-box;
}

/* 注意文 (上部) */
.tdc-q__notice {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    background: #fff8e6;
    border: 1px solid #f0d98c;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tdc-q__notice p {
    margin: 0.25rem 0;
}

/* 結果表示 (成功 / エラー) */
.tdc-q__result {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    line-height: 1.6;
}

.tdc-q__result--success {
    background: #e9f7ef;
    border: 1px solid #9ed8b6;
    color: #1c6b41;
}

.tdc-q__result--error {
    background: #fdecea;
    border: 1px solid #f2a9a1;
    color: #a12018;
}

.tdc-q__result-title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.tdc-q__result-note {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* フォーム本体 */
.tdc-questionnaire-form {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

/* グリッド: SP は 1 カラム */
.tdc-q__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem 1.25rem;
}

/* PC (600px 以上) は 2 カラム */
@media (min-width: 600px) {
    .tdc-q__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 全幅フィールド (住所・テキストエリア等) */
.tdc-q__field--full {
    grid-column: 1 / -1;
}

.tdc-q__field {
    display: flex;
    flex-direction: column;
    min-width: 0; /* グリッド内で input がはみ出さないように */
}

.tdc-q__label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.tdc-q__required {
    font-size: 0.7rem;
    font-weight: 700;
    color: #c0392b;
    background: #fdecea;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
}

.tdc-q__input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    color: inherit;
}

.tdc-q__input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}

textarea.tdc-q__input {
    resize: vertical;
    min-height: 4.5rem;
}

.tdc-q__field-note {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: #666;
}

/* エラー状態 */
.tdc-q__field--has-error .tdc-q__input {
    border-color: #c0392b;
    background: #fffafa;
}

.tdc-q__field-error {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    color: #c0392b;
}

/* 同意チェックボックス（v0.4 §5.2 consent_at 取得 UI） */
.tdc-q__consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}

.tdc-q__consent-input {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
}

.tdc-q__consent-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.tdc-q__field--has-error .tdc-q__consent-text {
    color: #c0392b;
}

/* 送信ボタン */
.tdc-q__actions {
    margin-top: 1.5rem;
}

.tdc-questionnaire-form__submit {
    padding: 0.7rem 2rem;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.tdc-questionnaire-form__submit:hover {
    background: #245a96;
}

/* 廃止済み処方コードショートコードの管理者向け注記。 */
.tdc-prescription {
    max-width: 640px;
    margin: 0 auto;
}
