/* カイエツアー予約システム - スタイル (SPEC §12 準拠) */
/* カラーパレット: 濃い青→薄い青のグラデーションで統一
   - deep-navy:  #1e3a8a   (濃紺)
   - royal:      #1d4ed8
   - blue-500:   #3b82f6
   - sky-400:    #38bdf8
   - sky-300:    #7dd3fc
   - sky-100:    #e0f2fe
   - sky-50:     #f0f9ff
*/

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    /* さりげない横グラデ: 左はほぼ白、右にかけて淡い水色 */
    background: linear-gradient(90deg, #ffffff 0%, #f8fbff 40%, #e0f2fe 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* 埋め込みモード (iframe内) では背景透明にして親ページと馴染ませる */
html.embed, html.embed body {
    background: transparent;
    min-height: 0;
}
html.embed .container {
    margin: 0 auto;
    padding: 16px;
}

a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── レイアウト ────────────────────────────────── */
.container {
    max-width: 720px;
    margin: 24px auto;
    padding: 0 16px;
}

.site-header {
    padding: 20px 16px;
    /* 濃紺 → ロイヤル → ブルー */
    background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(30, 58, 138, 0.35);
    position: relative;
    overflow: hidden;
}
.site-header::after {
    content: "";
    position: absolute;
    top: -50%; right: -20%;
    width: 50%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.site-header h1 { margin: 0; font-size: 1.3rem; letter-spacing: 0.02em; position: relative; z-index: 1; }
.site-header h1 a { color: #fff; text-decoration: none; }

.site-footer {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* ─── カード・セクション ───────────────────────── */
.card, .step {
    background: #fff;
    border: 1px solid #e0f2fe;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.12);
}

.step h2 {
    margin-top: 0;
    font-size: 1.35rem;
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1e3a8a;
}

.muted { color: #64748b; font-size: 0.95rem; }
.hint  { color: #64748b; font-size: 0.85rem; margin: 4px 0 0; }
.error { color: #b91c1c; font-size: 0.9rem; margin: 4px 0; }

/* ─── プライベートモードバナー (SPEC §13) ─── */
.private-banner {
    background: linear-gradient(90deg, #fce7f3 0%, #fbcfe8 100%);
    color: #831843;
    border-left: 4px solid #ec4899;
    padding: 10px 14px;
    margin: 0 0 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
    box-shadow: 0 1px 4px rgba(190, 24, 93, 0.12);
}
.private-banner strong { color: #be185d; letter-spacing: 0.02em; }

/* ─── ボタン ───────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #e2e8f0;
    color: #1f2937;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
}
.btn:hover { opacity: 0.92; }
.btn-primary {
    /* 濃 → 薄 */
    background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(30, 64, 175, 0.4);
    font-weight: 500;
}
.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(30, 64, 175, 0.5);
    transform: translateY(-1px);
}
.btn-lg { font-size: 1.1rem; padding: 14px 32px; }
.btn-sm { font-size: 0.85rem; padding: 6px 12px; }
.btn-link {
    background: transparent;
    color: #1d4ed8;
    border: none;
    padding: 6px 0;
    box-shadow: none;
}
.btn-link:hover { text-decoration: underline; transform: none; box-shadow: none; opacity: 1; }
.btn.disabled, .btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}

/* ─── ツアー選択 ───────────────────────────────── */
.tour-list { display: grid; gap: 12px; }
.tour-card {
    display: block;
    border: 2px solid #e0f2fe;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #fff;
}
.tour-card:hover { border-color: #7dd3fc; transform: translateY(-1px); }
.tour-card:has(input:checked) {
    border-color: #1d4ed8;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.22);
}
.tour-card input[type="radio"] { margin-right: 8px; accent-color: #1d4ed8; }
.tour-card-header { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tour-cat {
    display: inline-block;
    background: linear-gradient(120deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    padding: 6px 18px;
    border-radius: 18px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.3);
}
.tour-desc { margin: 8px 0; color: #475569; font-size: 0.95rem; }
.tour-note { color: #b45309; font-size: 0.85rem; }
.tour-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; margin: 8px 0 0; }
.tour-meta dt { color: #64748b; }
.tour-meta dd { margin: 0; }

/* ─── カレンダー ───────────────────────────────── */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.calendar-title { font-weight: 600; font-size: 1.1rem; color: #1e3a8a; }

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
.calendar-grid th, .calendar-grid td {
    width: 14.28%;
    border: 1px solid #e0f2fe;
    padding: 0;
    vertical-align: middle;
    height: 54px;
}
/* 非クリック日 (過去/満席/空日) の日付を上寄せではなく中央に揃える */
.calendar-grid td > .day-num { padding: 0; }
.calendar-grid th {
    padding: 6px;
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
    font-weight: 500; color: #1e3a8a;
    height: auto;
}
.calendar-grid th.sun,  .calendar-grid td.sun  .day-num { color: #dc2626; }
.calendar-grid th.sat,  .calendar-grid td.sat  .day-num { color: #2563eb; }
.calendar-grid td.past { background: #f8fafc; }
.calendar-grid td.past .day-num { color: #cbd5e1; }
.calendar-grid td.full .day-num { color: #94a3b8; }
.calendar-grid td.empty { background: #f8fafc; }
.calendar-grid td.selected { background: linear-gradient(180deg, #1d4ed8 0%, #3b82f6 100%); }
.calendar-grid td.selected .day-btn { background: transparent; color: #fff; }
.calendar-grid td.selected .day-num { color: #fff; }
.calendar-grid td.selected .day-mark { color: #fff; }

.day-form { margin: 0; height: 100%; }
.day-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.15s;
}
.day-btn:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
}
.day-btn .day-num { font-weight: 600; }
.day-mark {
    display: block;
    font-size: 1.4rem;
    line-height: 1;
    color: #16a34a;
}
.day-mark.open    { color: #16a34a; }
.day-mark.partial { color: #d97706; }
.day-mark.full    { color: #94a3b8; font-size: 1.1rem; letter-spacing: -1px; }
.day-num { display: block; padding: 6px 0; }
.legend { color: #64748b; font-size: 0.85rem; margin-top: 8px; }
.legend-mark {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
    margin: 0 4px 0 10px;
    vertical-align: -2px;
}
.legend-mark:first-child { margin-left: 0; }
.legend-mark.open    { color: #16a34a; }
.legend-mark.partial { color: #d97706; }
.legend-mark.full    { color: #94a3b8; }

/* ─── 天気・風速テーブル ───────────────────── */
.weather {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e0f2fe;
}
.weather-title {
    font-size: 1.05rem;
    color: #1e3a8a;
    margin: 0 0 6px;
}
.weather-note {
    color: #b91c1c;
    font-size: 0.9rem;
    margin: 0 0 10px;
    line-height: 1.5;
}
.weather-note strong { color: #991b1b; }
.weather-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.weather-table th, .weather-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e0f2fe;
    text-align: center;
    vertical-align: middle;
}
.weather-table th {
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
    color: #1e3a8a;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.3;
}
.weather-table th small { font-size: 0.7rem; color: #64748b; font-weight: 400; }
.weather-table td.sun { color: #dc2626; }
.weather-table td.sat { color: #2563eb; }
.weather-table .weather-icon { font-size: 1.4rem; line-height: 1; }
.weather-table .wind-ok     { color: #16a34a; font-weight: 500; }
.weather-table .wind-danger { color: #dc2626; font-weight: 700; }
.weather-table .wind-warn   { margin-left: 2px; }
.weather-table tr.wind-danger-row { background: #fef2f2; }
.weather-credit {
    color: #94a3b8;
    font-size: 0.75rem;
    margin: 8px 0 0;
}
.weather-credit a { color: #94a3b8; }

/* ─── 日時画面のセクション (日付選択後の午前/午後, 時刻) ───── */
.datetime-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0f2fe;
}
.datetime-section-title {
    font-size: 1rem;
    color: #1e3a8a;
    margin: 0 0 12px;
    font-weight: 600;
}

.period-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.period-form { margin: 0; flex: 1; min-width: 140px; }
.period-btn {
    width: 100%;
    padding: 14px;
    border: 2px solid #bfdbfe;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    font-family: inherit;
}
.period-btn:hover { border-color: #1d4ed8; background: #eff6ff; }
.period-btn.picked {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-color: #1e3a8a;
    color: #fff;
    box-shadow: 0 3px 10px rgba(30, 64, 175, 0.35);
}
.period-btn.picked .period-btn-sub { color: rgba(255,255,255,0.85); }
.period-btn.full {
    display: flex;
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
}
.period-btn-label { font-size: 1.05rem; font-weight: 600; }
.period-btn-sub   { font-size: 0.8rem; color: #64748b; }

.time-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.time-form { margin: 0; }
.time-btn {
    padding: 10px 16px;
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    background: #fff;
    color: #1e3a8a;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}
.time-btn:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    border-color: #1e3a8a;
    box-shadow: 0 3px 8px rgba(30, 64, 175, 0.3);
}
.reset-period { margin-top: 8px; }
.reset-period .btn-link { font-size: 0.85rem; }

/* ─── 人数/フォーム ─────────────────────────────── */
.counter-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid #e0f2fe;
}
.counter select {
    padding: 8px 12px; font-size: 1rem;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    background: #fff;
}
.counter select:focus { outline: 2px solid #1d4ed8; outline-offset: -2px; }

/* 交通手段(お車/送迎) */
.transport-set {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #f8fbff;
}
.transport-set legend {
    padding: 0 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e3a8a;
}
.transport-row {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px; margin: 6px 0;
    font-size: 0.95rem;
}
.transport-row input[type="radio"],
.transport-row input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: #1d4ed8;
    flex: none;
    align-self: flex-start;
    margin-top: 2px;
}
/* 送迎ラジオの右側を「送迎+宿泊先入力」1行 と ヒント を縦並びにし、
   お車側の <span>...<small>...</small></span> と同じインデントで揃える */
.transport-content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.transport-content-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.transport-row .accommodation-input,
.transport-content-line .accommodation-input {
    flex: 1 1 200px;
    padding: 6px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}
.transport-row .accommodation-input:focus,
.transport-content-line .accommodation-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.transport-note {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.form .field { margin-bottom: 16px; }
.form label {
    display: block; margin-bottom: 6px; font-weight: 500;
    color: #1e3a8a;
}
.form input[type="text"],
.form input[type="tel"],
.form input[type="email"] {
    width: 100%; padding: 10px 12px;
    border: 1px solid #bfdbfe; border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

/* ─── 確認画面 ──────────────────────────────────── */
.confirm h2 { font-size: 1.5rem; }
.confirm-list {
    display: grid; grid-template-columns: 6em 1fr; gap: 8px 16px;
    margin: 16px 0;
}
.confirm-list dt { color: #64748b; }
.confirm-list dd { margin: 0; font-weight: 500; color: #1f2937; }
.confirm .total {
    text-align: center;
    font-size: 1rem;
    padding: 16px 20px;
    margin: 16px 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #93c5fd 100%);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.25);
}
.confirm .total strong { font-size: 1.35rem; color: #fff; }
/* 確定ボタンを最重要CTAとして大きく目立たせる */
.confirm .btn-lg {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 20px auto 8px;
    font-size: 1.4rem;
    padding: 20px 36px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(30, 64, 175, 0.35);
}
.confirm .btn-lg:hover { box-shadow: 0 8px 22px rgba(30, 64, 175, 0.45); }

/* ─── 完了画面 ──────────────────────────────────── */
.done h2 {
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1e3a8a;
}
.done-id { font-size: 1.1rem; }
.done-id strong { font-size: 1.5rem; color: #1d4ed8; }
.mail-notice {
    border: 1px solid #93c5fd;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
    padding: 14px 18px;
    border-radius: 12px;
    margin: 16px 0;
}

/* ─── 戻るボタン群 ──────────────────────────────── */
.back, .back-group {
    margin-top: 16px;
}
.back-group { display: flex; flex-direction: column; gap: 4px; }
.back form { margin: 0; }

/* ─── スタート画面 (ツアー直リンク用) ──────────── */
.start {
    text-align: center;
    padding: 32px 24px;
}
.start-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.start-header .tour-cat {
    font-size: 1.5rem;
    padding: 8px 26px;
    border-radius: 24px;
}
.start-desc { color: #334155; margin: 12px 0; }
.start-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    text-align: left;
    max-width: 420px;
    margin: 20px auto;
    font-size: 0.95rem;
}
.start-meta dt { color: #64748b; }
.start-meta dd { margin: 0; }
.start-cta { margin: 20px 0 12px; }
.start-alt { font-size: 0.9rem; }

/* ─── 歓迎画面 ──────────────────────────────────── */
.welcome {
    text-align: center;
    padding: 48px 24px;
}
.welcome h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1e3a8a;
}

/* ─── モバイル対応 ──────────────────────────────── */
@media (max-width: 600px) {
    html, body { font-size: 15px; }

    .container { margin: 12px auto; padding: 0 8px; }
    html.embed .container { padding: 12px 8px; }

    .site-header { padding: 14px 12px; }
    .site-header h1 { font-size: 1.1rem; }

    .card, .step { padding: 16px 14px; border-radius: 10px; }
    .step h2 { font-size: 1.15rem; }

    /* カレンダー: 画面幅内にきれいに収める */
    .calendar-grid th, .calendar-grid td { height: 46px; }
    .calendar-grid th { padding: 4px 0; font-size: 0.85rem; }
    .day-btn { gap: 0; }
    .day-num { padding: 3px 0; font-size: 0.95rem; }
    .day-mark { font-size: 0.8rem; line-height: 1; }
    .day-mark.full { font-size: 0.7rem; }
    .calendar-nav { gap: 6px; }

    /* 天気テーブル: 文字を少し詰める */
    .weather-title { font-size: 1rem; }
    .weather-note { font-size: 0.85rem; }
    .weather-table { font-size: 0.85rem; }
    .weather-table th, .weather-table td { padding: 6px 3px; }
    .weather-table .weather-icon { font-size: 1.2rem; }
    .calendar-title { font-size: 1rem; }
    .btn-sm { font-size: 0.8rem; padding: 5px 9px; }

    /* 午前/午後・出発時刻 */
    .datetime-section { margin-top: 14px; padding-top: 14px; }
    .period-form { min-width: 120px; }
    .period-btn, .period-btn.full { padding: 10px; }
    .period-btn-label { font-size: 0.95rem; }
    .time-btn { padding: 8px 12px; font-size: 0.9rem; }

    /* 確認画面: 幅が狭いと dt/dd 横並びが詰まるので縦積み */
    .confirm-list { grid-template-columns: 1fr; gap: 2px 0; }
    .confirm-list dt { margin-top: 10px; font-size: 0.85rem; }
    .confirm-list dt:first-of-type { margin-top: 0; }
    .confirm .total { padding: 14px 16px; font-size: 0.92rem; }
    .confirm .total strong { font-size: 1.2rem; }

    .btn-lg { font-size: 1rem; padding: 12px 22px; }
    /* 確認画面の確定ボタンはモバイルでも目立たせる */
    .confirm .btn-lg { font-size: 1.2rem; padding: 16px 24px; }

    /* ツアー選択 */
    .tour-card { padding: 14px; }
    .tour-cat { font-size: 1rem; padding: 5px 14px; }

    /* スタート/歓迎画面 */
    .start { padding: 22px 14px; }
    .start-header .tour-cat { font-size: 1.2rem; padding: 6px 18px; }
    .welcome { padding: 32px 16px; }
    .welcome h2 { font-size: 1.25rem; }
}

@media (max-width: 380px) {
    .calendar-grid th, .calendar-grid td { height: 42px; }
    .calendar-grid th { font-size: 0.8rem; }
    .day-num { font-size: 0.9rem; }
    /* 午前/午後は画面幅に合わせて縦積み */
    .period-form { flex: 1 1 100%; min-width: 0; }
}
