﻿/* =================================================================================================
// FileName: login-page.css
// Purpose: 登入頁面專用樣式表 - 400px 標準寬版、解決輸入框垂直置中與圖示間距
// ================================================================================================= */

/* 全域套用 border-box：確保內距與邊框不撐開容器寬度 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 基礎佈局鎖定 */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    width: 100%;
    font-family: "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
    overflow: hidden;
    background-color: #1a1a1a;
}

/* 全版容器 */
.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* 背景壓暗層 */
.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2;
}

/* 登入卡片：標準設定為 400px */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 2.75rem 2.25rem;
    border-radius: 6px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

    /* 頂部藍色飾條 */
    .login-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: #1E40AF;
        border-radius: 6px 6px 0 0;
    }

/* 品牌 Logo 樣式：100% 滿版卡片內部區域 */
.brand-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto 1.5rem auto;
    display: block;
}

/* 表單容器 */
.form-wrapper {
    width: 100%;
}

/* 標題樣式 - 左側對齊 */
.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #000000;
    text-align: left;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

/* 欄位佈局 - 確保 Flex 不溢出 */
.field-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    width: 100%;
}

.field-label {
    width: 55px;
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
    text-align: left;
    margin: 0;
}

/* 輸入框容器：強制不溢出 */
.input-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
}

.input-icon {
    position: absolute;
    left: 0.85rem; /* 圖示位置微調 */
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* 密碼切換按鈕 */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    z-index: 10;
}

/* 輸入框元件基礎設定 - 【重點修改：固定高度與行高，確保完美垂直置中】 */
.ua-input, .ua-select {
    width: 100%;
    height: 44px;
    padding: 0 0.75rem 0 2.75rem; /* 左側 padding 加大到 2.75rem，拉開與 Icon 的距離 */
    font-size: 0.95rem;
    line-height: 42px; /* 扣掉上下 border 各 1px，達成絕對垂直置中 */
    color: #000000;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
}

    .ua-input.has-toggle {
        padding-right: 2.25rem;
    }

    .ua-input:focus, .ua-select:focus {
        border-color: #2563eb;
        background-color: #ffffff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    /* 右側下拉圖示專用定位 (確保點擊穿透) */
    .select-icon {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
        pointer-events: none; /* 重要：讓點擊穿透到下方的 select */
        display: flex;
        align-items: center;
        z-index: 5;
    }

    /* 環境下拉選單：移除 Base64，改由 HTML 注入 Lucide 圖示 */
    .ua-select {
        appearance: none;
        padding-left: 0.75rem; /* 覆蓋掉預設的左側大留白 (因為沒有左側 Icon) */
        padding-right: 2.25rem; /* 預留右側 Lucide 圖示的空間 */
    }

    /* 登入按鈕樣式 */
    .btn-login {
        width: 100%;
        height: 44px; /* 與輸入框高度一致 */
        background-color: #1e40af;
        color: #ffffff;
        font-size: 1.05rem;
        font-weight: 700;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
        transition: all 0.2s;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .btn-login:hover {
        background-color: #1d4ed8;
        transform: translateY(-1px);
    }

    .btn-login:active {
        background-color: #1e3a8a;
        transform: translateY(0);
    }

/* 開發者登入區塊調整 */
.dev-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.btn-dev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 40px;
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-dev:hover {
        background-color: #f1f5f9;
        border-color: #cbd5e1;
    }

/* 錯誤提示 */
.error-box {
    background-color: #fef2f2;
    border: 1px solid #f87171;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* 頁尾資訊 */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: #64748b;
}

.copyright {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.deployment-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #64748b;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

[x-cloak] {
    display: none !important;
}
