/* リセットCSS (基本的なスタイルを初期化) */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}
.red { color: #D90000;}

@media (min-width: 769px) {
    #contents{
        width: 1080px;
        margin: 30px auto 0; /* 中央寄せ */
    }
}

/* フォーム全体 */
.booking-form {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* 各セクションの共通スタイル */
    margin-bottom: 40px;
    /* Default: show only grey ring using first path as stroked circle */
    .radio-card-icon .icon-default { display:block; }
    .radio-card-icon .icon-default path { display: none !important; }
    .radio-card-icon .icon-default path:nth-of-type(1) { display: block !important; fill: none !important; stroke: #bfbfbf !important; stroke-width: 3px !important; stroke-linecap: round !important; stroke-linejoin: round !important; }
    .radio-card-icon .icon-checked { display:none; }
    display: flex;
    .radio-card-input:checked + .radio-card-body .radio-card-icon .icon-default { display: none !important; }
    .radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked { display:block !important; }
    .radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked path { display: none !important; }
    .radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked path:nth-of-type(1) { display: block !important; fill: none !important; stroke: #00306d !important; stroke-width: 3px !important; stroke-linecap: round !important; stroke-linejoin: round !important; }
    .radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked path:nth-of-type(3) { display: block !important; fill: #00306d !important; stroke: none !important; }
    justify-content: space-between;
    align-items: flex-end; /* タイトルと所要時間/凡例を下に揃える */
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.booking-label-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.booking-heading {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.booking-required {
    background-color: #D90000; 
    color: #fff; 
    font-size: 0.7em;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 0px; /* 角丸 */
    white-space: nowrap;
}

/* 所要時間 */
.booking-duration {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
}

/* ================================================================
   日付選択セクション
   ================================================================ */
.calendar-display {
    overflow-x: auto; /* 常に横スクロール可能 */
    -webkit-overflow-scrolling: touch; /* iOSの滑らかなスクロール */
    margin-bottom: 20px; /* Notesとの間にスペース */
    padding-left: 0; /* 左右の余白をなくす */
    padding-right: 0; /* 左右の余白をなくす */
}

.calendar-list {
    display: flex;
    flex-wrap: nowrap; /* アイテムが折り返さないようにする */
    width: auto; /* flexアイテムに幅を任せる */
    padding-bottom: 10px; /* スクロールバーのためのスペース */
}

/* 個々の日付アイテム */
.calendar-item {
    flex-shrink: 0; /* アイテムが縮小しないようにする */
    box-sizing: border-box;
    text-align: center;
    margin-right: 1px; /* アイテム間の隙間を狭く */
    width: calc((100% - (2px * 13)) / 14); /* 14等分し、マージンを考慮した幅 */
    min-width: 70px; /* 各日付アイテムの最小幅を設定 (フォントサイズに合わせて調整) */
}

.calendar-list .calendar-item:last-child {
    margin-right: 0;
}

.calendar-item-button { /* リンクの代わりにボタンを使用 */
    display: block;
    height: 100%;
    width: 100%; /* 親要素の幅いっぱいに広げる */
}

.calendar-item-content {
    border: 1px solid #ccc;
    padding: 5px 3px; /* 上下左右のパディングをさらに調整 */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* 子要素の幅を親に合わせる */
    justify-content: space-between; /* 縦方向の要素を均等に配置 */
    height: 85px; /* アイテムの高さ固定 (フォントサイズに合わせて調整) */
    background-color: #fff;
    position: relative;
    transition: all 0.2s ease-in-out; /* ホバー/選択時のアニメーション */
}

.calendar-item-content.is-selected {
    border-color: #00306d; /* 選択時のボーダー色 */
    background-color: #edfbff; /* 選択時の背景色 */
}

@media (min-width: 769px) {
    .calendar-item-button:hover .calendar-item-content {
        background-color: #edfbff; /* ホバー時の背景色を薄いオレンジに */
        border-color: #00306d; /* ホバー時のボーダー色をオレンジに */
        cursor: pointer;
    }
}
.calendar-item-content[data-status="tel"] { /* TELの日付のスタイル */
    cursor: default; /* クリック不可のためカーソルをデフォルトに */
}
@media (min-width: 769px) {
    .calendar-item-content[data-status="tel"]:hover { /* TELの日付のホバー効果をなし */
        background-color: #fff;
        border-color: #ccc;
    }
}


.calendar-dayofweek {
    font-size: 11px; /* フォントを小さく */
    color: #666;
    margin-bottom: 2px;
    text-align: left; /* 左揃え */
    padding-left: 2px; /* 微調整 */
    line-height: 1.5;
}

.calendar-date-display {
    font-size: 1.0em; /* フォントを小さく */
    font-weight: bold;
    color: #333;
    line-height: 1.1em; /* 行高さを調整 */
    text-align: center; /* 中央揃え */
}

/* カレンダー下部の注釈 */
.calendar-notes {
    font-size: 0.75em; /* フォントを小さく */
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px; /* 隙間を小さく */
}

.note-icon { display:inline-block; font-weight:bold; }
.note-icon--circle { color:#00306d; }
.note-icon--square { color:#00306d; }
.note-icon--tel { color:#666; }
.note-phone-number { white-space:nowrap; }

/* 時間選択 */
.time-selection-grid { overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:10px; }
.time-tags-list { display:flex; flex-wrap:wrap; gap:8px; }
.time-tag-button { background-color:#f8f8f8; border:1px solid #ccc; padding:6px 10px; border-radius:30px; font-size:0.9em; color:#333; transition:background-color .3s, border-color .3s; flex-shrink:0; min-width:70px; box-sizing:border-box; text-align:center; }
@media (min-width:769px) { .time-tag-button:hover:not(.is-disabled){ background-color:#e0e0e0; border-color:#999; } }
.time-tag-button.is-selected{ background-color:#00306d; color:#fff; border-color:#00306d; }
.time-tag-button.is-disabled{ background-color:#f0f0f0; color:#ccc; border-color:#e0e0e0; cursor:not-allowed; opacity:0.6; }

/* ラジオカード */
.meeting-spot-options { display:flex; flex-direction:column; gap:12px; }
.radio-card { display:block; cursor:pointer; }
.radio-card-input { display:none; }
.radio-card-body { display:flex; align-items:center; border:1px solid #ccc; padding:10px; border-radius:4px; transition:border-color .3s, background-color .3s; background-color:#fff; }
.radio-card-input:checked + .radio-card-body { border-color:#00306d; background-color:#fff; color:#333; }
.radio-card-input:checked + .radio-card-body .spot-name, .radio-card-input:checked + .radio-card-body .spot-detail { color:#333; }
.radio-card-icon { flex-shrink:0; width:24px; height:24px; margin-right:10px; position:relative; }
.radio-card-icon svg { position:absolute; top:0; left:0; width:100%; height:100%; }
/* default: show only grey ring */
.radio-card-icon .icon-default { display:block; }
.radio-card-icon .icon-default path { fill: none !important; stroke: #ccc !important; }
.radio-card-icon .icon-default path:nth-of-type(3) { display: none !important; }
.radio-card-icon .icon-checked { display:none; }
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked { display:block; }
/* When checked, hide the default icon to avoid double outer ring */
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-default { display: none !important; }
/* when checked: outer ring becomes #00306d and a filled circle appears */
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-default path { stroke: #00306d !important; fill: none !important; }
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-default path:nth-of-type(3) { display: none !important; }
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked path { display: none !important; }
.radio-card-input:checked + .radio-card-body .radio-card-icon .icon-checked path:nth-of-type(3) { display: block !important; fill: #00306d !important; stroke: none !important; }

/* カレンダー内の ○／▲ を確実に #00306d にする */
.status-available { color: #00306d; }
.status-unavailable { color: #00306d; }
.icon-circle-svg circle, .icon-triangle-svg path { stroke: #00306d !important; fill: none !important; }
.radio-card-content { flex-grow:1; }
.spot-name{ font-weight:bold; color:#333; display:block; margin-bottom:2px; font-size:0.95em; }
.spot-name span{ font-weight:normal; }
.spot-detail{ font-size:0.8em; color:#666; }

/* submit button */
.submit-button-group{ text-align:center; margin-top:30px; }
.submit-button{ background-color:#00306d; color:#fff; padding:12px 25px; border-radius:4px; font-size:1em; font-weight:bold; width:100%; max-width:250px; box-sizing:border-box; transition:background-color .3s; }
@media (min-width:769px){ .submit-button:hover{ background-color:#e06b00; } }

/* 郵便番号の住所選択ボタン */
.zip_btn {
    color: #fff;                /* 文字色を白に */
    background-color: #00306d; /* ボタン背景をサイト色に合わせる */
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-block;
}
.zip_btn:hover { background-color: #00244a; }

@media (max-width:768px){
    form{ width:95%; margin:auto; }
    .booking-form{ padding:15px; }
    .booking-label-group{ flex-direction:column; align-items:flex-start; gap:5px; }
    .booking-heading{ font-size:1.1em; }
    .booking-required, .booking-duration{ font-size:0.75em; }
    .calendar-item{ min-width:70px; }
    .calendar-list{ width:calc((70px + 2px) * 14); padding-bottom:10px; }
    .time-tag-button{ min-width:60px; padding:8px 10px; font-size:0.85em; width:auto; }
    .submit-button{ padding:10px 15px; font-size:0.9em; }
}

/* フロー（ステップバー） */
.flow-container { display:flex; justify-content:space-between; width:100%; background-color:#fff; border-radius:0px; overflow:hidden; margin-bottom:30px; }
.flow-step { flex:1; padding:10px 10px; text-align:center; color:#333; background-color:#fff; border:1px solid #00306d; border-right:none; position:relative; display:flex; flex-direction:row; align-items:center; justify-content:center; font-weight:bold; cursor:default; transition:background-color .3s ease, color .3s ease, border-color .3s ease; border-radius:0 !important; }
.flow-step:last-child { border-right:1px solid #00306d; }
.flow-step:not(:last-child)::after { content:''; position:absolute; right:-14px; top:50%; transform:translateY(-50%); width:0; height:0; border-top:calc(10px + 15px) solid transparent; border-bottom:calc(10px + 15px) solid transparent; border-left:15px solid #fff; z-index:1; transition:border-left-color .3s ease; }
.flow-step:not(:first-child)::before { content:''; position:absolute; left:-1px; top:0; bottom:0; width:1px; background-color:#00306d; z-index:2; }
.flow-step.active { background-color:#00306d; color:#fff; border-color:#00306d; }
.flow-step.active::after { border-left-color:#00306d; }
.flow-step.active + .flow-step { border-left:none; }
.flow-container .flow-step:not(.active) { background-color:#fff; color:#333; border-color:#00306d; }
.flow-container .flow-step:not(.active) .step-number { background-color:#00306d; color:#fff; }
.step-number { width:30px; height:30px; background-color:#00306d; color:#fff; border-radius:0; display:flex; justify-content:center; align-items:center; font-size:1.1em; margin-right:10px; margin-bottom:0; transition:background-color .3s ease, color .3s ease; }
.flow-step.active .step-number { background-color:#fff; color:#00306d; }
.step-text { font-size:0.9em; white-space:nowrap; line-height:1.3; }
form.mailForm .clearfix[style*="display:flex"] {
    gap: 20px;
    justify-content: center;
}
form.mailForm .clearfix[style*="display:flex"] > div {
    width: 400px;
    max-width: 400px;
    box-sizing: border-box;
}
/* set button widths and reverse order using attribute selectors to limit scope */
form.mailForm .clearfix[style*="display:flex"] button[onclick^="backForm("] {
    order: -1;
}
form.mailForm .clearfix[style*="display:flex"] button[onclick^="backForm("] ,
form.mailForm .clearfix[style*="display:flex"] button[onclick^="sendForm("] {
    width: 100% !important;
}

/* Scoped styles for reserve_confirm.php bottom buttons to avoid global impact */
#reserve_confirm_buttons {
    gap: 20px;
    justify-content: center;
    display: flex;
    align-items: center;
}
#reserve_confirm_buttons > div {
    width: 400px;
    max-width: 400px;
    box-sizing: border-box;
}
#reserve_confirm_buttons > div:first-child { order: -1; }
#reserve_confirm_buttons button { width: 100% !important; }

