/**
 * public.css
 * 前台（報名網頁）設計系統，沿用後台同一套品牌 tokens。
 * 學派：親和、可信賴、清爽；行動優先。重點色 LINE 綠。
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700;800&family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #fbfcfd;
    --border: #e7eaee;
    --border-strong: #d8dde3;
    --text: #1a1d21;
    --text-secondary: #5b6570;
    --text-muted: #8a93a0;

    --accent: #06c755;
    --accent-hover: #05a948;
    --accent-press: #04913d;
    --accent-soft: #e7f8ee;
    --accent-ring: rgba(6, 199, 85, 0.25);

    --warning: #f59e0b;
    --warning-soft: #fef3e2;
    --danger: #e5484d;
    --danger-soft: #fdecec;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-md: 0 8px 30px rgba(16, 24, 40, 0.10);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans TC', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, .display {
    font-family: 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
    letter-spacing: -0.02em;
    margin: 0;
}

a { color: var(--accent-press); text-decoration: none; }

/* ===== 版面容器（行動優先，桌機置中）===== */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

/* ===== 品牌頁首 ===== */
.brand-hero {
    padding: 20px 20px 18px;
    background:
        radial-gradient(600px 220px at 20% -30%, rgba(6, 199, 85, 0.12), transparent 70%),
        var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
    box-shadow: 0 3px 8px var(--accent-ring);
    flex: 0 0 auto;
}
.brand-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { color: var(--text-muted); font-size: 0.78rem; }

.brand-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
    margin-bottom: 10px;
}

