﻿/* ===== Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    font-family: "Source Sans Pro", "Helvetica Neue", Roboto, "Noto Sans CJK TC", "Heiti TC", -apple-system, BlinkMacSystemFont, Ubuntu, Cantarell, "微軟正黑體", sans-serif;
    background-color: #ffffff;
    font-size: 14pt;
    text-align: left;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

iframe {
    border: none;
}

/* ===== Wrapper ===== */
.page-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 82%, #eef2f7 100%);
    overflow: hidden;
}

/* ===== Banner ===== */
.banner {
    background-color: #ffffff;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: #000000;
    font-weight: 700;
    text-align: center;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-top: max(0.6rem, env(safe-area-inset-top));
}

/* ===== Content (Login Area) ===== */
.content {
    background-color: #ffffff;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem max(1rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    gap: 1.5rem;
}

    .content .system-title span {
        display: block;
        text-align: center;
        font-weight: 700;
        color: #002060;
        font-size: clamp(1.2rem, 3.5vw, 1.6rem);
        line-height: 1.4;
    }

/* ===== Login Form ===== */
.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 0 0.5rem;
}

.form-label {
    font-weight: 600;
    color: #333;
}

.form-control {
    font-size: 1rem;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
}

    .form-control:focus {
        border-color: #0dcaf0;
        box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.25);
    }

.btn-login {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

    .btn-login:hover {
        background-color: #0bb5d8;
        border-color: #0bb5d8;
    }

    .btn-login:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

/* ===== 身分切換按鈕 ===== */
.role-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #002060;
}

.role-btn {
    flex: 1;
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background-color: #ffffff;
    color: #002060;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    /* 中間分隔線 */
    border-right: 1px solid #002060;
}

    .role-btn:last-child {
        border-right: none;
    }

    .role-btn:hover {
        background-color: #e8edf7;
    }

    /* 選中狀態 */
    .role-btn.active {
        background-color: #002060;
        color: #ffffff;
    }

/* ===== Footer Image ===== */
.footer-img {
    width: 100%;
    margin-top: auto;
    flex: 1 0 0;
    line-height: 0;
    background-color: #eef2f7;
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

    .footer-img img {
        width: 100%;
        max-width: none;
        height: 100%;
        min-height: 100%;
        display: block;
        object-fit: cover;
    }

/* ===== RWD: Mobile ===== */
@media (max-width: 576px) {
    .banner {
        font-size: 1.3rem;
        padding: 0.5rem 0.75rem;
    }

    .content {
        padding: 1.5rem 1rem;
        gap: 1.2rem;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .footer-img img {
        min-height: 120px;
    }

    .role-btn {
        font-size: 0.9rem;
        padding: 0.45rem 0;
    }
}

/* ===== RWD: Tablet ===== */
@media (min-width: 577px) and (max-width: 991px) {
    .login-form-wrapper {
        max-width: 480px;
    }
}
