/* ============================================================
   Event Booking Pro - Public Styles (v3.1)
   ------------------------------------------------------------
   所有規則都從 .ebp-wrap 起，提高選擇器強度以擋住一般佈景主題的全域 input/button 樣式。
   表單元素（input/textarea/button）會明確宣告所有可能被覆蓋的屬性
   （box-sizing / appearance / border / padding / background / color / font / line-height / margin / width 等），
   即使主題用 input { ... } 全域樣式覆蓋，也會因為我們的選擇器更精準而獲勝。
   ============================================================ */

/* ---------- 容器 ---------- */
.ebp-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
    color: #222;
    box-sizing: border-box;
    line-height: 1.5;
}
.ebp-wrap *,
.ebp-wrap *::before,
.ebp-wrap *::after { box-sizing: border-box; }

.ebp-wrap .ebp-title {
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #222;
    font-weight: 600;
}

.ebp-wrap .ebp-top-content {
    margin: 0 0 18px;
    padding: 0;
    color: #444;
    font-size: 15px;
    line-height: 1.7;
}
.ebp-wrap .ebp-top-content p {
    margin: 0 0 10px;
    line-height: 1.7;
}
.ebp-wrap .ebp-top-content p:last-child { margin-bottom: 0; }

/* ---------- 時段表 ---------- */
.ebp-wrap .ebp-schedule { margin: 0 0 24px; }
.ebp-wrap .ebp-loading {
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 8px 0;
}

