:root {
    --primary-color: #2b6cb0;       /* 專業商務藍（按鈕與聚焦框主色） */
    --primary-hover: #2c5282;       /* 深商務藍（按鈕懸停） */
    --brand-dark: #1a365d;          /* 極深海軍藍（左側底色與主標題） */
    --brand-accent: #63b3ed;        /* 亮天藍（光暈與圖示強調） */
    --bg-page: #f7fafc;             /* 極淺藍灰底色 */
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #cbd5e0;
    --input-focus-ring: rgba(43, 108, 176, 0.18); /* 藍色聚焦光暈 */
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-card: 0 20px 25px -5px rgba(26, 54, 93, 0.08), 0 8px 10px -6px rgba(26, 54, 93, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 整體頁面微漸層背景 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    background-image: radial-gradient(at 0% 0%, rgba(99, 179, 237, 0.12) 0px, transparent 50%),
                        radial-gradient(at 100% 100%, rgba(43, 108, 176, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

/* 主容器卡片 */
.login-wrapper {
    width: 100%;
    max-width: 980px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 左側品牌視覺區塊 漸層背景 */
.brand-panel {
    flex: 1.05;
    background: linear-gradient(135deg, #102a43 0%, #243b53 52%, #334e68 100%);
    color: #ffffff;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
/* 右上角漸層背景 */
.brand-panel::before {
    content: "";
    position: absolute;
    top: -18%;
    right: -18%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(144, 205, 244, 0.22) 0%, transparent 70%);
    pointer-events: none;
}
/* 左下角漸層背景 */
.brand-panel::after {
    content: "";
    position: absolute;
    bottom: -15%;
    left: -15%;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 42, 67, 0.5) 0%, transparent 70%);
    pointer-events: none;
}

.brand-header {
    position: relative;
    z-index: 1;
}

/* 左側頂部徽章與特色圖示 */
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: #90cdf4;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-logo-box {
    margin-bottom: 1.25rem;
}

.brand-logo-box img {
    max-width: 255px;
    max-height: 54px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1); /* 若原圖為深色Logo可自動轉白，若原圖已有底色可移除此行 */
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.feature-list {
    position: relative;
    z-index: 1;
    list-style: none;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 179, 237, 0.2);
    color: #63b3ed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 右側表單操作區塊 */
.form-panel {
    flex: 1;
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.form-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.system-tag {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-select {
    appearance: none;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 28px 5px 10px;
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s;
}

.lang-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-header {
    margin-bottom: 1.75rem;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 0.35rem;
}

.form-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

/* 密碼顯示切換按鈕 */
.toggle-pwd {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-pwd:hover {
    color: var(--text-main);
}

/* 按鈕群組 */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 1.75rem;
}

.btn {
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

/* 登入按鈕 */
.btn-primary {
    flex: 2;
    color: #ffffff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25); /*透光陰影*/
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    flex: 1;
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

/* 底部狀態列 */
.status-bar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 底部在線人數徽章 */
.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2b6cb0;
    background: #ebf8ff;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #3182ce;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.shortcut-hint {
    color: #94a3b8;
}

/* 外部頁尾 */
.page-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.page-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 附加選項列（記住帳號 / 忘記密碼） */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-main);
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}


/* 驗證碼區塊排版 */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-display-box {
    width: 110px;
    height: 44px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.captcha-display-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}



/* RWD 響應式斷點 */
@media (max-width: 820px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 460px;
    }

    .brand-panel {
        padding: 2rem 1.75rem;
    }

    .feature-list, .brand-footer {
        display: none; /* 手機與小平板隱藏次要說明，聚焦表單 */
    }

    .brand-title {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
    }

    .form-panel {
        padding: 2rem 1.75rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    .form-panel {
        padding: 1.5rem 1.25rem;
    }
    .shortcut-hint {
        display: none;
    }
}