/* =========================================
   1. 基本重置與全局樣式
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f7f9; /* 背景圖變透明時透出的底色 */
    font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
    color: #333;
}

/* 背景圖透明度控制 (使用偽元素防止影響文字) */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-wrapper::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('bg-office.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.4; /* 在此調整背景透明度 (0.1~1.0) */
    z-index: -1;
}

/* =========================================
   2. Logo 區域
   ========================================= */
.logo-area {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
    text-align: center;
}

.main-logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

/* =========================================
   3. 主卡片佈局 (三欄等高關鍵)
   ========================================= */
.glass-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    width: 100%;
    max-width: 1050px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: stretch; /* 關鍵：確保三欄物理高度一致 */
}

.card-section {
    display: flex;
    flex-direction: column; /* 讓內部元素由上而下排列 */
    height: 100%;
}

h3 {
    font-size: 18px;
    color: #444;
    margin-bottom: 20px;
    text-align: center;
}

/* =========================================
   4. 第一欄：會員登入
   ========================================= */
.input-field { margin-bottom: 12px; }

input[type="text"], 
input[type="password"] {
    width: 100%; /* 回復輸入框寬度 */
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: 0.3s;
}

input:focus { outline: none; border-color: #4CAF50; }

/* 修正 Checkbox 不跳行與對齊 */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin: 10px 0 20px;
    color: #666;
    width: 100%;
}

.options-row label {
    display: flex;
    align-items: center;
    white-space: nowrap; /* 強制文字不換行 */
    cursor: pointer;
}

.options-row input[type="checkbox"] {
    width: auto; /* 覆蓋全域 input 寬度，確保勾選框不變長 */
    margin-right: 6px;
}

.forgot-link {
    text-decoration: none;
    color: #4CAF50;
    white-space: nowrap;
}

.btn-login {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: auto; /* 將按鈕推至底部對齊 */
}

.btn-login:hover { background: #3d8b40; }

.register-hint {
    margin-top: 15px;
    font-size: 13px;
    text-align: center;
    color: #888;
}

/* =========================================
   5. 第二欄：加入會員 (橘色區塊)
   ========================================= */
.promo-box {
    background: #E67E22;
    color: white;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    flex: 1; /* 關鍵：填滿中間欄位所有剩餘空間 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.promo-text { font-size: 14px; line-height: 1.6; margin-bottom: 15px; }

.btn-signup {
    background: white;
    color: #E67E22;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-signup:hover { transform: scale(1.05); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.benefit-list {
    text-align: left;
    font-size: 12px;
    margin-top: 20px;
    list-style: none;
    opacity: 0.95;
}

/* =========================================
   6. 第三欄：訪客專區 (輪播)
   ========================================= */
.ad-banner {
    position: relative;
    height: 150px; /* 固定 Banner 高度 */
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.banner-item {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden; transition: opacity 1s;
}

.banner-item.active { opacity: 1; visibility: visible; z-index: 1; }

.banner-item img { width: 100%; height: 100%; object-fit: cover; }

/* 圓點與標籤 */
.banner-tag {
    position: absolute; top: 8px; right: 8px;
    background: #ff4757; color: white;
    padding: 3px 8px; border-radius: 4px;
    font-size: 10px; font-weight: bold; z-index: 3;
}

.banner-dots {
    position: absolute; bottom: 10px; left: 0; width: 100%;
    display: flex; justify-content: center; gap: 8px; z-index: 4;
}

.dot {
    width: 8px; height: 8px; background: rgba(255,255,255,0.5);
    border-radius: 50%; cursor: pointer;
}

.dot.active { background: white; transform: scale(1.2); }

.guest-link {
    margin-top: auto; /* 將按鈕推至底部對齊 */
    text-decoration: none;
    color: #888;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    transition: 0.3s;
}

.guest-link:hover { background: white; border-color: #bbb; }

/* =========================================
   7. 響應式處理
   ========================================= */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr; /* 手機版變為單欄 */
    }
    .glass-card {
        padding: 25px;
    }
    .promo-box {
        margin: 20px 0; /* 增加間距 */
    }
}