.ebp-wrap .ebp-day {
    margin: 0 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fafafa;
}
.ebp-wrap .ebp-day-title {
    font-weight: 600;
    margin: 0 0 10px;
    padding: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.4;
}
.ebp-wrap .ebp-day-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}
.ebp-wrap .ebp-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.ebp-wrap .ebp-slot {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    margin: 0;
    border: 1.5px solid #c8c8d0;
    background: #fff;
    border-radius: 6px;
    padding: 10px 8px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    line-height: 1.3;
    color: #222;
    font-family: inherit;
    transition: border-color .15s, background-color .15s;
    box-shadow: none;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
}
.ebp-wrap .ebp-slot .ebp-slot-time { display: block; font-weight: 600; }
.ebp-wrap .ebp-slot .ebp-slot-cap  { display: block; font-size: 12px; color: #666; margin-top: 3px; font-weight: normal; }
.ebp-wrap .ebp-slot .ebp-slot-wait { display: block; font-size: 11px; color: #b3741a; margin-top: 2px; }

.ebp-wrap .ebp-slot:hover:not(:disabled) { border-color: #2160c4; background: #f1f6ff; color: #222; }
.ebp-wrap .ebp-slot:focus { outline: none; border-color: #2160c4; box-shadow: 0 0 0 3px rgba(33,96,196,.15); }
.ebp-wrap .ebp-slot.is-selected,
.ebp-wrap .ebp-slot.is-selected:hover { border-color: #2160c4; background: #e7f0ff; color: #1a4a99; }
.ebp-wrap .ebp-slot:disabled,
.ebp-wrap .ebp-slot.is-full {
    cursor: not-allowed;
    background: #f3f3f3;
    color: #aaa;
    border-color: #e0e0e0;
}
.ebp-wrap .ebp-slot.is-waitlist {
    border-color: #f5b461;
    background: #fff7e6;
    color: #8a4f00;
}
.ebp-wrap .ebp-slot.is-waitlist .ebp-slot-cap { color: #b3741a; }
.ebp-wrap .ebp-slot.is-waitlist:hover:not(:disabled) { border-color: #d68b1c; background: #ffeacc; color: #8a4f00; }
.ebp-wrap .ebp-slot.is-waitlist.is-selected,
.ebp-wrap .ebp-slot.is-waitlist.is-selected:hover { border-color: #d68b1c; background: #ffe2b3; color: #6a3c00; }

/* ---------- 表單 ---------- */
.ebp-wrap .ebp-form {
    background: transparent;
    padding: 4px 0 0;
    margin: 0;
}
.ebp-wrap .ebp-selected {
    padding: 10px 12px;
    background: #fff8e1;
    border-radius: 6px;
    border: 1px dashed #d8b85b;
    margin: 0 0 14px;
    font-size: 14px;
    color: #6a4f00;
    line-height: 1.5;
}
.ebp-wrap .ebp-selected.is-active   { background: #e7f0ff; border: 1px solid #b1c7eb; color: #1a4a99; }
.ebp-wrap .ebp-selected.is-waitlist { background: #fff3dd; border: 1px solid #f0c87a; color: #8a4f00; }

.ebp-wrap .ebp-field { margin: 0 0 14px; padding: 0; }
.ebp-wrap .ebp-field label {
    display: block;
    margin: 0 0 5px;
    padding: 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
}

/* 輸入欄位：完整宣告以擋住佈景主題 */
.ebp-wrap .ebp-field input[type="text"],
.ebp-wrap .ebp-field input[type="tel"],
.ebp-wrap .ebp-field input[type="email"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.4;
    color: #222;
    background: #fff;
    background-image: none;
    border: 1.5px solid #c8c8d0;
    border-radius: 6px;
    box-shadow: none;
    outline: none;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    height: auto;
    min-height: 0;
}
.ebp-wrap .ebp-field input[type="text"]:focus,
.ebp-wrap .ebp-field input[type="tel"]:focus,
.ebp-wrap .ebp-field input[type="email"]:focus {
    border-color: #2160c4;
    box-shadow: 0 0 0 3px rgba(33,96,196,.15);
    outline: none;
    background: #fff;
    color: #222;
}
.ebp-wrap .ebp-field input::placeholder { color: #999; opacity: 1; }

.ebp-wrap .ebp-req { color: #c8392b; }

/* ---------- 送出按鈕 ---------- */
.ebp-wrap .ebp-actions { margin: 18px 0 0; padding: 0; }
.ebp-wrap .ebp-submit {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    background: #2160c4;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    margin: 0;
    font-family: inherit;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    transition: background-color .15s;
    height: auto;
    min-height: 0;
    width: auto;
}
.ebp-wrap .ebp-submit:hover:not(:disabled) { background: #1a4a99; color: #fff; }
.ebp-wrap .ebp-submit:focus { outline: none; box-shadow: 0 0 0 3px rgba(33,96,196,.3); }
.ebp-wrap .ebp-submit:disabled { background: #999; color: #fff; cursor: not-allowed; }

/* ---------- 訊息列 ---------- */
.ebp-wrap .ebp-message {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
}
.ebp-wrap .ebp-message.is-success { display: block; background: #e7f6e7; color: #0a7a2f; border: 1px solid #b9e4b9; }
.ebp-wrap .ebp-message.is-error   { display: block; background: #fdecec; color: #a32020; border: 1px solid #f3c2c2; }
.ebp-wrap .ebp-message.is-warn    { display: block; background: #fff8e1; color: #8a5a00; border: 1px solid #f1d590; }

.ebp-wrap .ebp-closed-banner {
    padding: 14px;
    text-align: center;
    background: #fdecec;
    color: #a32020;
    border: 1px solid #f3c2c2;
    border-radius: 6px;
    margin: 0;
}

/* ============================================================
   蓋台訊息（送出後彈出，10s 倒數 + 3s 淡出）
   ------------------------------------------------------------
   class 全部以 ebp-modal- 開頭，避開 popup/overlay/banner/promo/ad
   等容易被 AdBlock 規則命中的字眼。
   z-index 用 2147483600（接近 32-bit 上限），確保蓋過其他套件。
   ============================================================ */
.ebp-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, .55);
    z-index: 2147483600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .25s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    /* 防止滾動穿透 */
    overscroll-behavior: contain;
}
.ebp-modal-backdrop.is-visible { opacity: 1; }
.ebp-modal-backdrop.is-fading {
    opacity: 0;
    transition: opacity 3s ease;
    pointer-events: none;
}
.ebp-modal-backdrop.is-closing {
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.ebp-modal-backdrop *,
.ebp-modal-backdrop *::before,
.ebp-modal-backdrop *::after { box-sizing: border-box; }

.ebp-modal-card {
    position: relative;
    background: #fff;
    color: #222;
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    transform: translateY(8px) scale(.98);
    transition: transform .25s ease;
}
.ebp-modal-backdrop.is-visible .ebp-modal-card { transform: translateY(0) scale(1); }
.ebp-modal-backdrop.is-closing .ebp-modal-card,
.ebp-modal-backdrop.is-fading .ebp-modal-card {
    /* 留住卡片不要動，只淡出背景 */
}

.ebp-modal-card.ebp-modal-success { color: #0a6020; }
.ebp-modal-card.ebp-modal-warn    { color: #6a4a00; }
.ebp-modal-card.ebp-modal-error   { color: #8a1a1a; }

.ebp-modal-icon {
    margin: 0 auto 12px;
    width: 36px;
    height: 36px;
    line-height: 0;
}

.ebp-modal-text {
    color: #222;
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 22px;
    word-break: break-word;
}

.ebp-modal-ok {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    background: #2160c4;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 32px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    margin: 0;
    font-family: inherit;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    transition: background-color .15s;
    min-width: 120px;
    height: auto;
    width: auto;
}
.ebp-modal-card.ebp-modal-error .ebp-modal-ok { background: #a32020; }
.ebp-modal-card.ebp-modal-warn  .ebp-modal-ok { background: #b3741a; }
.ebp-modal-ok:hover { filter: brightness(.92); color: #fff; }
.ebp-modal-ok:focus { outline: none; box-shadow: 0 0 0 3px rgba(33, 96, 196, .35); }

.ebp-modal-close {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #888;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    box-shadow: none;
    transition: color .15s, background-color .15s;
}
.ebp-modal-close:hover { color: #222; background: rgba(0, 0, 0, .05); }
.ebp-modal-close:focus { outline: none; color: #222; box-shadow: 0 0 0 2px rgba(33, 96, 196, .35); }

/* 手機 */
@media (max-width: 480px) {
    .ebp-modal-card {
        padding: 26px 20px 20px;
        font-size: 15px;
    }
    .ebp-modal-text { font-size: 15px; }
    .ebp-modal-ok { width: 100%; }
}
