/**
 * WP LINE LIFF Login — 前端樣式
 *
 * 包含：
 * 1. LIFF 入口頁面（載入中、成功、錯誤、非 LINE 環境）
 * 2. LINE 登入按鈕
 * 3. 已登入使用者資訊顯示
 *
 * @package WP_LINE_LIFF_Login
 */

/* =====================================================
   LIFF 入口頁面容器
   ===================================================== */

.wll-liff-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;           /* 頁面垂直置中 */
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* ── 各狀態 div 的共用樣式 ───────────────────────── */

.wll-state {
    text-align: center;
    max-width: 360px;
    width: 100%;
    padding: 40px 30px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.08 );
}

/* ── 訊息文字 ────────────────────────────────────── */

.wll-message {
    font-size: 16px;
    color: #333333;
    margin: 12px 0 0;
    line-height: 1.6;
}

/* =====================================================
   載入中狀態
   ===================================================== */

.wll-state--loading {
    color: #555;
}

/* 旋轉載入動畫 */
.wll-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e8e8;
    border-top-color: #06C755;  /* LINE 品牌綠色 */
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: wll-spin 0.8s linear infinite;
}

@keyframes wll-spin {
    to { transform: rotate( 360deg ); }
}

/* =====================================================
   成功狀態
   ===================================================== */

.wll-state--success {
    border-top: 4px solid #06C755;
}

.wll-success-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    font-size: 32px;
    background-color: #06C755;
    color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.wll-message--name {
    font-size: 18px;
    font-weight: 600;
    color: #222222;
}

.wll-message--status {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba( 6, 199, 85, 0.12 );
    color: #0a7f3a;
    font-size: 13px;
    font-weight: 700;
}

.wll-message--sub {
    font-size: 14px;
    color: #777777;
}

.wll-message--version {
    font-size: 12px;
    color: #8a918d;
    margin-top: 10px;
}

.wll-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #e7f4ec;
    border-radius: 12px;
    background: #f9fffb;
    text-align: left;
}

.wll-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #06C755;
}

.wll-profile-meta {
    flex: 1;
}

.wll-profile-row + .wll-profile-row {
    margin-top: 10px;
}

.wll-profile-label {
    display: block;
    margin-bottom: 4px;
    color: #5e6c62;
    font-size: 12px;
    font-weight: 700;
}

.wll-profile-login,
.wll-profile-line-id {
    display: block;
    overflow-wrap: anywhere;
    color: #203328;
    font-size: 12px;
}

.wll-action-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.wll-shop-login-btn,
.wll-close-btn {
    display: inline-block;
    padding: 11px 28px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.wll-shop-login-btn {
    background-color: #203328;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba( 32, 51, 40, 0.18 );
}

.wll-shop-login-btn:hover {
    background-color: #16241b;
}

.wll-shop-login-btn:active {
    transform: scale( 0.98 );
}

.wll-close-btn {
    background-color: #06C755;
    color: #ffffff;
}

.wll-close-btn:hover {
    background-color: #05a847;
}

.wll-close-btn:active {
    transform: scale( 0.98 );
}

/* =====================================================
   錯誤狀態
   ===================================================== */

.wll-state--error {
    border-top: 4px solid #e74c3c;
}

.wll-error-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    font-size: 28px;
    background-color: #e74c3c;
    color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.wll-message--error-text {
    color: #c0392b;
    font-size: 15px;
}

/* 重試按鈕 */
.wll-retry-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 28px;
    background-color: #06C755;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.wll-retry-btn:hover {
    background-color: #05a847;
}

.wll-retry-btn:active {
    transform: scale( 0.97 );
}

/* =====================================================
   非 LINE 環境警告狀態
   ===================================================== */

.wll-state--warning {
    border-top: 4px solid #f39c12;
}

.wll-warning-icon {
    width: 64px;
    height: 64px;
    line-height: 60px;
    font-size: 32px;
    font-weight: bold;
    background-color: #f39c12;
    color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 16px;
}

/* 返回按鈕 */
.wll-back-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background-color: #f0f0f0;
    color: #333333;
    border-radius: 24px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.wll-back-btn:hover {
    background-color: #e0e0e0;
    color: #111111;
    text-decoration: none;
}

/* =====================================================
   LINE 登入按鈕（[line_liff_login_button] Shortcode）
   ===================================================== */

.wll-login-page {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 14px 26px;
}

.wll-login-page--liff-launcher {
    position: relative;
}

.wll-login-panel {
    position: relative;
    overflow: hidden;
    padding: 24px 18px 22px;
    border: 1px solid #d9ebe0;
    border-radius: 26px;
    background:
        radial-gradient( circle at top right, rgba( 6, 199, 85, 0.18 ), transparent 36% ),
        linear-gradient( 180deg, #ffffff 0%, #f5fbf7 100% );
    box-shadow: 0 18px 42px rgba( 22, 36, 27, 0.08 );
}

.wll-login-panel::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -78px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba( 6, 199, 85, 0.08 );
    pointer-events: none;
}

.wll-login-panel > * {
    position: relative;
    z-index: 1;
}

.wll-login-panel--liff-launcher {
    min-height: 0;
}

.wll-login-hero {
    text-align: left;
}

