/* ==========================================================================
   WPKit Reservation Form — フロントエンドスタイル
   ========================================================================== */

/* CSS変数（管理画面から上書き可能） */
:root {
    --wpkit-primary:       #1565c0;
    --wpkit-primary-dark:  #0d47a1;
    --wpkit-primary-alpha: rgba(21, 101, 192, 0.15);
}

/* --------------------------------------------------------------------------
   ラッパー
   -------------------------------------------------------------------------- */
.wpkit-reservation-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   通知バナー
   -------------------------------------------------------------------------- */
.wpkit-res-notice {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.wpkit-res-notice--success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    color: #1b5e20;
}

.wpkit-res-notice--error {
    background: #fdecea;
    border-left: 4px solid #c62828;
    color: #b71c1c;
}

/* --------------------------------------------------------------------------
   フォーム全体
   -------------------------------------------------------------------------- */
.wpkit-res-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --------------------------------------------------------------------------
   フィールドセット
   -------------------------------------------------------------------------- */
.wpkit-res-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem 1.5rem 1rem;
    margin: 0;
}

.wpkit-res-legend {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
    color: #333;
}

/* --------------------------------------------------------------------------
   フィールド行
   -------------------------------------------------------------------------- */
.wpkit-res-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.wpkit-res-field:last-child {
    margin-bottom: 0;
}

.wpkit-res-field--privacy {
    margin: 0;
}

/* --------------------------------------------------------------------------
   ラベル
   -------------------------------------------------------------------------- */
.wpkit-res-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wpkit-res-required {
    display: inline-block;
    background: #c62828;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.1em 0.45em;
    border-radius: 3px;
    line-height: 1.5;
}

/* 必須バッジをラベルテキストの前に表示 */
.wpkit-res-label .wpkit-res-required {
    order: -1;
}

/* --------------------------------------------------------------------------
   入力・セレクト・テキストエリア 共通
   -------------------------------------------------------------------------- */
.wpkit-res-input,
.wpkit-res-select,
.wpkit-res-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.wpkit-res-input:focus,
.wpkit-res-select:focus,
.wpkit-res-textarea:focus {
    outline: none;
    border-color: var(--wpkit-primary);
    box-shadow: 0 0 0 3px var(--wpkit-primary-alpha);
}

.wpkit-res-input.is-error,
.wpkit-res-select.is-error,
.wpkit-res-textarea.is-error {
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

/* セレクトの矢印 */
.wpkit-res-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.25rem;
}

/* サイズバリエーション */
.wpkit-res-input--zip {
    flex: 0 0 140px !important;
    width: 140px !important;
    max-width: 140px !important;
}

.wpkit-res-select--sm {
    width: 140px !important;
    max-width: 140px !important;
}

.wpkit-res-input--tel {
    max-width: 280px;
}

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

/* --------------------------------------------------------------------------
   入力グループ（郵便番号 + 検索ボタン）
   -------------------------------------------------------------------------- */
.wpkit-res-input-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: nowrap;
}

/* Astra/Elementor の button スタイルを詳細度・!important で完全上書き */
.wpkit-reservation-wrap .wpkit-res-btn--zip-lookup,
.wpkit-reservation-wrap button.wpkit-res-btn--zip-lookup {
    box-sizing: border-box !important;
    width: 140px !important;
    flex-shrink: 0 !important;
    padding: 0.625rem 1rem !important;
    background: #f0f0f0 !important;
    background-color: #f0f0f0 !important;
    border: 1px solid #bdbdbd !important;
    border-radius: 4px !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    font-family: inherit !important;
    color: #333 !important;
    line-height: normal !important;
    fill: currentColor !important;
}

.wpkit-reservation-wrap .wpkit-res-btn--zip-lookup:hover,
.wpkit-reservation-wrap button.wpkit-res-btn--zip-lookup:hover {
    background: #e0e0e0 !important;
    background-color: #e0e0e0 !important;
    color: #333 !important;
}

/* --------------------------------------------------------------------------
   ラジオボタン
   -------------------------------------------------------------------------- */
.wpkit-res-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wpkit-res-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    cursor: pointer;
}

