#medical-booking-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.booking-step {
    display: none;
}

.booking-step.active {
    display: block;
}

/* ヘッダー */
.booking-header {
    background: #00bcd4;
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin: -20px -20px 20px -20px;
}

.booking-header h2 {
    margin: 0;
    font-size: 24px;
}

/* お知らせセクション */
.notice-section {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.notice-section h3 {
    margin-top: 0;
    color: #333;
}

.notice-list {
    list-style: none;
    padding: 0;
}

.notice-list li {
    padding: 10px 0;
    padding-left: 20px;
    position: relative;
}

.notice-list li:before {
    content: "■";
    position: absolute;
    left: 0;
}

.notice-list li.highlight {
    background: #fff59d;
    padding: 15px 15px 15px 35px;
    border-radius: 4px;
    margin: 10px 0;
}

/* 予約タイプ選択 */
.booking-type-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.booking-type-section h3 {
    margin-top: 0;
    color: #333;
}

.type-description {
    color: #666;
    margin-bottom: 15px;
}

.booking-btn {
    background: linear-gradient(135deg, #00bcd4 0%, #26c6da 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    transition: transform 0.2s;
}

.booking-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

/* プログレスバー */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-bar:before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.progress-item:before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    margin: 0 auto 10px;
    line-height: 40px;
    color: white;
}

.progress-item.active:before {
    background: #00bcd4;
}

.progress-item.completed:before {
    background: #4caf50;
}

/* カレンダー */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 20px;
}

.month-nav {
    background: #00bcd4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.month-nav:hover {
    background: #0097a7;
}

.calendar {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-header-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f5f5;
}

.day-header {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #e0e0e0;
}

.day-header.sunday {
    color: #dc6b3f;
}

.day-header.saturday {
    color: #2196f3;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-cell {
    background: white;
    padding: 10px;
    min-height: 80px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-cell.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-cell.unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: default;
}

.calendar-cell.available:hover {
    background: #e1f5fe;
}

.calendar-cell.full {
    background: #ffebee;
    cursor: default;
}

.date-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.availability {
    font-size: 24px;
    margin: 5px 0;
}

.availability.circle {
    color: #4caf50;
}

.availability.triangle {
    color: #ff9800;
}

.availability-text {
    background: #bdbdbd;
    color: white;
    padding: 5px;
    border-radius: 4px;
    font-weight: bold;
}

.slots-info {
    font-size: 12px;
    color: #666;
}

