@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&family=Noto+Sans+JP:wght@300;400;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #9333ea;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --free-color: #64748b;
    --paid-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    /* ⚠️ 横並びの flex にすると、子の min-width: auto が効いて
       画面幅より縮まなくなり、スマホで横にはみ出す。
       縦方向にして中央寄せする。 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 800px;
    /* flex の子が内容に押し広げられないようにする */
    min-width: 0;
}

.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

header {
    margin-bottom: 2.5rem;
    text-align: center;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #4f46e5, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

input[type="file"] {
    padding: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Selection Panels */
.selection-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.panel-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.panel-btn:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.panel-icon {
    font-size: 3rem;
    line-height: 1;
}

.panel-btn h2 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.panel-btn p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.feature-list {
    text-align: left;
    width: 100%;
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-main);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: auto;
}

.feature-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-list li::before {
    content: '✓';
    color: var(--primary);
    font-weight: bold;
}

.panel-btn.free .feature-list li::before {
    color: var(--free-color);
}

.panel-btn.free:hover {
    border-color: var(--free-color);
}

.panel-btn.paid {
    border-color: rgba(245, 158, 11, 0.2);
}

.panel-btn.paid:hover {
    border-color: var(--paid-color);
    background: rgba(245, 158, 11, 0.02);
}

.panel-btn.paid h2 {
    color: #b45309;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.btn-reset-plan {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
}

/* Flatpickr 100% Width */
.flatpickr-calendar.inline {
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
}

.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days,
.dayContainer {
    width: 100% !important;
    max-width: none !important;
    min-width: unset !important;
}

.flatpickr-day {
    max-width: none !important;
    flex-basis: 14.28% !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Confirm Page */
.confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.confirm-table th,
.confirm-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.95rem;
}

.confirm-table th {
    width: 30%;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0,0,0,0.02);
}

.confirm-table td {
    color: var(--text-main);
    line-height: 1.6;
}