.wpkit-res-radio-label input[type="radio"] {
    accent-color: var(--wpkit-primary);
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   チェックボックス（個人情報同意）
   -------------------------------------------------------------------------- */
.wpkit-res-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    cursor: pointer;
    flex-wrap: wrap;
}

.wpkit-res-checkbox-label input[type="checkbox"] {
    accent-color: var(--wpkit-primary);
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.wpkit-res-checkbox-label a {
    color: var(--wpkit-primary);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   エラーメッセージ
   -------------------------------------------------------------------------- */
.wpkit-res-error {
    font-size: 0.8125rem;
    color: #c62828;
    display: none;
}

.wpkit-res-error.is-visible {
    display: block;
}

/* --------------------------------------------------------------------------
   送信ボタン
   -------------------------------------------------------------------------- */
.wpkit-res-submit-wrap {
    text-align: center;
    padding: 3rem 0 3rem;
    margin-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.wpkit-res-btn--submit {
    display: inline-block;
    padding: 1.125rem 4rem;
    background: var(--wpkit-primary);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
    min-width: 260px;
}

.wpkit-res-btn--submit:hover {
    background: var(--wpkit-primary-dark);
    box-shadow: 0 6px 18px rgba(21, 101, 192, 0.4);
}

.wpkit-res-btn--submit:disabled,
.wpkit-res-btn--submit.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   レスポンシブ
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .wpkit-res-fieldset {
        padding: 1.25rem 1rem 0.75rem;
    }

    .wpkit-res-input--zip {
        width: 120px;
    }

    .wpkit-res-btn--submit {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

/* ==========================================================================
   イベント情報バー
   ========================================================================== */
.wpkit-res-event-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #e8f0fe;
    border-left: 4px solid #1565c0;
    padding: 0.75rem 1.25rem;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.wpkit-res-event-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a1a;
}

.wpkit-res-event-date {
    font-size: 0.9375rem;
    color: var(--wpkit-primary);
    font-weight: 600;
}

.wpkit-res-fixed-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wpkit-primary);
    margin: 0;
}


/* ==========================================================================
   フォーム導入テキスト
   ========================================================================== */
.wpkit-res-intro {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #f9f9f9;
    border-radius: 6px;
}


/* ==========================================================================
   ハニーポット（完全非表示）
   ========================================================================== */
.wpkit-res-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   ステップ進行バー
   ========================================================================== */
.wpkit-res-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    counter-reset: none;
}

.wpkit-res-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.wpkit-res-step__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #aaa;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.wpkit-res-step.is-active .wpkit-res-step__circle {
    background: var(--wpkit-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--wpkit-primary-alpha);
}

.wpkit-res-step.is-done .wpkit-res-step__circle {
    background: #2e7d32;
    color: #fff;
}

