/* =========================================================
   基本スタイル
========================================================= */
body {
    font-family: sans-serif;             /* 全体フォント */
    /* margin: 20px;                        ページ全体の余白 */
    background-color: #fff;            /* 背景：白 */
}

form {
    max-width: 700px;                    /* フォーム最大幅 */
    margin: 0 auto;                      /* 中央寄せ */
}

.form-title,
.conf-title {
    font-size: 34px;                     /* フォームタイトルの文字サイズ */
    text-align: center;                  /* 中央揃え */
    margin-bottom: 10px;                 /* 下マージン */
}

.Parentheses {
    font-size: 26px;                     /* (確認)のフォントサイズ */
}

/* ラベル不随文字 */
.sentence {
    font-size: 14px;
    font-weight: 300;
    color: #666;
}

/* =========================================================
   入力欄共通
========================================================= */
input,
select,
textarea {
    width: 100%;                         /* 横幅いっぱい */
    padding: 8px 10px;                   /* 内側余白 */
    margin-bottom: 10px;                 /* 下マージン */
    border: 1px solid #ccc;            /* 枠線 */
    border-radius: 4px;                  /* 角丸 */
    box-sizing: border-box;              /* padding込みで幅計算 */
}

/* 横並び行 */
.row {
    display: flex;
    gap: 10px;                           /* 要素間の間隔 */
}
.row input,
.row select {
    flex: 1;                             /* 均等幅 */
}

/* 主訴ラベル */
.item {
    color: #666;
    border-bottom: 1.5px solid #00bcd4;
    /*background-color: #00bcd4;         /* 水色背景 */
    font-weight: 600;                    /* 太字 */
    padding: 3px 10px;
    margin: 6px 0;
}

/* 主訴入力欄 */
.complaints {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #00bcd4;         /* 水色枠 */
    background-color: #fff;
}
.complaints input {
    width: 10%;                          /* 小さめ入力 */
    margin-bottom: 0;
}

/* 必須表示 */
.required {
    color: red;                        /* 文字色 */
    font-size: 12px;
    font-weight: 400;
}


/* =========================================================
   チェックボックス・ラジオ
========================================================= */
.checkbox-group {
    display: flex;
    flex-direction: column;              /* 縦並び */
    gap: 5px;                            /* 行間 */
    margin: 0 0 10px 10px;               /* 左マージン */
}

.checkbox-group label {
    display: flex;
    align-items: center;                 /* チェックボックスとテキスト揃え */
    gap: 5px;                            /* 間隔 */
    font-weight: normal;
}

/* チェックボックス・ラジオの右余白 */
label input[type="checkbox"],
label input[type="radio"] {
    margin-right: 5px;
}


/* =========================================================
   セクション枠
========================================================= */
.section {
    border: 2px solid #00bcd4;         /* 水色枠 */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background-color: #fff;
}

.section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #666;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

/* ラベル共通 */
label {
    font-weight: 500;
    margin-right: 10px;
}


/* =========================================================
   ボタン
========================================================= */
button {
    background-color: #00bcd4;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    display: inline-block;
}

button:hover {
    background-color: #00bcd4;
}

.button-container {
    margin-top: 20px;
    text-align: center;                  /* ボタン中央寄せ */
}

/* 確認画面ボタン */
.confirm-buttons {
    margin-top: 20px;
}
.confirm-buttons button {
    padding: 8px 16px;
    margin-right: 10px;
    cursor: pointer;
}


/* =========================================================
   テキストエリア
========================================================= */
textarea {
    min-height: 60px;
    resize: vertical;                    /* 縦方向に伸縮可能 */
}


/* =========================================================
   カスタムセレクト & 生年月日
========================================================= */
.dob-row {
    display: flex;                       /* 横並び */
    gap: 5px;
    width: 60%;
}

/* 幅を均等・任意に調整 */
.dob-row>*:nth-child(1) { width: 29%; }  /* 年ラベルなど */
.dob-row>*:nth-child(3) { width: 5%; }  /* 選択 */
.dob-row>*:nth-child(4) { width: 17%; }  /* 年プルダウン */
.dob-row>*:nth-child(5) { width: 5%; }  /* 選択 */
.dob-row>*:nth-child(6) { width: 17%; }  /* 月プルダウン */
.dob-row>*:nth-child(7) { width: 5%; }  /* 選択 */
.dob-row>*:nth-child(8) { width: 17%; }  /* 日プルダウン */
.dob-row>*:nth-child(9) { width: 5%; }  /* 自動計算/歳 */