/* ===== 主視覺橫幅 ===== */
.hero-banner {
    margin: 18px 0px 4px;
    border-radius: var(--r-lg);
    overflow: hidden;
    aspect-ratio: 16 / 7;
    background:
        radial-gradient(120% 120% at 85% 15%, rgba(255, 255, 255, 0.16), transparent 55%),
        linear-gradient(135deg, var(--accent) 0%, var(--accent-press) 100%);
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    align-items: flex-end;
}
.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
        radial-gradient(40% 60% at 0% 100%, rgba(0, 0, 0, 0.10), transparent 60%);
}
.hero-banner__inner { position: relative; z-index: 1; padding: 20px 22px; color: #fff; }
.hero-banner__eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.2); padding: 4px 10px; border-radius: 999px;
    margin-bottom: 10px;
}
.hero-banner__title {
    font-family: 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
    font-weight: 800; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.hero-banner--image { display: block; aspect-ratio: auto; background: none; }
.hero-banner--image img { width: 100%; height: auto; display: block; }

/* ===== 內容區 ===== */
.content { padding: 18px 20px; flex: 1; }
.section-title {
    font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}

/* ===== 場次卡 ===== */
.evt {
    display: block;
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 14px; margin-bottom: 12px; background: var(--surface);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
    color: inherit;
}
.evt.is-open:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.evt.is-disabled { opacity: 0.72; }
.evt-top { display: flex; gap: 12px; }
.date-badge {
    flex: 0 0 auto; width: 54px; text-align: center;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    overflow: hidden; background: var(--surface-2);
}
.date-badge .m { background: var(--accent); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 0; }
.date-badge .d { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 1.35rem; padding: 3px 0; line-height: 1; }
.date-badge .w { font-size: 0.62rem; color: var(--text-muted); padding-bottom: 3px; }
.evt-info { min-width: 0; }
.evt-info h3 { font-size: 1.02rem; margin-bottom: 4px; }
.evt-meta { color: var(--text-secondary); font-size: 0.82rem; display: flex; flex-direction: column; gap: 2px; }
.evt-meta span { display: inline-flex; align-items: center; gap: 6px; }
.evt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.seats { font-size: 0.82rem; color: var(--text-secondary); }
.seats b { color: var(--accent-press); font-family: 'Plus Jakarta Sans'; font-weight: 700; }
.seats.low b { color: var(--warning); }

.pill { font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-full { background: #f0f1f3; color: var(--text-muted); }
.pill-closed { background: var(--warning-soft); color: #b45309; }

/* ===== 按鈕 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: 'Noto Sans TC', sans-serif; font-weight: 700;
    border: none; border-radius: var(--r-sm); padding: 11px 16px;
    font-size: 0.95rem; cursor: pointer; transition: 0.15s var(--ease);
    text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 6px var(--accent-ring); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.btn-line { background: var(--accent); color: #fff; font-size: 1.05rem; padding: 15px; box-shadow: 0 4px 14px var(--accent-ring); }
.btn-line:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled, .btn.is-disabled { background: #e9ebef; color: var(--text-muted); box-shadow: none; cursor: not-allowed; pointer-events: none; }

/* ===== 已選場次摘要 ===== */
.selected-evt {
    background: var(--accent-soft); border: 1px solid rgba(6, 199, 85, 0.2);
    border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 18px;
}
.selected-evt .t { font-weight: 700; font-size: 0.98rem; }
.selected-evt .m { color: var(--accent-press); font-size: 0.82rem; }

/* ===== 表單 ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.control {
    width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    padding: 11px 12px; font-size: 0.95rem; font-family: inherit;
    background: var(--surface); color: var(--text);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 5px; }

.stepper {
    display: flex; align-items: center; border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); width: 160px; overflow: hidden;
}
.stepper button {
    width: 46px; height: 46px; border: none; background: var(--surface-2);
    font-size: 1.3rem; color: var(--text-secondary); cursor: pointer;
    transition: background 0.15s var(--ease);
}
.stepper button:hover { background: var(--muted-soft, #eef0f3); color: var(--text); }
.stepper .num {
    flex: 1; text-align: center; font-family: 'Plus Jakarta Sans';
    font-weight: 700; font-size: 1.1rem;
}

.consent {
    display: flex; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 18px;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.consent .txt { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }

/* ===== 提示訊息 ===== */
.alert { border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; font-size: 0.88rem; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert ul { margin: 0; padding-left: 18px; }

/* ===== 導轉頁 ===== */
.redirect { padding: 32px 24px; text-align: center; }
.check {
    width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-press);
    display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 18px;
}
.redirect h2 { font-size: 1.3rem; margin-bottom: 8px; }
.redirect .lead { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 22px; }
.code-box { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.code-box .lbl { font-size: 0.72rem; color: var(--text-muted); }
.code-box .code { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 1.6rem; letter-spacing: 0.08em; color: var(--text); }
.countdown { font-size: 0.78rem; color: var(--text-muted); margin: 8px 0 22px; }
.note {
    display: flex; gap: 8px; align-items: flex-start; background: var(--warning-soft);
    border-radius: var(--r-sm); padding: 10px 12px; margin-top: 18px; text-align: left;
    font-size: 0.78rem; color: #b45309;
}

/* ===== 空狀態 ===== */
.empty-state { padding: 56px 24px; text-align: center; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.6rem; color: var(--border-strong); margin-bottom: 12px; }

/* ===== 隱私權政策 ===== */
.policy { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.75; }
.policy h2 {
    font-size: 1rem; color: var(--text); margin: 22px 0 8px;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.policy h2:first-of-type { border-top: none; padding-top: 0; }
.policy p { margin: 0 0 10px; }
.policy ul, .policy ol { margin: 0 0 12px; padding-left: 20px; }
.policy li { margin-bottom: 5px; }
.policy strong { color: var(--text); }
.policy-updated { color: var(--text-muted); font-size: 0.8rem; }
.policy-disclaimer {
    display: flex; gap: 8px; align-items: flex-start;
    background: var(--warning-soft); color: #b45309;
    border-radius: var(--r-sm); padding: 12px 14px; margin-top: 20px; font-size: 0.82rem;
}

/* ===== 頁尾 ===== */
.app-footer { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--border); }
.footer-link { display: inline-block; margin-top: 6px; color: var(--text-muted); text-decoration: underline; }

/* ===== QR Code（非行動裝置完成報名）===== */
.qr-block { text-align: center; }
.qr-canvas {
    display: inline-block; margin: 6px auto 0; padding: 12px; line-height: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
}
.qr-canvas img, .qr-canvas canvas { display: block; }
.qr-tip { font-size: 0.86rem; color: var(--text-secondary); margin: 14px 0 6px; }
.qr-tip strong { color: var(--text); }
.qr-altlink { font-size: 0.82rem; color: var(--accent-press); text-decoration: underline; }

/* ===== Modal（隱私權政策等彈窗）===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(16, 24, 40, 0.55);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
}
.modal-overlay.is-open { display: flex; }
.modal-box {
    background: var(--surface);
    width: 100%; max-width: 560px; max-height: 88vh;
    border-radius: var(--r-lg); box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; overflow: hidden;
    animation: modalIn 0.2s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.modal-title { font-size: 1.05rem; font-weight: 800; }
.modal-close {
    border: none; background: transparent; font-size: 1.7rem; line-height: 1;
    color: var(--text-muted); cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.modal-body .policy { font-size: 0.88rem; }
.modal-body .policy h2:first-of-type { padding-top: 0; border-top: none; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); flex: 0 0 auto; }

/* ===== 桌機／平板 RWD：容器改為置中卡片 ===== */
@media (min-width: 768px) {
    body { padding: 40px 16px; }
    .app {
        min-height: auto;
        border-radius: var(--r-xl);
        overflow: hidden;
    }
    .brand-hero { position: static; }
}
