/* 全体ベース */
.mgm-wrapper { max-width: 900px; margin: 0 auto; font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif; color: #333; background: #fff; }

/* 1. カレンダーデザイン */
.mgm-cal-header { display: flex; justify-content: space-between; align-items: center; background: #292929; border: 1px solid #292929; padding: 10px 15px; }
.month-title { font-size: 1.1rem; font-weight: bold; color: #fff; }
.nav-btn { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 5px 15px; cursor: pointer; color: #333; outline: none; }
.nav-btn:focus { outline: none; }

.mgm-cal-table { border: 1px solid #ddd; border-top: none; }
.mgm-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; border-bottom: 1px solid #ddd; font-size: 0.85rem; }
.mgm-weekdays div { padding: 12px 0; border-right: 1px solid #ddd; color: #333; background: #fff;}
.mgm-weekdays div:last-child { border-right: none; }

.mgm-weekdays .sun { background: #fff5f5; color: #d9534f; }
.mgm-weekdays .sat { background: #f0f8ff; color: #337ab7; }

.mgm-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #ddd; }
.cell { 
    aspect-ratio: 1.2; 
    border-right: 1px solid #ddd; 
    border-bottom: 1px solid #ddd; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #fff; 
    box-sizing: border-box; 
    position: relative;
}
.cell:nth-child(7n) { border-right: none; }
.cell.empty { background: #fafafa; }

.cell.sun { background: #fffafa; }
.cell.sat { background: #f9fcff; }

.cell .num { position: absolute; top: 5px; left: 6px; font-size: 0.85rem; color: #333; }

.cell .mark { font-size: 1.1rem; color: #ccc; font-weight: normal; }
.cell .mark.maru { color: #e36f6f; }
.cell .mark.sankaku { color: #e36f6f; }
.cell .mark.batsu { color: #ccc; }

.cell.active { cursor: pointer; }
.cell.active:hover { background: #f5f5f5; }

.mgm-legend { display: flex; gap: 15px; justify-content: flex-end; margin-top: 10px; font-size: 0.85rem; color: #666; }

/* 2. 時間選択デザイン */
/* ▼ ご指定のCSSを反映 */
.mgm-time-header {
    display: flex;
    align-items: center;
    background: #fff;
    margin-bottom: 1rem;
}
.time-date-title {
    font-size: 1.1rem;
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    color: #111;
}

.mgm-back-cal, .mgm-back-to-time { background: #fff; border: 1px solid #ccc; padding: 6px 15px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; margin-right: 20px; color: #333; outline: none; }
.mgm-back-cal:focus, .mgm-back-to-time:focus { outline: none; }
.mgm-time-layout { display: flex; flex-direction: column; border: 1px solid #ddd; }
.mgm-time-list { flex-grow: 1; display: flex; flex-direction: column; }
.time-row { padding: 15px 0; text-align: center; border-bottom: 1px solid #ddd; cursor: pointer; font-size: 1.1rem; background: #fff; transition: background 0.2s; color: #111;}
.time-row:last-child { border-bottom: none; }
.time-row:hover { background: #f5f5f5; }

/* 3. フォームデザイン */
.mgm-form-row { display: flex; border-bottom: 1px solid #ddd; padding: 25px 0; }
.mgm-form-row:first-child { border-top: 1px solid #ddd; }
.mgm-form-label { width: 30%; font-weight: bold; font-size: 0.95rem; padding-right: 15px; box-sizing: border-box; color: #111;}
.mgm-form-label .req { font-size: 0.8rem; margin-left: 5px; color: #d9534f;}
.mgm-form-input { width: 70%; }
.mgm-form-input input[type="text"], .mgm-form-input input[type="email"], .mgm-form-input input[type="tel"], .mgm-form-input textarea, .mgm-form-input select { 
    width: 100%; padding: 12px; border: 1px solid #ccc; background: #fff; box-sizing: border-box; font-size: 0.95rem; color: #111;
}
.mgm-form-input input::placeholder, .mgm-form-input textarea::placeholder { color: #999; }
.mgm-checkbox-group label { display: inline-block; margin-right: 15px; margin-bottom: 10px; cursor: pointer; color: #111;}

.mgm-form-actions { text-align: center; margin-bottom: 40px; }
.submit-btn { background: #333; color: #fff; border: none; padding: 15px 60px; font-size: 1.1rem; cursor: pointer; border-radius: 4px; transition: background 0.3s; outline: none; }
.submit-btn:focus { outline: none; }
.submit-btn:hover { background: #111; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* スマホ用レスポンシブ */
@media (max-width: 767px) {
    .cell { aspect-ratio: auto; height: 65px; }
    .cell .mark { font-size: 0.8rem; top: 6px; position: relative; }
    
    .mgm-form-row { flex-direction: column; padding: 15px 0; }
    .mgm-form-label { width: 100%; margin-bottom: 10px; }
    .mgm-form-input { width: 100%; }
    .mgm-time-header { flex-direction: column; gap: 10px; text-align: left; align-items: flex-start;}
    .mgm-back-cal, .mgm-back-to-time { margin-right: 0; align-self: flex-start; }
}

/* =========================================
   4. プラグイン独自要素のスタイル（上書き用）
========================================= */

/* フォントウェイト・レイアウトの基本調整 */
.mgm-wrapper { font-weight: 400; }
.mgm-wrapper h1, .mgm-wrapper h2, .mgm-wrapper h3, .mgm-wrapper h4, .mgm-wrapper h5, .mgm-wrapper h6, .mgm-wrapper .mgm-form-label { font-weight: 500 !important; }
.mgm-wrapper .time-date-title, .mgm-wrapper .month-title { font-weight: 400 !important; }
.mgm-wrapper .mgm-form-input input[type="text"], .mgm-wrapper .mgm-form-input input[type="email"], .mgm-wrapper .mgm-form-input input[type="tel"], .mgm-wrapper .mgm-form-input textarea, .mgm-wrapper .mgm-form-input select { line-height: 1.6 !important; }
.mgm-wrapper .mgm-checkbox-group label { font-size: 16px !important; }
.mgm-wrapper .mgm-cal-table { border: 1px solid #ddd; border-top: none; border-bottom: none; }
.mgm-wrapper .mgm-legend { flex-wrap: wrap; line-height: 1; margin-top: 1.5rem; }
.mgm-wrapper .mgm-time-header { margin-bottom: 2rem; }
.mgm-wrapper .mark svg { width: 16px; height: 16px; vertical-align: middle; }
.mgm-wrapper .mgm-cal-table .mark { background-color: unset !important; }

@media (max-width: 767px) {
    .mgm-wrapper .mgm-time-header { gap: 20px; }
}

/* 第2希望ステップ用のバナー */
.mgm-step-banner { padding: 15px; background: #f4f9f9; border: 1px solid #c8e1e1; margin-bottom: 20px; border-radius: 4px; text-align: center; }
.mgm-banner-date { font-weight: bold; color: #2271b1; margin-bottom: 10px; }
.mgm-banner-text { margin: 0; font-size: 14px; }

/* 予約内容の確認サマリーボックス */
.mgm-reservation-summary { padding: 20px; border-radius: 0; margin: 15px 0 30px; border: 1px solid #e2e4e7; background: #fff; }
.mgm-summary-title { margin-top: 0; margin-bottom: 15px; font-size: 16px; color: #1d2327; border-bottom: 1px solid #e2e4e7; padding-bottom: 10px; display: flex; align-items: center; font-weight: 500; }
.mgm-summary-icon { margin-right: 8px; width: 20px; height: 20px; }
.mgm-summary-event { font-weight: 500; color: #1d2327; font-size: 16px; margin-bottom: 8px; }
.mgm-summary-datetime { color: #3c434a; font-size: 15px; font-weight: 400; line-height: 1.6; }

/* 注意書きのボックス（スパム注意など） */
.mgm-notice-box { margin: 30px 0 20px; padding: 15px; background: #fdfaf0; color: #856404; border: 1px solid #f2e4b3; border-radius: 4px; font-size: 14px; line-height: 1.6; }

/* 同じ日時が選べない時の無効化スタイル */
.time-row.time-row-disabled { opacity: 0.5; pointer-events: none; background: #eee; cursor: not-allowed; }


/* =========================================
   チェックボックスの四角（ボックス）を表示するスタイル
========================================= */
.mgm-checkbox-group label {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    margin-right: 15px !important;
    gap: 5px !important; /* 四角と文字の間の隙間 */
}

/* 非表示にされてしまっていたチェックボックス本体(四角)を強制表示 */
.mgm-checkbox-group input[type="checkbox"] {
    display: inline-block !important;
    visibility: visible !important;
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

/* =========================================
   第2希望スキップボタンのデザイン
========================================= */

/* ボタンの配置（右寄せなど） */
.mgm-skip-second-wrapper {
    text-align: center;
    margin-top: 15px;
}

/* ボタン本体の基本デザイン */
.mgm-skip-second-btn {
    background-color: #ffffff;    /* 背景色（白） */
    color: #2271b1;               /* 文字色（青） */
    border: 2px solid #2271b1;    /* 枠線の太さと色 */
    padding: 8px 20px;            /* 内側の余白（上下 左右） */
    border-radius: 4px;           /* 角の丸み */
    font-size: 14px;              /* 文字サイズ */
    font-weight: bold;            /* 文字の太さ */
    cursor: pointer;              /* マウスを指マークに */
    transition: all 0.2s ease;    /* ふんわり変化させるアニメーション */
}

/* マウスを乗せた時のデザイン（ホバー） */
.mgm-skip-second-btn:hover {
    background-color: #2271b1;    /* 背景色を青に */
    color: #ffffff;               /* 文字色を白に */
}