/**
 * easyPore SaaS 平台 UI 與註冊流程樣式表
 *
 * Version: 5.4.1
 * Text Domain: easy-pore
 */

/* =========================================================
 * 1. 全域變數與重置 (Variables & Reset)
 * ========================================================= */
:root {
    --ep-primary: #7e22ce;
    --ep-primary-hover: #6b21a8;
    --ep-primary-light: #f3e8ff;
    --ep-dark: #0f172a;
    --ep-dark-surface: #1e293b;
    --ep-text-main: #334155;
    --ep-text-muted: #64748b;
    --ep-bg-light: #f8fafc;
    --ep-border-color: #e2e8f0;
    --ep-success: #16a34a;
    --ep-danger: #dc2626;
    --ep-warning: #d97706;
    --ep-radius-lg: 24px;
    --ep-radius-md: 12px;
    --ep-radius-sm: 8px;
    --ep-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
}

/* =========================================================
 * 2. 註冊容器與外框 (Wizard Container)
 * ========================================================= */
.reg-wizard-container {
    max-width: 680px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: var(--ep-radius-lg);
    border: 1px solid var(--ep-border-color);
    box-shadow: var(--ep-shadow);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ep-text-main);
}

/* Header */
.reg-header {
    background: linear-gradient(135deg, var(--ep-dark) 0%, var(--ep-dark-surface) 100%);
    color: #ffffff;
    padding: 32px 28px 24px 28px;
    text-align: center;
}

.reg-header h2 {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: -0.5px;
}

.reg-header p {
    margin: 8px 0 0 0 !important;
    font-size: 14px !important;
    color: #94a3b8 !important;
}

/* =========================================================
 * 3. 步驟指示器 (Stepper)
 * ========================================================= */
.wizard-stepper {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: var(--ep-bg-light);
    border-bottom: 1px solid var(--ep-border-color);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.step-item.active {
    color: var(--ep-primary);
}

.step-item.completed {
    color: var(--ep-success);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--ep-primary);
    box-shadow: 0 0 0 4px rgba(126, 34, 206, 0.15);
}

.step-item.completed .step-number {
    background: var(--ep-success);
}

/* Body Container */
.reg-body {
    padding: 30px 28px;
}

/* =========================================================
 * 4. 方案選擇卡片 (Plan Selection Cards)
 * ========================================================= */
.plan-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.plan-card {
    border: 2px solid var(--ep-border-color);
    border-radius: var(--ep-radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #ffffff;
    position: relative;
}

.plan-card:hover {
    border-color: var(--ep-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(126, 34, 206, 0.1);
}

.plan-card.selected {
    border-color: var(--ep-primary);
    background: var(--ep-primary-light);
    box-shadow: 0 0 0 2px var(--ep-primary);
}

.plan-card .plan-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ep-dark);
    margin-bottom: 8px;
}

.plan-card .plan-price {
    font-size: 24px;
    font-weight: 900;
    color: var(--ep-primary);
    margin-bottom: 12px;
}

.plan-card .plan-price span {
    font-size: 13px;
    color: var(--ep-text-muted);
    font-weight: 400;
}

.plan-card .plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--ep-text-main);
}

.plan-card .plan-features li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
 * 5. 表單元件美化 (Form Elements)
 * ========================================================= */
.ep-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.ep-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ep-dark);
    margin-bottom: 6px;
}

.ep-form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--ep-border-color);
    border-radius: var(--ep-radius-sm);
    font-size: 14px;
    color: var(--ep-text-main);
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ep-form-control:focus {
    outline: none;
    border-color: var(--ep-primary);
    box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.15);
}

/* Email 驗證碼 Input Group */
.ep-input-group {
    display: flex;
    gap: 10px;
}

.ep-input-group .ep-form-control {
    flex: 1;
}

.btn-send-code {
    height: 46px;
    padding: 0 16px;
    background: var(--ep-dark);
    color: #ffffff;
    border: none;
    border-radius: var(--ep-radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-send-code:hover {
    background: var(--ep-dark-surface);
}

.btn-send-code:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* =========================================================
 * 6. 按鈕系統 (Buttons)
 * ========================================================= */
.btn-wizard-next,
.btn-wizard-prev,
.btn-reg-submit {
    height: 48px;
    border-radius: var(--ep-radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-wizard-next,
.btn-reg-submit {
    background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-primary-hover) 100%);
    color: #ffffff;
    width: 100%;
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.25);
}

.btn-wizard-next:hover,
.btn-reg-submit:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(126, 34, 206, 0.35);
}