.wll-login-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba( 6, 199, 85, 0.12 );
    color: #0f7e40;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.wll-login-title {
    margin: 14px 0 10px;
    color: #1a2d22;
    font-size: 29px;
    line-height: 1.18;
}

.wll-login-lead {
    margin: 0;
    color: #4d5a51;
    font-size: 15px;
    line-height: 1.75;
}

.wll-login-highlight {
    display: grid;
    grid-template-columns: 78px minmax( 0, 1fr );
    gap: 14px;
    align-items: center;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #dcebe2;
    border-radius: 20px;
    background: rgba( 255, 255, 255, 0.88 );
}

.wll-login-highlight-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: #06C755;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 10px 24px rgba( 6, 199, 85, 0.24 );
}

.wll-login-highlight--liff .wll-login-highlight-mark {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    font-size: 14px;
}

.wll-login-highlight-copy strong,
.wll-login-highlight-copy span {
    display: block;
}

.wll-login-highlight-copy strong {
    color: #1f3025;
    font-size: 16px;
}

.wll-login-highlight-copy span {
    margin-top: 6px;
    color: #536057;
    font-size: 14px;
    line-height: 1.7;
}

.wll-login-wrap {
    width: 100%;
    margin: 22px 0 0;
}

.wll-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 15px 22px;
    background-color: #06C755;
    color: #ffffff;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 26px rgba( 6, 199, 85, 0.28 );
}

.wll-login-btn:hover {
    background-color: #05a847;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba( 6, 199, 85, 0.45 );
    transform: translateY( -1px );
}

.wll-login-btn:active {
    transform: translateY( 0 ) scale( 0.98 );
}

.wll-login-btn--launch {
    box-shadow: 0 16px 30px rgba( 6, 199, 85, 0.26 );
}

.wll-line-icon {
    flex-shrink: 0;
}

.wll-launch-hint {
    margin: 12px 4px 0;
    color: #5b6a61;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.wll-login-steps {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: wll-login-steps;
}

.wll-login-steps li {
    position: relative;
    min-height: 100%;
    padding: 16px 16px 16px 52px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e0ede5;
    color: #314037;
    font-size: 14px;
    line-height: 1.7;
}

.wll-login-steps li::before {
    counter-increment: wll-login-steps;
    content: counter( wll-login-steps );
    position: absolute;
    top: 15px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #203328;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.wll-login-steps--liff li {
    background: rgba( 255, 255, 255, 0.9 );
}

.wll-login-footnote {
    margin: 18px 0 0;
    color: #68766e;
    font-size: 13px;
    line-height: 1.8;
}

/* =====================================================
   已登入使用者資訊（[line_liff_login_button] 已登入狀態）
   ===================================================== */

.wll-user-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 30px;
}

/* LINE 頭像圓形裁切 */
.wll-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #06C755;
}

.wll-display-name {
    font-size: 15px;
    font-weight: 600;
    color: #222222;
}

/* LINE 綁定標籤 */
.wll-bound-badge {
    font-size: 11px;
    font-weight: 600;
    color: #06C755;
    background: rgba( 6, 199, 85, 0.1 );
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.wll-login-status-card {
    max-width: 560px;
    margin: 16px 0;
    padding: 22px 20px;
    border: 1px solid #dcebe2;
    border-radius: 20px;
    background: linear-gradient( 180deg, #ffffff 0%, #f8fbf9 100% );
    box-shadow: 0 14px 34px rgba( 22, 36, 27, 0.06 );
}

.wll-login-status-text {
    margin: 14px 0 0;
    color: #4d5a51;
    line-height: 1.7;
}

.wll-login-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* =====================================================
   通知訊息（管理員設定提示等）
   ===================================================== */

.wll-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin: 10px 0;
}

.wll-notice-error {
    background-color: #ffeaea;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.wll-notice-success {
    background-color: #eafaf1;
    border-left: 4px solid #06C755;
    color: #1e7e34;
}

/* =====================================================
   RWD 響應式調整
   ===================================================== */

@media ( max-width: 480px ) {
    .wll-state {
        padding: 30px 20px;
    }

    .wll-action-group {
        flex-direction: column;
    }

    .wll-shop-login-btn,
    .wll-close-btn {
        width: 100%;
    }

    .wll-login-page {
        padding: 14px 0 20px;
    }

    .wll-login-panel {
        padding: 22px 16px 20px;
        border-radius: 22px;
    }

    .wll-login-title {
        font-size: 26px;
    }

    .wll-login-lead {
        font-size: 14px;
    }

    .wll-login-highlight {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .wll-login-highlight-mark {
        margin: 0 auto;
    }

    .wll-login-btn {
        min-height: 54px;
        padding: 14px 18px;
        font-size: 16px;
    }

    .wll-login-steps li {
        padding-left: 48px;
    }

    .wll-user-info {
        flex-wrap: wrap;
    }
}

@media ( min-width: 768px ) {
    .wll-login-page {
        padding: 44px 20px;
    }

    .wll-login-panel {
        padding: 34px 34px 30px;
    }

    .wll-login-title {
        font-size: 34px;
    }

    .wll-login-lead {
        font-size: 16px;
        max-width: 460px;
    }

    .wll-login-highlight {
        padding: 18px 20px;
    }

    .wll-login-steps {
        grid-template-columns: 1fr;
    }
}