.unavailable-mark {
    color: #ccc;
    font-size: 20px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.circle.available {
    background: #4caf50;
}

.full-indicator {
    display: inline-block;
    background: #bdbdbd;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 80px auto 20px;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    background: #00bcd4;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white !important;
}

.close {
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-content p {
    padding: 20px;
    margin: 0;
    text-align: center;
    color: #666;
}

/* 時間スロット */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.time-slot {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.time-slot.available {
    border-color: #00bcd4;
}

.time-slot.available:hover {
    background: #e1f5fe;
    transform: translateY(-2px);
}

.time-slot.unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.circle-indicator {
    color: #4caf50;
    font-size: 20px;
}

.cross-indicator {
    color: #9ca3af;
    font-size: 20px;
}

/* フォーム */
.form-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    margin-top: 0;
    color: #00bcd4;
    border-bottom: 2px solid #00bcd4;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.required {
    color: #dc2626 !important;
    font-size: 1.2em;
    font-weight: 700;
    margin-left: 2px;
}

.required-note {
    display: block;
    font-size: 0.78em;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

/* ボタン */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.btn-back,
.btn-next,
.btn-submit {
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back {
    background: #f5f5f5;
    color: #333;
}

.btn-back:hover {
    background: #e0e0e0;
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, #00bcd4 0%, #26c6da 100%);
    color: white;
    flex: 1;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

/* 確認画面 */
.confirmation-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.confirmation-section h4 {
    color: #00bcd4;
    border-bottom: 2px solid #00bcd4;
    padding-bottom: 10px;
    margin-top: 30px;
}

.confirmation-section h4:first-child {
    margin-top: 0;
}

.confirmation-section p {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 完了画面 */
.success-message {
    text-align: center;
    padding: 60px 20px;
}

.success-message h2 {
    color: #4caf50;
    font-size: 32px;
    margin-bottom: 20px;
}

.success-message p {
    font-size: 18px;
    color: #666;
    line-height: 1.8;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-cell {
        min-height: 60px;
        font-size: 12px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-back,
    .btn-next,
    .btn-submit {
        width: 100%;
    }
}

/* ── 問診タイプ別ヘッダー ── */
.q-type-header {
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.q-type-baseline {
    background: #e0f2fe;
    color: #0369a1;
    border-left: 3px solid #0ea5e9;
}

.q-type-current {
    background: #dcfce7;
    color: #166534;
    border-left: 3px solid #22c55e;
}

.q-collapsible:hover {
    opacity: 0.85;
}

.q-type-section {
    margin-bottom: 16px;
}

.wq-combined-section {
    margin-bottom: 8px;
}

/* ── 基本情報変更ラジオトグル ── */
.baseline-change-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 4px 0 12px;
    font-size: 13px;
}

.baseline-change-toggle .toggle-label {
    font-weight: 600;
    color: #0369a1;
    margin-right: 6px;
}

.baseline-change-toggle label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #1e40af;
}

.baseline-change-toggle input[type="radio"] {
    cursor: pointer;
    accent-color: #0ea5e9;
    width: 16px;
    height: 16px;
}

/* ── セクション区切り線 ── */
.q-section-sep {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 20px 0;
}

/* ── 2カラム名前入力レイアウト ── */
.form-group-inline {
    display: flex;
    gap: 12px;
}

.form-group-inline-item {
    flex: 1;
    min-width: 0;
}

.form-group-inline-item .sub-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.form-group-inline-item input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* 性別ラジオを横並びに */
.gender-radio-group {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 16px !important;
}

@media (max-width: 480px) {
    .form-group-inline {
        gap: 8px;
    }
    .form-group-inline-item input {
        padding: 10px 8px;
    }
}

/* ── 条件問診：子質問のインデント表示 ── */
.q-item-child {
    border-left: 3px solid #bae6fd;
    padding-left: 14px;
    background: #f0f9ff;
    border-radius: 0 6px 6px 0;
    margin-left: 8px;
    transition: opacity 0.2s;
}
.q-item-child label:first-child::before {
    content: "";
}

/* ── バリデーションエラー表示（alert 代替・スマホ対応） ── */
/* 上部 sticky サマリー */
.wq-validation-summary {
    position: sticky;
    top: 8px;
    z-index: 100;
    background: #fef2f2;
    border: 2px solid #f87171;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 12px 0 18px;
    color: #991b1b;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.18);
}
.wq-validation-summary-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.wq-validation-summary-hint {
    font-size: 12px;
    color: #b91c1c;
    margin-bottom: 8px;
}
.wq-validation-summary-list {
    margin: 0;
    padding-left: 22px;
    list-style: disc;
}
.wq-validation-summary-list li {
    margin: 3px 0;
    font-size: 14px;
    line-height: 1.5;
}
.wq-validation-summary-list a {
    color: #b91c1c;
    font-weight: 600;
    text-decoration: underline;
}
.wq-validation-summary-list a:hover,
.wq-validation-summary-list a:active {
    color: #7f1d1d;
}

/* 個別フィールドの赤枠（form-group や q-item の既存レイアウトを壊さないよう padding はオフセット負担にせず box-shadow で表現） */
.wq-field-error {
    background: #fff7f7;
    box-shadow: 0 0 0 2px #fca5a5 inset;
    border-radius: 6px;
    padding: 8px 10px;
    transition: background 0.2s, box-shadow 0.2s;
}
.wq-field-error-msg {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    line-height: 1.4;
}

/* ジャンプ時のフラッシュアニメーション */
@keyframes wq-flash-anim {
    0%   { box-shadow: 0 0 0 4px #fde68a; }
    100% { box-shadow: 0 0 0 0   transparent; }
}
.wq-flash {
    animation: wq-flash-anim 1.2s ease-out;
}

/* スマホでのエラーバナー余白調整 */
@media (max-width: 600px) {
    .wq-validation-summary {
        padding: 10px 12px;
        margin: 8px 0 12px;
        font-size: 14px;
    }
    .wq-validation-summary-title { font-size: 14px; }
    .wq-validation-summary-list li { font-size: 13px; }
}
/* ──────────────────────────────────────────────────────────
 * 予約完了画面（基本情報→予約確定→ウェブ問診の分離フロー）
 * showBookingComplete() で #step-complete に書き出される
 * ────────────────────────────────────────────────────────── */
.completion-card {
    text-align: center;
    padding: 28px 20px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 580px;
}
.completion-card h2 {
    color: #166534;
    margin: 0 0 12px;
    font-size: 22px;
}
.completion-card .completion-info {
    font-size: 16px;
    line-height: 1.8;
    color: #1f2937;
    margin: 0 0 8px;
}
.completion-card hr {
    margin: 18px auto;
    border: 0;
    border-top: 1px dashed #86efac;
    max-width: 80%;
}
.completion-card .primary-btn {
    background: #0ea5e9;
    color: #fff;
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-width: 240px;
    transition: background 0.2s;
}
.completion-card .primary-btn:hover { background: #0284c7; }
.completion-card .secondary-btn {
    background: #fff;
    color: #374151;
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 16px;
    font-size: 14px;
}
.completion-card .secondary-btn:hover { background: #f9fafb; }
.completion-card .completion-note {
    margin: 16px auto 0;
    max-width: 480px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #4b5563;
    text-align: left;
    line-height: 1.7;
}

/* スロット仮押さえ無し案内 */
.slot-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #78350f;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

@media (max-width: 600px) {
    .completion-card { padding: 20px 12px; }
    .completion-card h2 { font-size: 18px; }
    .completion-card .completion-info { font-size: 14px; }
    .completion-card .primary-btn {
        width: 100%;
        min-width: 0;
        padding: 12px 16px;
        font-size: 14px;
    }
    .completion-card .completion-note { font-size: 12px; }
}