.custom-select {
    position: relative;
    cursor: pointer;
    user-select: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.custom-select .selected {
    padding: 8px 10px;
    box-sizing: border-box;
}

.custom-select ul.options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 240px;
    max-height: 375px;
    border-radius: 16px;
    overflow-y: auto;
    margin: 0;
    padding-left: 10px;
    list-style: none;
    border: 1px solid #ccc;
    border-top: none;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    z-index: 10;
}

.custom-select ul.options li {
    padding: 5px;
}

.custom-select ul.options li:hover {
    background: #f0f0f0;
}


/* =========================================================
   カレンダー（flatpickr）
========================================================= */
/* ラベル不随文字 */
.d-date {
    font-size: 14px;
    font-weight: 400;
    color: #0299ad;
}

/* 全体幅・中央配置 */
#calendar {
    max-width: 700px;
    margin: 10px auto;
}

/* インライン表示時中央寄せ */
.flatpickr-calendar.inline {
    margin: auto;
}

/* PC表示：2か月横並び */
@media (min-width: 768px) {
    .flatpickr-calendar.multiMonth .flatpickr-months {
        display: flex !important;
        justify-content: center !important;
        gap: 20px;
    }
    .flatpickr-calendar.multiMonth .flatpickr-month {
        width: 280px !important;
    }
}

/* 月・年の見出しクリックを無効化 */
.flatpickr-current-month {
    pointer-events: none;
}

/* 月ドロップダウン調整（矢印消す・背景透明） */
.flatpickr-monthDropdown-months {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background: transparent !important;
    border: none !important;
}

/* 疑似要素の▼を非表示 */
.flatpickr-current-month .flatpickr-monthDropdown-months::after {
    display: none !important;
}

/* 背景画像を消す */
.flatpickr-current-month {
    background-image: none !important;
}


/* =========================================================
   確認画面
========================================================= */
#confirm-wrapper {
  max-width: 700px;                      /* ← 好きな幅に調整 */
  margin: 0 auto;                        /* ← 中央寄せ */
}

#confirm {
    display: none;                       /* 初期非表示 */
    border: 2px solid #2196F3;         /* 青枠 */
    border-radius: 8px;
    background-color: #e3f2fd;         /* 薄い青 */
    padding: 20px;
    margin-top: 20px;
}

#confirm div {
    margin-bottom: 8px;
}

#confirm strong {
    display: inline-block;
    width: 130px;                        /* ラベル幅揃え */
    font-weight: bold;
}


/* =========================================================
   確認画面の表示制御
   - JSで class を付け替えて表示/非表示を切り替える
========================================================= */
#confirm-wrapper {
  display: none;                         /* 初期状態：確認画面は非表示 */
}

#form.hidden {
  display: none;                         /* フォームに hidden が付いたら非表示 */
}

#confirm-wrapper.active {
  display: block;                        /* 確認画面に active が付いたら表示 */
}


/* =========================================================
   介護レベルの表示制御
   - 初期は非表示
   - JS（toggleCareLevel）で表示切替
========================================================= */
#careLevelWrap {
  display: none;
}


/* =========================================================
   メディアクエリ（SP/PC対応）
========================================================= */
@media screen and (max-width: 768px) {

    .dob-row {
   width: 100%;
}

    /* 幅を均等・任意に調整 */
.dob-row>*:nth-child(1) { width: 27%; }  /* 年ラベルなど */
.dob-row>*:nth-child(3) { width: 5%; }   /* 選択 */
.dob-row>*:nth-child(4) { width: 18%; }  /* 年プルダウン */
.dob-row>*:nth-child(5) { width: 5%; }   /* 選択 */
.dob-row>*:nth-child(6) { width: 18%; }  /* 月プルダウン */
.dob-row>*:nth-child(7) { width: 5%; }   /* 選択 */
.dob-row>*:nth-child(8) { width: 17%; }  /* 日プルダウン */
.dob-row>*:nth-child(9) { width: 5%; }   /* 自動計算/歳 */

    .sp-br {
        display: none;                   /* PCでは改行非表示 */
    }
}


@media screen and (min-width: 767px) {

    .sp-br {
        display: none;                   /* PCでは改行非表示 */
    }
}
