/* ============================================
   無料相談セクション（予約ウィジェット＋連絡先＋メールフォーム）
   sakai-sozoku.jp 紺×金テーマ。style.min.css の CSS変数を利用。
   予約バックエンドは さかがみ会計事務所 共通のGAS。
   ============================================ */

/* レイアウト */
.cc-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 3.5rem;
    align-items: flex-start;
    max-width: 1100px;
    margin: 2.5rem auto 0;
    text-align: left;
}
.contact-info-col { position: sticky; top: 100px; }

/* 連絡先カード */
.contact-channels {
    margin-top: 1.5rem;
    padding: 1.8rem;
    background: var(--bg-white);
    border: 1px solid #ececec;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}
.channel {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px dashed #e3e3e3;
}
.channel:first-child { padding-top: 0; }
.channel:last-child { border-bottom: none; padding-bottom: 0; }
.channel .ch-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #8a6d35;   /* 小さい文字のためコントラスト確保（金→濃金） */
    min-width: 44px;
    padding-top: 0.25rem;
}
.channel .ch-value { font-size: 1.05rem; font-weight: 700; color: var(--primary-color); letter-spacing: 0.02em; }
.channel .ch-value a { color: #8a6d35; text-decoration: none; }
.channel .ch-value a:hover { text-decoration: underline; }
.channel .ch-note { font-size: 0.72rem; color: var(--text-light); margin-top: 0.15rem; }

/* タブ */
.bk-tabs {
    display: inline-flex;
    background: var(--bg-light);
    border: 1px solid #e3e3e3;
    border-radius: 99px;
    padding: 4px;
    margin-bottom: 1.4rem;
    gap: 4px;
    max-width: 100%;
}
.bk-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.bk-tab.active { background: var(--primary-color); color: #fff; }
.bk-tab:hover:not(.active) { color: var(--primary-color); }
.bk-panel { display: none; }
.bk-panel.active { display: block; }

/* チップ */
.chip-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    border: 1px solid #ddd;
    background: var(--bg-white);
    color: var(--text-color);
    transition: all 0.15s;
    cursor: pointer;
    border-radius: 99px;
    font-family: inherit;
}
.chip.active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }
.chip:hover:not(.active) { border-color: var(--secondary-color); }

