/* 全体のフォントと背景 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* 明るめのグレー */
    text-align: center;
    color: #333;
}

/* フォームのデザイン */
form {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;  
    text-align: left;
}


/* ヘッダー */
header {
    background: linear-gradient(135deg, #f4e1c6, #d9b08c);
    color: #333;
    padding: 40px 20px;
    text-align: center; /* ヘッダーは中央寄せ */
}

header h1 {
    margin: 0;
    font-size: 36px;
}

header p {
    margin: 5px 0 0;
    font-size: 18px;
}

/* ラベル */
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

/* 入力フィールド */
input, select, textarea {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #fafafa;
}

/* チェックボックスを横並びに */
input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* テキストエリアのサイズ調整 */
textarea {
    height: 120px;
    resize: vertical;
}

/* 送信ボタン */
button {
    margin-top: 20px;
    background-color: #f4a261; /* トップページと統一（柔らかいオレンジ） */
    color: white;
    border: none;
    padding: 14px;
    cursor: pointer;
    width: 100%;
    border-radius: 8px;
    font-size: 16px;
    transition: 0.3s;
}

button:disabled {
    background-color: #ccc; /* 無効状態の背景色（グレー） */
    cursor: not-allowed; /* 無効時のカーソル */
}

button:hover {
    background-color: #e76f51;
}

/* プライバシーポリシーのチェックボックス */
label input[type="checkbox"] {
    margin-top: 10px;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    form {
        max-width: 90%;
    }
}

/* 氏名 横並びレイアウト */
.form-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* スマホ時は縦並び */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
}

/* 家具個数入力欄サイズ調整 */
input[type="number"] {
    width: 70px;       /* 横幅 */
    max-width: 70px;
    text-align: center;
}

/* =========================
   家具・家電レイアウト（完全版）
========================= */

/* グリッド（まずは1列で安定させる） */
.items-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 1アイテム行 */
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;

    width: 100% !important;
    box-sizing: border-box;
}

/* ラベル（チェック＋名前） */
.item-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 130px;
    white-space: nowrap;
}

/* チェックボックス */
.item-row input[type="checkbox"] {
    width: auto;
}

/* サイズ選択（最重要） */
.item-row select {
    width: 160px !important;
    min-width: 140px;
    padding: 6px;
}

/* 個数 */
.item-row input[type="number"] {
    width: 60px !important;
    text-align: center;
}

/* =========================
   エラー表示の崩れ防止
========================= */
.error-text {
    color: red;
    font-size: 12px;
    margin-top: 4px;
}

/* =========================
   スマホ対応
========================= */
@media (max-width: 600px) {
    .item-row {
        flex-wrap: wrap;
    }

    .item-row select {
        width: 100% !important;
    }
}

/* disabled UI 表示制御 */
input:disabled,
select:disabled,
textarea:disabled {
    background-color: #e0e0e0;
    color: #888;
    cursor: not-allowed;
    border: 1px solid #ccc;
}

/* disabled時ラベルも薄く */
input:disabled + label,
select:disabled + label {
    color: #999;
}

/* フッター */
footer {
    margin-top: 30px;
    background-color: #333;
    color: #f4f4f4;
    padding: 15px;
    font-size: 14px;
    text-align: center; /* フッターは中央寄せ */
}

footer p {
    margin: 0;
}

/* PC用 */
.item-row select {
    width: 160px;
}

.item-row input[type="number"] {
    width: 60px;
}

/* スマホ用 */
@media (max-width: 600px) {

    .item-row {
        flex-direction: column;
        align-items: stretch;
    }

    .item-sub-row {
        flex-direction: column;
        align-items: stretch;
    }

    .item-row select,
    .item-row input[type="number"] {
        width: 100% !important;
    }

}

/* ===== 家具レイアウト強制上書き ===== */

.items-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.item-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 10px !important;
}

/* ← これが最重要：100%指定を潰す */
.item-row select,
.item-row input[type="number"] {
    width: auto !important;
}

/* サイズ欄を見えるように */
.item-row select {
    min-width: 160px !important;
    display: inline-block !important;
}

/* 個数 */
.item-row input[type="number"] {
    width: 60px !important;
}

/* ラベル */
.item-row label {
    min-width: 120px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* 追加ボタン（小さく・UIっぽく） */
.btn-add {
    width: auto;
    padding: 6px 10px;
    font-size: 13px;
    background-color: #3498db; /* 青 */
    border-radius: 5px;
}

/* ホバー */
.btn-add:hover {
    background-color: #2980b9;
}

/* 削除ボタン（控えめ赤） */
.btn-remove {
    width: auto;
    padding: 6px 10px;
    font-size: 13px;
    background-color: #e74c3c;
    border-radius: 5px;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.item-sub-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notice-box {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #856404;
    border-radius: 5px;
}

@media (max-width: 600px) {

  .form-row.name-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
  }

  .form-row.name-row .form-group {
    flex: 1;
  }

}