* { box-sizing: border-box; }

:root {
    /* 卡片的放大倍率。只改這一個數字，卡片的寬度、留白、圓角、字級、
       輸入欄、按鈕、上方浮出的圖都會一起等比放大。
       手機維持 1（卡片本來就已經接近滿寬，再放大會擠掉輸入欄的空間）。 */
    --card-scale: 1;
}
@media (min-width: 641px)  { :root { --card-scale: 1.15; } }
@media (min-width: 1024px) { :root { --card-scale: 1.3; } }

body {
    margin: 0;
    min-height: 100vh;
    /* 上方留出浮出圖的高度，卡片放大後那張圖才不會被視窗頂端切掉；
       內容超過一個螢幕時頁面會自然可以捲動 */
    padding: calc(100px * var(--card-scale) + 24px) 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(45, 80, 215, 0.3), #D9D9D9) fixed;
    background-color: #fff;
    font-family: sans-serif;
}

/* input / button 預設用瀏覽器內建的表單字型，不會繼承 body，要明確要它繼承 */
input, button, select, textarea { font-family: inherit; }

/* 左上角：AMFC Logo，後面緊接著各公司 LOGO（/juji、/alphaloan 等才有） */
#top-logos {
    position: absolute;
    left: 5%;
    top: 3%;
    display: flex;
    align-items: center;
    gap: 24px;
}
#site-logo img { display: block; width: 200px; }
/* 公司 LOGO 限制最大寬高，各家圖片比例不同也不會太大 */
#company-logo img { display: block; max-width: 200px; max-height: 80px; }
@media (max-width: 640px) {
    #top-logos { gap: 12px; }
    #site-logo img { width: 130px; }
    #company-logo img { max-width: 130px; max-height: 52px; }
}

.card {
    width: 100%;
    max-width: calc(360px * var(--card-scale));
    margin: 16px;
    padding: calc(32px * var(--card-scale));
    background: #F6E483;
    border-radius: calc(30px * var(--card-scale));
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    position: relative;
    box-shadow: 8px 6px 5px gray;
}

/* 卡片上方的圖 */
#card-img {
    position: absolute;
    top: calc(-100px * var(--card-scale));
    left: 50%;
    margin-left: calc(-100px * var(--card-scale));
}
.card-img-box {
    width: calc(200px * var(--card-scale));
    height: calc(200px * var(--card-scale));
    overflow: hidden;
}
.card-img-box img { width: 100%; }

h1 {
    margin: calc(70px * var(--card-scale)) 0 calc(24px * var(--card-scale));
    font-size: calc(24px * var(--card-scale));
    text-align: center;
}
label {
    display: block;
    margin-bottom: calc(6px * var(--card-scale));
    font-size: calc(24px * var(--card-scale));
}
input[type=text], input[type=password] {
    width: 100%;
    padding: calc(10px * var(--card-scale));
    margin-bottom: calc(16px * var(--card-scale));
    border: 1px solid #EBC84F;
    border-radius: calc(10px * var(--card-scale));
    font-size: calc(24px * var(--card-scale));
}

/* 密碼欄 + 眼睛切換 */
.password-wrap { position: relative; margin-bottom: calc(16px * var(--card-scale)); }
.password-wrap input { margin-bottom: 0; padding-right: calc(44px * var(--card-scale)); }
.password-wrap input::-ms-reveal,
.password-wrap input::-ms-clear { display: none; } /* 隱藏 Edge 內建的眼睛，避免出現兩個 */
.toggle-password {
    position: absolute;
    top: 50%;
    right: calc(6px * var(--card-scale));
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(32px * var(--card-scale));
    height: calc(32px * var(--card-scale));
    padding: 0;
    border: 0;
    border-radius: calc(6px * var(--card-scale));
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}
.toggle-password:hover { background: #f3f4f6; color: #111827; }
.toggle-password svg { width: calc(20px * var(--card-scale)); height: calc(20px * var(--card-scale)); }
.toggle-password .icon-hide { display: none; }
.toggle-password.showing .icon-show { display: none; }
.toggle-password.showing .icon-hide { display: block; }

.remember {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--card-scale));
    margin-bottom: calc(16px * var(--card-scale));
    font-size: calc(24px * var(--card-scale));
}
.btn-login {
    width: 100%;
    padding: calc(10px * var(--card-scale));
    border: 0;
    border-radius: calc(10px * var(--card-scale));
    background: #4EBCFD;
    color: #fff;
    font-size: calc(24px * var(--card-scale));
    cursor: pointer;
    transition: background .15s;
}
/* 滑過時換底色 */
.btn-login:hover { background: #4161E1; }
.btn-login:focus-visible { background: #4161E1; }
.success, .error {
    margin-bottom: calc(16px * var(--card-scale));
    padding: calc(10px * var(--card-scale));
    border-radius: calc(4px * var(--card-scale));
    font-size: calc(24px * var(--card-scale));
}
.success { background: #dcfce7; color: #166534; }
.error { background: #fee2e2; color: #b91c1c; }
