/* ============================================================
   免費試用 / Demo 預約 彈窗樣式
   ============================================================ */

.ft_modal_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 2147483647;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
}

.ft_modal_overlay.active {
    display: flex;
}

.ft_modal_box {
    background: #fff;
    width: 92%;
    max-width: 600px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 40px 36px 32px;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    animation: ftModalZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    text-align: left; /* 表單內容一律靠左，不受所在頁面 text-align 影響（例：qr-trial.html 為置中版型）*/
}

@keyframes ftModalZoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.ft_modal_close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 26px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.ft_modal_close:hover {
    color: #00BEE9;
}

.ft_modal_header {
    text-align: center;
    margin-bottom: 24px;
}

.ft_modal_title {
    font-size: 26px;
    font-weight: bold;
    color: #0071dc;
    margin: 0 0 8px;
}

.ft_modal_subtitle {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* 申請類型切換（radio 外觀做成卡片） */
.ft_type_switch {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.ft_type_option {
    flex: 1;
    cursor: pointer;
}

.ft_type_option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ft_type_option_box {
    display: block;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    transition: all 0.25s;
    background: #fafafa;
}

.ft_type_option_box i {
    font-size: 24px;
    color: #999;
    margin-bottom: 6px;
    display: block;
}

.ft_type_option_box span {
    font-size: 15px;
    font-weight: bold;
    color: #666;
}

.ft_type_option input[type="radio"]:checked + .ft_type_option_box {
    border-color: #00BEE9;
    background: #eef8fc;
}

.ft_type_option input[type="radio"]:checked + .ft_type_option_box i,
.ft_type_option input[type="radio"]:checked + .ft_type_option_box span {
    color: #00BEE9;
}

/* 表單欄位 */
.ft_form_group {
    margin-bottom: 16px;
}

.ft_form_row {
    display: flex;
    gap: 12px;
}

.ft_form_row .ft_form_group {
    flex: 1;
}

.ft_form_label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
    font-weight: bold;
}

.ft_form_label .req {
    color: #e74c3c;
    margin-left: 2px;
}

.ft_form_control {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

.ft_form_control:focus {
    border-color: #00BEE9;
    box-shadow: 0 0 0 3px rgba(0, 190, 233, 0.12);
}

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

select.ft_form_control {
    appearance: auto;
    cursor: pointer;
    background-image: none;
    padding-right: 32px;
}

/* honeypot 欄位（防機器人，不顯示） */
.ft_honeypot {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 按鈕 */
.ft_modal_buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.ft_modal_btn {
    flex: 1;
    padding: 13px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: 0.2s;
    font-family: inherit;
}

.ft_modal_btn_cancel {
    background: #f5f5f5;
    color: #666;
}

.ft_modal_btn_cancel:hover {
    background: #e8e8e8;
}

.ft_modal_btn_submit {
    background: linear-gradient(90deg, #00BEE9, #01c2fd);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 190, 233, 0.3);
}

.ft_modal_btn_submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 190, 233, 0.4);
}

.ft_modal_btn_submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 成功訊息 */
.ft_success_box {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.ft_success_box.active {
    display: block;
}

.ft_success_icon {
    font-size: 56px;
    color: #2ecc71;
    margin-bottom: 16px;
}

.ft_success_title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.ft_success_msg {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 8px;
}

.ft_success_number {
    display: inline-block;
    background: #eef8fc;
    color: #00BEE9;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-family: monospace;
    font-size: 20px;
    margin: 12px 0;
}

/* CTA 浮動按鈕（在頁面角落） */
.ft_cta_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(90deg, #00BEE9, #01c2fd);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 6px 20px rgba(0, 190, 233, 0.4);
    text-decoration: none;
    font-family: inherit;
}

.ft_cta_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 190, 233, 0.5);
    opacity: 0.95;
}

.ft_cta_btn i {
    font-size: 18px;
}

/* 浮動懸浮按鈕（頁面右下角固定） */
.ft_cta_floating_wrap {
    position: fixed;
    right: 34px;
    bottom: 36px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.ft_cta_floating_wrap::after {
    content: '預約我們';
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
}

.ft_cta_floating_wrap .ft_cta_btn {
    animation: ftFloatPulse 2.5s ease-in-out infinite;
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
}

.ft_cta_floating_wrap .ft_cta_btn i {
    font-size: 32px;
    margin: 0;
}

@keyframes ftFloatPulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(0, 190, 233, 0.4); }
    50% { box-shadow: 0 10px 30px rgba(0, 190, 233, 0.7); }
}

/* 內文中置中的 CTA 區塊（可選） */
.ft_cta_inline_section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #eef8fc 0%, #ffffff 100%);
    text-align: center;
}

.ft_cta_inline_title {
    font-size: 28px;
    font-weight: bold;
    color: #0071dc;
    margin: 0 0 12px;
}

.ft_cta_inline_subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 28px;
}

.ft_cta_inline_buttons {
    display: inline-flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* RWD */
@media (max-width: 767px) {
    .ft_modal_overlay {
        align-items: flex-start;          /* 從頂端開始排，消除上方藍色間距 */
        overflow-y: auto;                 /* 整個遮罩可捲動，避免內容被工具列卡住 */
        -webkit-overflow-scrolling: touch;
    }
    .ft_modal_box {
        width: 100%;
        max-width: none;
        min-height: 100%;                 /* 至少填滿可視高度，不留間距 */
        max-height: none;                 /* 不限高，內容過長由遮罩捲動 */
        border-radius: 0;                 /* 手機全螢幕，不需圓角 */
        margin: 0;
        padding: 26px 22px;
        /* 底部大量留白，確保送出鈕能捲到各家 App 內建瀏覽器底部工具列「上方」(YT/LINE/FB 工具列約 50~60px) */
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }
    .ft_modal_title {
        font-size: 22px;
    }
    .ft_form_row {
        flex-direction: column;
        gap: 0;
    }
    .ft_type_switch {
        flex-direction: column;
        gap: 8px;
    }
    .ft_cta_btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    .ft_cta_floating_wrap {
        right: 14px;
        bottom: 14px;
    }
    .ft_cta_floating_wrap .ft_cta_btn {
        width: 62px;
        height: 62px;
    }
    .ft_cta_floating_wrap .ft_cta_btn i {
        font-size: 26px;
    }
    .ft_cta_floating_wrap::after {
        font-size: 12px;
        padding: 3px 10px;
    }
    .ft_cta_inline_title {
        font-size: 22px;
    }
    .ft_cta_inline_buttons {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }
}