.wpkit-res-step__label {
    font-size: 0.6875rem;
    color: #bbb;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.wpkit-res-step.is-active .wpkit-res-step__label { color: var(--wpkit-primary); }
.wpkit-res-step.is-done   .wpkit-res-step__label { color: #2e7d32; }

.wpkit-res-step__connector {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 17px 0.5rem 0;   /* 36px circle / 2 = 18px — label gapで -1px */
    min-width: 40px;
    transition: background 0.3s ease;
}

.wpkit-res-step__connector.is-done {
    background: #2e7d32;
}

/* ==========================================================================
   スロットタイル
   ========================================================================== */
.wpkit-res-slot-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.wpkit-res-slot-tiles.is-error .wpkit-res-slot-tile {
    border-color: #c62828;
}

.wpkit-res-slot-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    min-width: 100px;
    position: relative;
    user-select: none;
}

/* ラジオボタン本体は非表示 */
.wpkit-res-slot-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.wpkit-res-slot-tile__label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.wpkit-res-slot-tile:hover:not(.is-full):not(.is-selected) {
    border-color: #90caf9;
    background: #f0f5ff;
}

.wpkit-res-slot-tile.is-selected {
    border-color: var(--wpkit-primary);
    background: var(--wpkit-primary);
    box-shadow: 0 0 0 3px var(--wpkit-primary-alpha);
}

.wpkit-res-slot-tile.is-selected .wpkit-res-slot-tile__label,
.wpkit-res-slot-tile.is-selected .wpkit-res-slot-tile__status {
    color: #fff;
}

.wpkit-res-slot-tile.is-full {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpkit-res-slot-tile.is-full .wpkit-res-slot-tile__label {
    color: #aaa;
}

/* ○ / × ステータス */
.wpkit-res-slot-tile__status {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.wpkit-res-slot-tile__status--ok {
    color: #2e7d32;
}

.wpkit-res-slot-tile__status--full {
    color: #c62828;
}

/* 空き確認中（Ajax 中）*/
.wpkit-res-slot-tiles.is-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}


/* ==========================================================================
   パネル フェードイン アニメーション
   ========================================================================== */
@keyframes wpkit-panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wpkit-res-panel-in {
    animation: wpkit-panel-in 0.3s ease both;
}

/* ==========================================================================
   完了画面（Step 3）
   ========================================================================== */
.wpkit-res-complete {
    text-align: center;
    padding: 3rem 1.5rem;
}

.wpkit-res-complete__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: wpkit-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.wpkit-res-complete__icon svg {
    width: 36px;
    height: 36px;
}

@keyframes wpkit-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.wpkit-res-complete__msg {
    font-size: 1rem;
    color: #333;
    line-height: 1.9;
    white-space: pre-line;
}

/* ==========================================================================
   Flatpickr カスタムテーマ
   ========================================================================== */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
}

.flatpickr-months .flatpickr-month {
    background: var(--wpkit-primary);
    border-radius: 8px 8px 0 0;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: #fff;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: rgba(255,255,255,0.75);
}

.flatpickr-current-month {
    color: #fff;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--wpkit-primary);
    color: #fff;
}

.flatpickr-weekday {
    color: var(--wpkit-primary);
    font-weight: 700;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: var(--wpkit-primary);
    border-color: var(--wpkit-primary);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: #e8f0fe;
    border-color: #e8f0fe;
}

.flatpickr-day.today {
    border-color: var(--wpkit-primary);
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #ccc;
}

/* altInput（表示用テキスト）のスタイル */
.wpkit-res-datepicker.flatpickr-input[readonly] {
    background: #fff;
    cursor: pointer;
}

/* ==========================================================================
   確認画面
   ========================================================================== */

.wpkit-res-confirm {
    margin-top: 0.5rem;
}

.wpkit-res-confirm-lead {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1565c0;
    color: #1a1a1a;
}

/* 確認テーブル */
.wpkit-res-confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.wpkit-res-confirm-table th,
.wpkit-res-confirm-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.wpkit-res-confirm-table th {
    width: 38%;
    background: #f5f5f5;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.wpkit-res-confirm-table td {
    color: #1a1a1a;
    word-break: break-all;
}

/* ボタン行 */
.wpkit-res-confirm-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.wpkit-res-btn--back {
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #555;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wpkit-res-btn--back:hover {
    background: #f5f5f5;
}

.wpkit-res-btn--confirm {
    padding: 0.875rem 2.5rem;
    background: #c62828;
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    flex: 1;
    max-width: 360px;
}

.wpkit-res-btn--confirm:hover {
    background: #b71c1c;
}

.wpkit-res-btn--confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .wpkit-res-confirm-table th {
        width: 42%;
        white-space: normal;
    }

    .wpkit-res-confirm-actions {
        flex-direction: column-reverse;
    }

    .wpkit-res-btn--back,
    .wpkit-res-btn--confirm {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   動的スロットタイル（ホワイトリスト方式）
   ========================================================================== */

/* 日付未選択時のプレースホルダー */
.wpkit-res-slot-tiles__placeholder {
    font-size: 0.875rem;
    color: #888;
    margin: 0;
    padding: 0.75rem 0;
}

.wpkit-res-slot-tiles__placeholder--none {
    color: #c62828;
}

/* 動的タイルコンテナ: タイルが入るまでの最小高さ */
.wpkit-res-slot-tiles--dynamic {
    min-height: 3rem;
}