.btn-wizard-prev {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    padding: 0 20px;
}

.btn-wizard-prev:hover {
    background: #e2e8f0;
    color: var(--ep-dark);
}

.btn-back-login {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--ep-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-back-login:hover {
    color: var(--ep-primary);
}

/* =========================================================
 * 7. 訊息與錯誤提示框 (Notifications & Alert Boxes)
 * ========================================================= */
.ep-wizard-error {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: var(--ep-danger);
    font-size: 14px;
    font-weight: 600;
}

.coupon-msg {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
 * 8. 響應式適配 (RWD Media Queries)
 * ========================================================= */
@media screen and (max-width: 640px) {
    .reg-wizard-container {
        margin: 15px auto;
        border-radius: 16px;
    }

    .wizard-stepper {
        padding: 15px 16px;
    }

    .step-label {
        display: none;
    }

    .reg-body {
        padding: 20px 16px;
    }

    .plan-cards-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
 * 9. 專人處理付款彈窗 (Manual Payment Modal) & RWD 滿版
 * ========================================================= */

/* 遮罩背景 (Backdrop) */
.ep-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ep-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* 彈窗主體 (Modal Content - 桌面端預設) */
.ep-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: var(--ep-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.ep-modal-backdrop.active .ep-modal-content {
    transform: translateY(0) scale(1);
}

/* 彈窗 Header */
.ep-modal-header {
    background: linear-gradient(135deg, var(--ep-dark) 0%, var(--ep-dark-surface) 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ep-modal-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ep-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.ep-modal-close:hover {
    color: #ffffff;
}

/* 彈窗 Body */
.ep-modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.ep-modal-body p {
    margin-top: 0;
    font-size: 14px;
    color: var(--ep-text-muted);
    line-height: 1.6;
}

/* 彈窗 Footer 按鈕區 */
.ep-modal-footer {
    padding: 16px 24px;
    background: var(--ep-bg-light);
    border-top: 1px solid var(--ep-border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ep-modal-footer .btn-modal-cancel {
    background: #ffffff;
    border: 1.5px solid var(--ep-border-color);
    color: var(--ep-text-main);
    padding: 0 20px;
    height: 44px;
    border-radius: var(--ep-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-modal-footer .btn-modal-cancel:hover {
    background: #f1f5f9;
}

.ep-modal-footer .btn-modal-submit {
    background: var(--ep-primary);
    color: #ffffff;
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: var(--ep-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.ep-modal-footer .btn-modal-submit:hover {
    background: var(--ep-primary-hover);
}

/* =========================================================
 * 手機端 RWD 滿版／底部滑出適配 (Mobile RWD Sheet Modal)
 * ========================================================= */
@media screen and (max-width: 640px) {
    .ep-modal-backdrop {
        align-items: flex-end; /* 手機端改為靠底顯示，方便大拇指操作 */
    }

    .ep-modal-content {
        max-width: 100vw;
        width: 100vw;
        border-radius: 20px 20px 0 0; /* 底部平鋪，頂部保留圓角 */
        max-height: 90vh; /* 防止超過手機視窗 */
        transform: translateY(100%); /* 從螢幕最底部向上滑出 */
    }

    .ep-modal-backdrop.active .ep-modal-content {
        transform: translateY(0);
    }

    .ep-modal-header {
        padding: 18px 20px;
        position: relative;
    }

    /* 頂部加上手機 App 風格的抓握條 (Drag Indicator) */
    .ep-modal-header::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .ep-modal-body {
        padding: 20px;
        max-height: calc(90vh - 130px); /* 自動保留 Header/Footer 空間並可滾動 */
    }

    .ep-modal-footer {
        padding: 14px 20px;
        flex-direction: column-reverse; /* 手機端主要確定按鈕在上方，取消在下方 */
        gap: 8px;
    }

    .ep-modal-footer .btn-modal-cancel,
    .ep-modal-footer .btn-modal-submit {
        width: 100%; /* 手機端按鈕 100% 滿版 */
        height: 48px;
        font-size: 15px;
    }
}