/* Form Header */
.form-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-debug {
    font-size: 0.7rem;
    padding: 4px 8px;
    cursor: pointer;
    background: #e2e8f0;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

/* Field helpers */
.field-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.date-preview {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.mb-1 {
    margin-bottom: 1rem;
}

/* Confirm actions */
/* ステップ間の「戻る / 次へ」 */
.step-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    margin-top: 2.5rem;
    align-items: stretch;
}

.step-actions .btn-submit {
    margin-top: 0;
}

@media (max-width: 640px) {
    .step-actions {
        grid-template-columns: 1fr;
    }
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    margin-top: 3rem;
    align-items: stretch;
}

.confirm-actions form {
    margin: 0;
}

.confirm-actions .btn-submit {
    margin-top: 0;
}

.confirm-thumb {
    max-width: 200px;
    border-radius: 8px;
    /* 余白の色（#f7f7f7）が背景と近いので、正方形に整えたことが
       分かるように輪郭を出す。 */
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 0.4rem;
}

.loading-text {
    font-weight: 600;
    color: var(--primary);
}

/* Status pages (thanks / error) */
.text-center {
    text-align: center;
}

.form-card.text-center {
    padding: 4rem 2rem;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.status-text {
    color: var(--text-muted);
    line-height: 1.8;
    margin: 1rem 0 2.5rem;
}

.status-note {
    font-size: 0.9rem;
}

.btn-inline {
    display: inline-block;
    width: auto;
    padding: 1rem 3rem;
    text-decoration: none;
}

/* 進行ステータスバー */
.progress {
    display: flex;
    align-items: center;
    list-style: none;
    margin-bottom: 2.5rem;
    counter-reset: step;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ステップ同士をつなぐ線 */
.progress-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    min-width: 1.5rem;
    margin: 0 0.75rem;
    background: var(--border);
}

.progress-step:not(:last-child) {
    flex: 1;
}

.progress-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.progress-step.is-current {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.is-current .progress-mark {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.progress-step.is-done {
    color: var(--text-main);
}

.progress-step.is-done .progress-mark {
    background: var(--primary);
    color: white;
}

.progress-step.is-done:not(:last-child)::after {
    background: var(--primary);
}

/* 開催日の入力行 */
.date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ⚠️ ここは input[type="text"] を指していたが、markup は type="date"。
      どのセレクタも当たらず、日付欄が幅を持たないまま表示されていた。 */
.date-row input[type="date"] {
    flex: 1;
    min-width: 0;
    /* 欄のどこを押してもカレンダーが開く（form.js）ので、押せることを示す */
    cursor: pointer;
}

.date-sep {
    color: var(--text-muted);
    flex-shrink: 0;
}

.btn-remove-row {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-row:hover:not(:disabled) {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.btn-remove-row:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-add-period {
    margin-top: 0.25rem;
    padding: 0.6rem 1.25rem;
    border: 1px dashed var(--primary);
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-period:hover {
    background: rgba(79, 70, 229, 0.12);
}

@media (max-width: 640px) {
    .form-card {
        padding: 2rem 1.25rem;
    }

    .confirm-actions {
        grid-template-columns: 1fr;
    }

    .confirm-table th,
    .confirm-table td {
        display: block;
        width: 100%;
    }

    .confirm-table th {
        border-bottom: none;
        padding-bottom: 0.25rem;
    }

    .progress-label {
        display: none;
    }

    .progress-step.is-current .progress-label {
        display: inline;
    }

    .date-row {
        flex-wrap: wrap;
    }

    .date-row input[type="date"] {
        flex: 1 1 40%;
    }
}

@media (max-width: 640px) {
    .selection-view {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================
   v2 で追加した要素
   =========================================================== */

/* ⚠️ honeypot。見えてしまうと実ユーザーが入力し、申込が黙って捨てられる。
   display:none だと一部のボットに検知されるため、画面外へ追い出す。 */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* 掲載予定日の帯 */
.notice-band {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 0 24px;
    text-align: center;
}
.notice-lead { margin: 0; font-size: 15px; color: #3730a3; }
.notice-lead strong { font-size: 18px; }
.notice-sub { margin: 4px 0 0; font-size: 13px; color: #6366f1; }

.release-hint {
    background: #eef2ff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #3730a3;
    margin: 0 0 20px;
}

/* プランパネルの金額 */
.panel-price {
    font-size: 15px;
    font-weight: 700;
    margin: 4px 0 8px;
    color: #4f46e5;
}
.panel-btn.paid .panel-price { color: #d97706; }
.panel-note {
    font-size: 12px;
    color: #78716c;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px dashed #e7e5e4;
}
.selection-view .panel-btn { display: flex; flex-direction: column; }
.selection-view .feature-list { margin-top: auto; }

/* 受付期間外のプランパネル
   ⚠️ .panel-btn.paid:hover などと詳細度が同じ (0-3-0) なので、必ずこの位置より後ろに置く。 */
.panel-btn.is-closed {
    background: #f5f5f4;
    border-color: var(--border);
    cursor: not-allowed;
    filter: grayscale(1);          /* 📄 ✨ の絵文字も灰色になる */
    opacity: 0.65;
}
.panel-btn.is-closed:hover {       /* .free:hover / .paid:hover を打ち消す */
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}
.panel-btn.is-closed h2,
.panel-btn.is-closed .panel-price { color: var(--text-muted); }

.panel-closed-badge {
    margin-top: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

/* 受付停止中の帯（.notice-band の琥珀版） */
.notice-band.is-closed { background: #fef3c7; border-color: #fcd34d; }
.notice-band.is-closed .notice-lead { color: #92400e; }
.notice-band.is-closed .notice-sub  { color: #b45309; }
.notice-open { margin: 8px 0 0; font-size: 15px; color: #92400e; }
.notice-open strong { font-size: 22px; }

/* 受付カレンダー */
.calendar-section { margin-top: 32px; }
.calendar-section h3 { font-size: 15px; margin: 0 0 6px; }
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}
.calendar-table th,
.calendar-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eceff2;
    text-align: left;
}
.calendar-table thead th {
    background: #f4f5f7;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}
.cal-open { color: #047857; font-weight: 600; }
.cal-closed { color: #9ca3af; }
.cal-closed-row { background: #fafafa; color: #9ca3af; }

/* 開催日の行 */
.date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.date-row input[type=date] {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #d6d9de;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
.date-sep { color: #9ca3af; flex-shrink: 0; }
.btn-remove-row {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.btn-remove-row:hover { color: #dc2626; border-color: #fca5a5; }
.btn-add-period {
    background: #fff;
    border: 1px dashed #a5b4fc;
    color: #4f46e5;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.date-preview { font-size: 13px; color: #4f46e5; margin: 8px 0 0; }
.image-preview { font-size: 13px; color: #059669; margin: 6px 0 0; }

/* アップロード済み画像のサムネイル（banner.php）。
   ⚠️ .image-preview は元々「ファイル名（KB）」の1行を出すための箱で、
      img の大きさを縛る指定がなかった。サーバー側で 1280×1280 に整えるため、
      「修正する」で戻ってきたときに原寸で表示され、画面を埋めていた。
      確認画面の .confirm-thumb と同じ見せ方に揃える。 */
.image-preview img {
    display: block;
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-top: 6px;
    border-radius: 8px;
    /* 余白の色（#f7f7f7）が背景と近いので、正方形に整えたことが
       分かるように輪郭を出す。 */
    border: 1px solid var(--border);
}

/* 有料オプションのグループ */
.option-group {
    border: 1px solid #eceff2;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}
.option-group h4 {
    margin: 0 0 4px;
    font-size: 13px;
    color: #4f46e5;
    font-weight: 700;
}
.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 14px;
}
.radio-item input { margin-top: 3px; flex-shrink: 0; }

/* 完了画面の金額 */
.amount-lead { font-size: 14px; color: #57534e; margin: 16px 0; }
.amount { font-size: 26px; color: #d97706; }
.btn-pay { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.note-inline { font-size: 12px; color: #78716c; }

/* 警告 */
.alert-warn {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-warn ul { margin: 6px 0 0; padding-left: 20px; }

/* 確認画面の注告。
   送信ボタンの直前に置くもので、読み飛ばされると取り返しがつかない
   （送信後は内容を直せない）。他の警告より一段強く見せる。 */
.confirm-warn {
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 24px 0 20px;
    font-size: 15px;
    line-height: 1.8;
}
.confirm-warn-title {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    color: #7c2d12;
}
.confirm-warn ul { margin: 0; padding-left: 20px; }
.confirm-warn li + li { margin-top: 8px; }
.confirm-warn .note-inline { display: block; color: #a16207; }

.confirm-agree { margin: 16px 0; }
.row-highlight { background: #fffbeb; }

/* ===========================================================
   スマホ表示
   =========================================================== */

/* 横に広くなりうるものは、自分の中でスクロールさせる。
   ページ本体を横スクロールさせないため。 */
.calendar-section,
.confirm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.calendar-table { min-width: 320px; }

/* 長い URL やメールアドレスで押し広げられないように */
.form-card,
.confirm-table td,
.status-text {
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    body { padding: 1rem 0.75rem; }

    .form-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .notice-band { padding: 12px 14px; }
    .notice-lead { font-size: 14px; }
    .notice-lead strong { font-size: 16px; }

    .panel-btn { padding: 1.5rem 1.25rem; }

    .calendar-table th,
    .calendar-table td { padding: 6px 8px; font-size: 12px; }

    /* 開催日の行は縦に積む。横並びだと日付欄が潰れて操作できない。 */
    .date-row { flex-wrap: wrap; gap: 6px; }
    .date-row input[type=date] { flex: 1 1 100%; }
    .date-sep { display: none; }
    /* ⚠️ 30px 角では指の当たり判定に足りない。44px まで広げる。 */
    .btn-remove-row { margin-left: auto; width: 2.75rem; height: 2.75rem; }
    .btn-add-period { padding: 0.85rem 1.25rem; }
    /* 文字だけのリンクなので、上下に余白を足して押せる高さにする */
    .btn-reset-plan { display: inline-block; padding: 0.5rem 0; }

    .form-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* 指で押しやすい大きさにする */
    .checkbox-item,
    .radio-item { padding: 10px 0; }
    .btn-submit { padding: 0.9rem 1rem; width: 100%; }
}
/* ===========================================================
   利用規約 / 特定商取引法に基づく表記
   =========================================================== */

.legal-page { max-width: 760px; }
.legal-page h1 { font-size: 1.4rem; margin-bottom: 1.5rem; }
.legal-page h2 {
    font-size: 1rem;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.legal-lead { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.legal-list { margin: 0; padding-left: 1.4rem; font-size: 0.9rem; line-height: 1.9; }
.legal-list > li { margin-bottom: 0.6rem; }
.legal-list ul { margin: 0.4rem 0; padding-left: 1.2rem; }
.legal-list ul li { margin-bottom: 0.2rem; }

.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.legal-table th,
.legal-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    line-height: 1.8;
}
.legal-table th {
    width: 11rem;
    color: var(--text-muted);
    font-weight: 600;
    background: #fafbfc;
}
@media (max-width: 640px) {
    .legal-table th,
    .legal-table td { display: block; width: 100%; }
    .legal-table th { border-bottom: none; padding-bottom: 0.3rem; }
    .legal-table td { padding-top: 0; }
}

/* 未設定の項目は目立たせる。空欄のまま公開されるのを防ぐため。 */
.legal-table .unset {
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.legal-calendar { margin-top: 0.6rem; font-size: 0.82rem; }
.legal-calendar th { width: auto; background: #f4f5f7; padding: 6px 10px; }
.legal-calendar td { padding: 6px 10px; }

.legal-footer { margin-top: 2.5rem; text-align: center; font-size: 0.88rem; }
.legal-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.legal-links a { color: var(--text-muted); }
/* 入力ブロック（申込者情報・イベント情報など）

   markup は fieldset に class="block" を付けている。
   legend は枠線の上に載るので、背景をカードと同じ色にして
   線を切り、見出しとして読めるようにする。 */
.block {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.5rem;
    margin-bottom: 1.75rem;
    background: rgba(255, 255, 255, 0.55);
}

.block legend {
    margin-left: 0.25rem;
    padding: 0 0.6rem;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    color: var(--primary);
}
.block .field:last-child { margin-bottom: 0; }

/* ブロック全体への説明。直下の入力とくっつくと、
   その入力だけの注記に見えてしまう。 */
.block > .field-note { margin-bottom: 1.25rem; }

/* 入力ひとつ分 */
.field { margin-bottom: 1.5rem; }

/* 「必須」バッジ */
.req {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* チェックボックスの並び */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* 有料プランのブロックだけ、無料と区別がつくようにする */
.premium-block {
    border: 1px dashed var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

/* 利用規約への同意 */
.terms-block {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.85);
}
.terms-block .checkbox-item {
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

/* 戻るボタン（各ステップの「戻る」と、確認画面の「修正する」） */
.btn-back {
    background: var(--text-muted);
    /* ⚠️ a 要素なので、指定しないとリンク色のままになり、
       濃いグレーの背景に対して読めなくなる。 */
    color: #fff;
    /* ⚠️ .btn-submit と同じ 12px。隣に並べる（.step-actions / .confirm-actions は
       2 列グリッド）ので、片方だけ角が立っていると揃って見えない。 */
    border-radius: 12px;
    box-shadow: none;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ⚠️ 縦幅を 2 列グリッドの stretch（.btn-submit の高さ）に頼っていた。
       640px 以下で 1 列に落ちると隣がいなくなり、文字の高さだけの
       薄いボタンになって指で押せなかった。自前で高さを持たせる。 */
    padding: 1rem;
    min-height: 3.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.btn-back:hover { background: var(--text-main); box-shadow: none; }

/* 補足（特商法・利用規約の表内で使う） */
.sub {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
}

@media (max-width: 600px) {
    .block { padding: 1.25rem 1rem; }
    .field { margin-bottom: 1.75rem; }
    .checkbox-grid { grid-template-columns: 1fr; }
}