/* フォーム共通 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.3rem; }
.form-single { margin-bottom: 1.3rem; }
.form-block { margin-bottom: 1.3rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.5rem; }
.form-label .must, .must { color: #c0392b; }
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    background: #fbfbf9;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: 8px;
    outline: none;
    color: var(--text-color);
    transition: all 0.2s;
}
.form-input:focus { border-color: var(--secondary-color); background: #fff; box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.18); }
.form-optional-head {
    margin: 1.6rem 0 1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed #e3e3e3;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
}
.agree-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 1.6rem 0;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-color);
    line-height: 1.75;
}
.agree-row input { margin-top: 0.25rem; accent-color: var(--primary-color); flex-shrink: 0; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.bk-hp { display: none !important; }

/* 注記 */
.bk-field-note { font-size: 0.72rem; color: var(--text-light); line-height: 1.7; margin: 0.6rem 0.1rem 0; }
.bk-phone-err { font-size: 0.72rem; color: #c0392b; line-height: 1.6; margin: 0.4rem 0.1rem 0; }
.bk-note { font-size: 0.75rem; color: var(--text-light); line-height: 1.85; margin: 1rem 0.1rem 0; }
.bk-w-err { font-size: 0.8rem; color: #a32d2d; margin-top: 0.75rem; line-height: 1.7; }
.bk-w-demo { font-size: 0.72rem; color: #8a6d35; background: #fffdf4; border: 1px solid var(--accent-color); border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 1rem; line-height: 1.75; }

/* ウィジェット */
.bk-widget { min-height: 180px; scroll-margin-top: 100px; }   /* scrollIntoView時に固定ヘッダーへ隠れない */
.bk-w-lead { font-size: 0.88rem; color: var(--text-light); margin: 0 0 1rem; line-height: 1.85; }
.bk-w-load { font-size: 0.85rem; color: var(--text-light); padding: 1.6rem; text-align: center; }
.bk-w-times { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.bk-w-time {
    min-height: 44px;   /* タップしやすいサイズを確保 */
    padding: 0.55rem 1.05rem;
    border: 1px solid #ddd;
    border-radius: 99px;
    background: var(--bg-white);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.15s;
}
.bk-w-time:hover { border-color: var(--secondary-color); background: var(--bg-light); }
.bk-w-back { background: none; border: none; color: #8a6d35; font-size: 0.82rem; font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 1rem; font-family: inherit; }
.bk-w-back:hover { text-decoration: underline; }
.bk-w-chosen {
    background: var(--bg-light);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 0.8rem 1.1rem;
    margin-bottom: 1.4rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-color);
}
.bk-w-done { text-align: center; padding: 2rem 1.1rem; }
.bk-w-done .big { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.9rem; }
.bk-w-done .when { display: inline-block; background: var(--bg-light); border: 1px solid var(--accent-color); border-radius: 8px; padding: 0.5rem 1rem; font-weight: 700; color: var(--text-color); margin: 0 0 1rem; }
.bk-w-done p { font-size: 0.88rem; color: var(--text-light); line-height: 1.95; max-width: 40ch; margin: 0 auto; }

/* 月カレンダー */
.bk-cal-wrap { display: flex; gap: 1.8rem; flex-wrap: wrap; align-items: flex-start; }
.bk-cal-wrap[hidden] { display: none; }
.bk-cal {
    flex: 0 0 auto;
    width: 332px;
    max-width: 100%;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 1rem 1rem 0.75rem;
    background: var(--bg-white);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.bk-cal-title { font-weight: 700; font-size: 0.95rem; color: var(--primary-color); letter-spacing: 0.02em; font-family: var(--font-serif); }
.bk-cal-nav {
    width: 44px; height: 44px;   /* タップしやすいサイズを確保 */
    border: 1px solid #ddd; border-radius: 8px;
    background: var(--bg-white); cursor: pointer;
    font-size: 1.1rem; color: var(--primary-color);
    display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0;
}
.bk-cal-nav:hover:not(:disabled) { border-color: var(--secondary-color); background: var(--bg-light); }
.bk-cal-nav:disabled { opacity: 0.3; cursor: default; }
.bk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.bk-cal-wd { text-align: center; font-size: 0.7rem; color: var(--text-light); padding: 0.1rem 0 0.45rem; font-weight: 700; }
.bk-cal-wd:first-child { color: #c0563c; }
.bk-cal-wd:last-child { color: #3f74a8; }
.bk-cal-day {
    aspect-ratio: 1; border: none; background: none; border-radius: 9px;
    font-family: var(--font-serif); font-size: 0.9rem; color: var(--text-light);
    display: flex; align-items: center; justify-content: center; position: relative; padding: 0; cursor: default;
}
.bk-cal-day.is-empty { visibility: hidden; }
.bk-cal-day.is-disabled { color: #bbb; opacity: 0.6; }
.bk-cal-day.is-available { cursor: pointer; color: var(--primary-color); font-weight: 700; }
.bk-cal-day.is-available::after {
    content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: #8a6d35;   /* 視認性確保のため濃金 */
}
.bk-cal-day.is-available:hover { background: var(--bg-light); }
.bk-cal-day.is-selected { background: var(--primary-color); color: #fff; font-weight: 700; }
.bk-cal-day.is-selected::after { background: #fff; }
.bk-cal-side { flex: 1 1 220px; min-width: 200px; }
.bk-cal-side-date { font-size: 0.9rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.9rem; }
.bk-cal-side .bk-w-times { margin-top: 0; }
.bk-cal-hint { font-size: 0.78rem; color: var(--text-light); line-height: 1.8; margin-top: 0.3rem; }
.bk-cal-hint .bk-dot { color: #8a6d35; }

/* レスポンシブ */
@media (max-width: 900px) {
    .cc-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .contact-info-col { position: static; order: 2; }   /* モバイルは予約UIを先に表示 */
    .bk-col { order: 1; }
    .form-row { grid-template-columns: 1fr; }
    .form-input { font-size: 16px; }   /* iOSのフォーカス時自動ズーム防止 */
}
@media (max-width: 560px) {
    .bk-cal { width: 100%; }
    .bk-cal-wrap { gap: 1.25rem; }
}
