html, body {
    height: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    font-family: "Microsoft JhengHei", "Heiti TC", sans-serif;
    background: url('../images/bg.jpg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    min-height: 100svh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-card {
    background: white;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 900px;
    text-align: left;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.login-sidebar {
    flex: 1;
    background-color: #f8f9fa;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #eee;
}

.login-main {
    flex: 1.2;
    padding: 40px;
    background-color: white;
}

.lang-switch-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.lang-switch {
    display: inline-flex;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.notice-box {
    border-left: 5px solid #00a0e9;
    padding: 15px;
    background-color: white;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.notice-box a {
    color: #0073cb;
    text-decoration: none;
}

.notice-box a:hover {
    text-decoration: underline;
}

.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    padding: 14px 18px;
    margin-bottom: 24px;
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    animation: shake 0.5s ease-in-out, fadeIn 0.3s ease-out;
}

.error-icon {
    font-size: 18px;
    color: #dc2626;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: #555;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: #eef2f7; /* Light blueish background */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
}

.form-control:focus {
    border-color: #0073cb;
    outline: none;
    background-color: #fff;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #0073cb;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #1e73be;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #1662a5;
}

@media (max-width: 768px), (max-height: 720px) {
    body {
        padding: 0;
        background: none;
        background-color: #f5f6f8;
        display: block; /* Override flex centering if needed */
    }

    .login-card {
        padding: 0;
        margin: 0;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        min-height: 100svh;
        flex-direction: column;
    }

    .login-sidebar {
        padding: 30px 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
        flex: 0 0 auto;
    }

    .login-main {
        padding: 30px 20px;
        flex: 1 0 auto;
    }

    .logo-container {
        margin-top: 0;
        margin-bottom: 20px;
    }
    
    .notice-box {
        margin-bottom: 0;
    }
}

@media (min-width: 769px) and (min-height: 721px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        background-attachment: fixed;
    }

    .login-card {
        margin: 0;
    }
}
